diff --git a/Cargo.lock b/Cargo.lock index 37b5915d21..1127530886 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -169,8 +169,6 @@ dependencies = [ "serde_json", "serde_repr", "serde_with", - "tokio", - "tokio-util", "url", "uuid", ] diff --git a/Makefile b/Makefile index 2f3407e8dc..67f612e154 100644 --- a/Makefile +++ b/Makefile @@ -205,10 +205,10 @@ gen-diff: ## (Release) generate the changelog diff between the current schema a npx prettier --write diff.md gen-client-go: ## Build and install the authentik API for Golang - make -C "${PWD}/packages/client-go" build + $(UV) run make -C "${PWD}/packages/client-go" build gen-client-rust: ## Build and install the authentik API for Rust - make -C "${PWD}/packages/client-rust" build version=${NPM_VERSION} + $(UV) run make -C "${PWD}/packages/client-rust" build version=${NPM_VERSION} make lint-fix-rust gen-client-ts: ## Build and install the authentik API for Typescript into the authentik UI Application diff --git a/packages/client-go/.openapi-generator-ignore b/packages/client-go/.openapi-generator-ignore index 9edfecd641..d30a54720e 100644 --- a/packages/client-go/.openapi-generator-ignore +++ b/packages/client-go/.openapi-generator-ignore @@ -3,7 +3,4 @@ go.sum .gitignore .travis.yml README.md -api/** -docs/** git_push.sh -test/** diff --git a/packages/client-go/Makefile b/packages/client-go/Makefile index dc3fb3192b..29b58f6274 100644 --- a/packages/client-go/Makefile +++ b/packages/client-go/Makefile @@ -5,11 +5,12 @@ GID = $(shell id -g) build: rm -rf "${PWD}"/*.go + "${PWD}/../../scripts/api_filter_schema.py" "${PWD}/../../schema.yml" "${PWD}/schema.yml" "${PWD}/operation_ids" docker compose run --rm --user "${UID}:${GID}" gen \ generate \ - -i /schema.yml \ + -i /local/schema.yml \ -g go \ -o local \ -c /local/config.yaml - rm -rf "${PWD}/.openapi-generator" + rm -rf "${PWD}/.openapi-generator" "${PWD}/api/openapi.yaml" "${PWD}/schema.yml" go fmt . diff --git a/packages/client-go/api_admin.go b/packages/client-go/api_admin.go deleted file mode 100644 index dcaeb9bab6..0000000000 --- a/packages/client-go/api_admin.go +++ /dev/null @@ -1,1863 +0,0 @@ -/* -authentik - -Making authentication simple. - -API 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 *UsageEnum -} - -func (r ApiAdminFileDestroyRequest) Name(name string) ApiAdminFileDestroyRequest { - r.name = &name - return r -} - -func (r ApiAdminFileDestroyRequest) Usage(usage UsageEnum) 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 UsageEnum = "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 *UsageEnum -} - -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 UsageEnum) 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 UsageEnum = "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 deleted file mode 100644 index 67d16a528c..0000000000 --- a/packages/client-go/api_authenticators.go +++ /dev/null @@ -1,11170 +0,0 @@ -/* -authentik - -Making authentication simple. - -API 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 index bd05db13ce..239b01b916 100644 --- a/packages/client-go/api_core.go +++ b/packages/client-go/api_core.go @@ -25,3157 +25,6 @@ import ( // 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 @@ -3480,894 +329,6 @@ func (a *CoreAPIService) CoreBrandsListExecute(r ApiCoreBrandsListRequest) (*Pag 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 @@ -4644,3482 +605,6 @@ func (a *CoreAPIService) CoreGroupsListExecute(r ApiCoreGroupsListRequest) (*Pag 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 *IntentEnum - 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 IntentEnum) 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_ *[]UserTypeEnum - 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_ []UserTypeEnum) 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 @@ -8685,527 +1170,6 @@ func (a *CoreAPIService) CoreUsersMeRetrieveExecute(r ApiCoreUsersMeRetrieveRequ 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 @@ -9330,509 +1294,3 @@ func (a *CoreAPIService) CoreUsersRetrieveExecute(r ApiCoreUsersRetrieveRequest) 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 index 5175242475..e650d619bb 100644 --- a/packages/client-go/api_crypto.go +++ b/packages/client-go/api_crypto.go @@ -17,718 +17,12 @@ import ( "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 *[]KeyTypeEnum - 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 -} - -func (r ApiCryptoCertificatekeypairsListRequest) KeyType(keyType []KeyTypeEnum) 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 @@ -854,267 +148,6 @@ func (a *CryptoAPIService) CryptoCertificatekeypairsRetrieveExecute(r ApiCryptoC 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 diff --git a/packages/client-go/api_endpoints.go b/packages/client-go/api_endpoints.go deleted file mode 100644 index aa14dc547b..0000000000 --- a/packages/client-go/api_endpoints.go +++ /dev/null @@ -1,8438 +0,0 @@ -/* -authentik - -Making authentication simple. - -API 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 deleted file mode 100644 index 6d44944c74..0000000000 --- a/packages/client-go/api_enterprise.go +++ /dev/null @@ -1,1334 +0,0 @@ -/* -authentik - -Making authentication simple. - -API 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 index e02af61c03..7c4c58c0af 100644 --- a/packages/client-go/api_events.go +++ b/packages/client-go/api_events.go @@ -17,135 +17,11 @@ import ( "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 @@ -277,4683 +153,3 @@ func (a *EventsAPIService) EventsEventsCreateExecute(r ApiEventsEventsCreateRequ 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 *[]EventActions - brandName *string - clientIp *string - contextAuthorizedApp *string - contextDevice *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 []EventActions) 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 Device Primary Key -func (r ApiEventsEventsExportCreateRequest) ContextDevice(contextDevice string) ApiEventsEventsExportCreateRequest { - r.contextDevice = &contextDevice - 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.contextDevice != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "context_device", r.contextDevice, "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 *[]EventActions - brandName *string - clientIp *string - contextAuthorizedApp *string - contextDevice *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 []EventActions) 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 Device Primary Key -func (r ApiEventsEventsListRequest) ContextDevice(contextDevice string) ApiEventsEventsListRequest { - r.contextDevice = &contextDevice - 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.contextDevice != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "context_device", r.contextDevice, "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 ApiEventsEventsStatsRetrieveRequest struct { - ctx context.Context - ApiService *EventsAPIService - countSteps *[]string - action *string - actions *[]EventActions - brandName *string - clientIp *string - contextAuthorizedApp *string - contextDevice *string - contextModelApp *string - contextModelName *string - contextModelPk *string - ordering *string - search *string - username *string -} - -// Timedelta, format of 'weeks=3;days=2;hours=3,seconds=2' -func (r ApiEventsEventsStatsRetrieveRequest) CountSteps(countSteps []string) ApiEventsEventsStatsRetrieveRequest { - r.countSteps = &countSteps - return r -} - -func (r ApiEventsEventsStatsRetrieveRequest) Action(action string) ApiEventsEventsStatsRetrieveRequest { - r.action = &action - return r -} - -func (r ApiEventsEventsStatsRetrieveRequest) Actions(actions []EventActions) ApiEventsEventsStatsRetrieveRequest { - r.actions = &actions - return r -} - -// Brand name -func (r ApiEventsEventsStatsRetrieveRequest) BrandName(brandName string) ApiEventsEventsStatsRetrieveRequest { - r.brandName = &brandName - return r -} - -func (r ApiEventsEventsStatsRetrieveRequest) ClientIp(clientIp string) ApiEventsEventsStatsRetrieveRequest { - r.clientIp = &clientIp - return r -} - -// Context Authorized application -func (r ApiEventsEventsStatsRetrieveRequest) ContextAuthorizedApp(contextAuthorizedApp string) ApiEventsEventsStatsRetrieveRequest { - r.contextAuthorizedApp = &contextAuthorizedApp - return r -} - -// Context Device Primary Key -func (r ApiEventsEventsStatsRetrieveRequest) ContextDevice(contextDevice string) ApiEventsEventsStatsRetrieveRequest { - r.contextDevice = &contextDevice - return r -} - -// Context Model App -func (r ApiEventsEventsStatsRetrieveRequest) ContextModelApp(contextModelApp string) ApiEventsEventsStatsRetrieveRequest { - r.contextModelApp = &contextModelApp - return r -} - -// Context Model Name -func (r ApiEventsEventsStatsRetrieveRequest) ContextModelName(contextModelName string) ApiEventsEventsStatsRetrieveRequest { - r.contextModelName = &contextModelName - return r -} - -// Context Model Primary Key -func (r ApiEventsEventsStatsRetrieveRequest) ContextModelPk(contextModelPk string) ApiEventsEventsStatsRetrieveRequest { - r.contextModelPk = &contextModelPk - return r -} - -// Which field to use when ordering the results. -func (r ApiEventsEventsStatsRetrieveRequest) Ordering(ordering string) ApiEventsEventsStatsRetrieveRequest { - r.ordering = &ordering - return r -} - -// A search term. -func (r ApiEventsEventsStatsRetrieveRequest) Search(search string) ApiEventsEventsStatsRetrieveRequest { - r.search = &search - return r -} - -// Username -func (r ApiEventsEventsStatsRetrieveRequest) Username(username string) ApiEventsEventsStatsRetrieveRequest { - r.username = &username - return r -} - -func (r ApiEventsEventsStatsRetrieveRequest) Execute() (*EventStats, *http.Response, error) { - return r.ApiService.EventsEventsStatsRetrieveExecute(r) -} - -/* -EventsEventsStatsRetrieve Method for EventsEventsStatsRetrieve - -Get event stats for specified filters and count steps - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @return ApiEventsEventsStatsRetrieveRequest -*/ -func (a *EventsAPIService) EventsEventsStatsRetrieve(ctx context.Context) ApiEventsEventsStatsRetrieveRequest { - return ApiEventsEventsStatsRetrieveRequest{ - ApiService: a, - ctx: ctx, - } -} - -// Execute executes the request -// -// @return EventStats -func (a *EventsAPIService) EventsEventsStatsRetrieveExecute(r ApiEventsEventsStatsRetrieveRequest) (*EventStats, *http.Response, error) { - var ( - localVarHTTPMethod = http.MethodGet - localVarPostBody interface{} - formFiles []formFile - localVarReturnValue *EventStats - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "EventsAPIService.EventsEventsStatsRetrieve") - if err != nil { - return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} - } - - localVarPath := localBasePath + "/events/events/stats/" - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - if r.countSteps == nil { - return localVarReturnValue, nil, reportError("countSteps is required and must be specified") - } - - 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.contextDevice != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "context_device", r.contextDevice, "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", "") - } - { - t := *r.countSteps - if reflect.TypeOf(t).Kind() == reflect.Slice { - s := reflect.ValueOf(t) - for i := 0; i < s.Len(); i++ { - parameterAddToHeaderOrQuery(localVarQueryParams, "count_steps", s.Index(i).Interface(), "form", "multi") - } - } else { - parameterAddToHeaderOrQuery(localVarQueryParams, "count_steps", t, "form", "multi") - } - } - 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 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 *[]EventActions - brandName *string - clientIp *string - contextAuthorizedApp *string - contextDevice *string - contextModelApp *string - contextModelName *string - contextModelPk *string - historyDays *int32 - ordering *string - search *string - username *string -} - -func (r ApiEventsEventsVolumeListRequest) Action(action string) ApiEventsEventsVolumeListRequest { - r.action = &action - return r -} - -func (r ApiEventsEventsVolumeListRequest) Actions(actions []EventActions) 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 Device Primary Key -func (r ApiEventsEventsVolumeListRequest) ContextDevice(contextDevice string) ApiEventsEventsVolumeListRequest { - r.contextDevice = &contextDevice - 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 int32) 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.contextDevice != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "context_device", r.contextDevice, "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 int32 = 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 *SeverityEnum - 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 SeverityEnum) 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 *SeverityEnum -} - -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 -} - -func (r ApiEventsRulesListRequest) Severity(severity SeverityEnum) 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 *TransportModeEnum - name *string - ordering *string - page *int32 - pageSize *int32 - search *string - sendOnce *bool - webhookUrl *string -} - -func (r ApiEventsTransportsListRequest) Mode(mode TransportModeEnum) 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 index 32a9d17825..cb458b75fa 100644 --- a/packages/client-go/api_flows.go +++ b/packages/client-go/api_flows.go @@ -17,1037 +17,12 @@ import ( "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 *InvalidResponseActionEnum - order *int32 - ordering *string - page *int32 - pageSize *int32 - pbmUuid *string - policies *[]string - policyEngineMode *PolicyEngineMode - 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 -} - -func (r ApiFlowsBindingsListRequest) InvalidResponseAction(invalidResponseAction InvalidResponseActionEnum) 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 PolicyEngineMode) 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 @@ -1327,1670 +302,3 @@ func (a *FlowsAPIService) FlowsExecutorSolveExecute(r ApiFlowsExecutorSolveReque 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 ApiFlowsInstancesListRequest struct { - ctx context.Context - ApiService *FlowsAPIService - deniedAction *DeniedActionEnum - designation *FlowDesignationEnum - flowUuid *string - name *string - ordering *string - page *int32 - pageSize *int32 - search *string - slug *string -} - -func (r ApiFlowsInstancesListRequest) DeniedAction(deniedAction DeniedActionEnum) ApiFlowsInstancesListRequest { - r.deniedAction = &deniedAction - return r -} - -func (r ApiFlowsInstancesListRequest) Designation(designation FlowDesignationEnum) 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 deleted file mode 100644 index f83cee581b..0000000000 --- a/packages/client-go/api_lifecycle.go +++ /dev/null @@ -1,1388 +0,0 @@ -/* -authentik - -Making authentication simple. - -API 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 deleted file mode 100644 index 71319aa829..0000000000 --- a/packages/client-go/api_managed.go +++ /dev/null @@ -1,1365 +0,0 @@ -/* -authentik - -Making authentication simple. - -API 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" -) - -// 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 ApiManagedBlueprintsImportCreateRequest struct { - ctx context.Context - ApiService *ManagedAPIService - file *os.File - path *string -} - -func (r ApiManagedBlueprintsImportCreateRequest) File(file *os.File) ApiManagedBlueprintsImportCreateRequest { - r.file = file - return r -} - -func (r ApiManagedBlueprintsImportCreateRequest) Path(path string) ApiManagedBlueprintsImportCreateRequest { - r.path = &path - return r -} - -func (r ApiManagedBlueprintsImportCreateRequest) Execute() (*BlueprintImportResult, *http.Response, error) { - return r.ApiService.ManagedBlueprintsImportCreateExecute(r) -} - -/* -ManagedBlueprintsImportCreate Method for ManagedBlueprintsImportCreate - -Import blueprint from .yaml file and apply it once, without creating an instance - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @return ApiManagedBlueprintsImportCreateRequest -*/ -func (a *ManagedAPIService) ManagedBlueprintsImportCreate(ctx context.Context) ApiManagedBlueprintsImportCreateRequest { - return ApiManagedBlueprintsImportCreateRequest{ - ApiService: a, - ctx: ctx, - } -} - -// Execute executes the request -// -// @return BlueprintImportResult -func (a *ManagedAPIService) ManagedBlueprintsImportCreateExecute(r ApiManagedBlueprintsImportCreateRequest) (*BlueprintImportResult, *http.Response, error) { - var ( - localVarHTTPMethod = http.MethodPost - localVarPostBody interface{} - formFiles []formFile - localVarReturnValue *BlueprintImportResult - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ManagedAPIService.ManagedBlueprintsImportCreate") - if err != nil { - return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} - } - - localVarPath := localBasePath + "/managed/blueprints/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.path != nil { - parameterAddToHeaderOrQuery(localVarFormParams, "path", r.path, "", "") - } - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) - if err != nil { - return localVarReturnValue, nil, err - } - - localVarHTTPResponse, err := a.client.callAPI(req) - if err != nil || localVarHTTPResponse == nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) - localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) - if err != nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - if localVarHTTPResponse.StatusCode >= 300 { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - if localVarHTTPResponse.StatusCode == 400 { - var v BlueprintImportResult - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - return localVarReturnValue, localVarHTTPResponse, newErr - } - if localVarHTTPResponse.StatusCode == 403 { - var v GenericError - err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.error = err.Error() - return localVarReturnValue, localVarHTTPResponse, newErr - } - newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.model = v - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr := &GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - return localVarReturnValue, 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 deleted file mode 100644 index 84b18ff7d2..0000000000 --- a/packages/client-go/api_oauth2.go +++ /dev/null @@ -1,1650 +0,0 @@ -/* -authentik - -Making authentication simple. - -API 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 index 758cf0539c..6bb223f277 100644 --- a/packages/client-go/api_outposts.go +++ b/packages/client-go/api_outposts.go @@ -24,597 +24,6 @@ import ( // 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 @@ -856,525 +265,6 @@ func (a *OutpostsAPIService) OutpostsInstancesListExecute(r ApiOutpostsInstances 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 @@ -2152,2695 +1042,3 @@ func (a *OutpostsAPIService) OutpostsRadiusListExecute(r ApiOutpostsRadiusListRe 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 deleted file mode 100644 index 010e29b60e..0000000000 --- a/packages/client-go/api_policies.go +++ /dev/null @@ -1,10687 +0,0 @@ -/* -authentik - -Making authentication simple. - -API 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 *EventActions - 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 -} - -func (r ApiPoliciesEventMatcherListRequest) Action(action EventActions) 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 deleted file mode 100644 index 153c18b85e..0000000000 --- a/packages/client-go/api_propertymappings.go +++ /dev/null @@ -1,15246 +0,0 @@ -/* -authentik - -Making authentication simple. - -API 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 deleted file mode 100644 index 44c48f6fd5..0000000000 --- a/packages/client-go/api_providers.go +++ /dev/null @@ -1,17777 +0,0 @@ -/* -authentik - -Making authentication simple. - -API 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 *ClientTypeEnum - includeClaimsInIdToken *bool - issuerMode *IssuerModeEnum - name *string - ordering *string - page *int32 - pageSize *int32 - propertyMappings *[]string - refreshTokenValidity *string - search *string - signingKey *string - subMode *SubModeEnum -} - -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 -} - -func (r ApiProvidersOauth2ListRequest) ClientType(clientType ClientTypeEnum) ApiProvidersOauth2ListRequest { - r.clientType = &clientType - return r -} - -func (r ApiProvidersOauth2ListRequest) IncludeClaimsInIdToken(includeClaimsInIdToken bool) ApiProvidersOauth2ListRequest { - r.includeClaimsInIdToken = &includeClaimsInIdToken - return r -} - -func (r ApiProvidersOauth2ListRequest) IssuerMode(issuerMode IssuerModeEnum) 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 -} - -func (r ApiProvidersOauth2ListRequest) SubMode(subMode SubModeEnum) 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 *SAMLNameIDPolicyEnum - defaultRelayState *string - digestAlgorithm *DigestAlgorithmEnum - encryptionKp *string - invalidationFlow *string - isBackchannel *bool - issuer *string - logoutMethod *SAMLLogoutMethods - 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 *SignatureAlgorithmEnum - signingKp *string - slsBinding *SAMLBindingsEnum - slsUrl *string - spBinding *SAMLBindingsEnum - 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 SAMLNameIDPolicyEnum) ApiProvidersSamlListRequest { - r.defaultNameIdPolicy = &defaultNameIdPolicy - return r -} - -func (r ApiProvidersSamlListRequest) DefaultRelayState(defaultRelayState string) ApiProvidersSamlListRequest { - r.defaultRelayState = &defaultRelayState - return r -} - -func (r ApiProvidersSamlListRequest) DigestAlgorithm(digestAlgorithm DigestAlgorithmEnum) 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 -} - -func (r ApiProvidersSamlListRequest) LogoutMethod(logoutMethod SAMLLogoutMethods) 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 SignatureAlgorithmEnum) ApiProvidersSamlListRequest { - r.signatureAlgorithm = &signatureAlgorithm - return r -} - -func (r ApiProvidersSamlListRequest) SigningKp(signingKp string) ApiProvidersSamlListRequest { - r.signingKp = &signingKp - return r -} - -func (r ApiProvidersSamlListRequest) SlsBinding(slsBinding SAMLBindingsEnum) ApiProvidersSamlListRequest { - r.slsBinding = &slsBinding - return r -} - -func (r ApiProvidersSamlListRequest) SlsUrl(slsUrl string) ApiProvidersSamlListRequest { - r.slsUrl = &slsUrl - return r -} - -func (r ApiProvidersSamlListRequest) SpBinding(spBinding SAMLBindingsEnum) 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 *ForceBindingEnum -} - -func (r ApiProvidersSamlMetadataRetrieveRequest) Download(download bool) ApiProvidersSamlMetadataRetrieveRequest { - r.download = &download - return r -} - -func (r ApiProvidersSamlMetadataRetrieveRequest) ForceBinding(forceBinding ForceBindingEnum) 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 *SAMLNameIDPolicyEnum - defaultRelayState *string - digestAlgorithm *DigestAlgorithmEnum - encryptionKp *string - invalidationFlow *string - isBackchannel *bool - issuer *string - logoutMethod *SAMLLogoutMethods - 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 *SignatureAlgorithmEnum - signingKp *string - slsBinding *SAMLBindingsEnum - slsUrl *string - spBinding *SAMLBindingsEnum - 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 SAMLNameIDPolicyEnum) ApiProvidersWsfedListRequest { - r.defaultNameIdPolicy = &defaultNameIdPolicy - return r -} - -func (r ApiProvidersWsfedListRequest) DefaultRelayState(defaultRelayState string) ApiProvidersWsfedListRequest { - r.defaultRelayState = &defaultRelayState - return r -} - -func (r ApiProvidersWsfedListRequest) DigestAlgorithm(digestAlgorithm DigestAlgorithmEnum) 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 -} - -func (r ApiProvidersWsfedListRequest) LogoutMethod(logoutMethod SAMLLogoutMethods) 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 SignatureAlgorithmEnum) ApiProvidersWsfedListRequest { - r.signatureAlgorithm = &signatureAlgorithm - return r -} - -func (r ApiProvidersWsfedListRequest) SigningKp(signingKp string) ApiProvidersWsfedListRequest { - r.signingKp = &signingKp - return r -} - -func (r ApiProvidersWsfedListRequest) SlsBinding(slsBinding SAMLBindingsEnum) ApiProvidersWsfedListRequest { - r.slsBinding = &slsBinding - return r -} - -func (r ApiProvidersWsfedListRequest) SlsUrl(slsUrl string) ApiProvidersWsfedListRequest { - r.slsUrl = &slsUrl - return r -} - -func (r ApiProvidersWsfedListRequest) SpBinding(spBinding SAMLBindingsEnum) 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 *ForceBindingEnum -} - -func (r ApiProvidersWsfedMetadataRetrieveRequest) Download(download bool) ApiProvidersWsfedMetadataRetrieveRequest { - r.download = &download - return r -} - -func (r ApiProvidersWsfedMetadataRetrieveRequest) ForceBinding(forceBinding ForceBindingEnum) 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 deleted file mode 100644 index d534acfcbc..0000000000 --- a/packages/client-go/api_rac.go +++ /dev/null @@ -1,1785 +0,0 @@ -/* -authentik - -Making authentication simple. - -API 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 deleted file mode 100644 index ef975fd073..0000000000 --- a/packages/client-go/api_rbac.go +++ /dev/null @@ -1,3126 +0,0 @@ -/* -authentik - -Making authentication simple. - -API 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 deleted file mode 100644 index 4b64670b3e..0000000000 --- a/packages/client-go/api_reports.go +++ /dev/null @@ -1,417 +0,0 @@ -/* -authentik - -Making authentication simple. - -API 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_schema.go b/packages/client-go/api_schema.go deleted file mode 100644 index 43565ce8fb..0000000000 --- a/packages/client-go/api_schema.go +++ /dev/null @@ -1,165 +0,0 @@ -/* -authentik - -Making authentication simple. - -API 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 *FormatEnum - lang *LangEnum -} - -func (r ApiSchemaRetrieveRequest) Format(format FormatEnum) ApiSchemaRetrieveRequest { - r.format = &format - return r -} - -func (r ApiSchemaRetrieveRequest) Lang(lang LangEnum) 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 deleted file mode 100644 index 4c1e47f80c..0000000000 --- a/packages/client-go/api_sources.go +++ /dev/null @@ -1,24082 +0,0 @@ -/* -authentik - -Making authentication simple. - -API 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 *KadminTypeEnum - 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 -} - -func (r ApiSourcesKerberosListRequest) KadminType(kadminType KadminTypeEnum) 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 *GroupMatchingModeEnum - hasJwks *bool - name *string - ordering *string - page *int32 - pageSize *int32 - pbmUuid *string - policyEngineMode *PolicyEngineMode - profileUrl *string - providerType *string - requestTokenUrl *string - search *string - slug *string - userMatchingMode *UserMatchingModeEnum -} - -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 -} - -func (r ApiSourcesOauthListRequest) GroupMatchingMode(groupMatchingMode GroupMatchingModeEnum) 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 PolicyEngineMode) 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 -} - -func (r ApiSourcesOauthListRequest) UserMatchingMode(userMatchingMode UserMatchingModeEnum) 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 *GroupMatchingModeEnum - name *string - ordering *string - page *int32 - pageSize *int32 - pbmUuid *string - policyEngineMode *PolicyEngineMode - search *string - slug *string - userMatchingMode *UserMatchingModeEnum -} - -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 -} - -func (r ApiSourcesPlexListRequest) GroupMatchingMode(groupMatchingMode GroupMatchingModeEnum) 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 PolicyEngineMode) 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 -} - -func (r ApiSourcesPlexListRequest) UserMatchingMode(userMatchingMode UserMatchingModeEnum) 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 *BindingTypeEnum - digestAlgorithm *DigestAlgorithmEnum - enabled *bool - enrollmentFlow *string - forceAuthn *bool - issuer *string - managed *string - name *string - nameIdPolicy *SAMLNameIDPolicyEnum - ordering *string - page *int32 - pageSize *int32 - pbmUuid *string - policyEngineMode *PolicyEngineMode - preAuthenticationFlow *string - search *string - signatureAlgorithm *SignatureAlgorithmEnum - signedAssertion *bool - signedResponse *bool - signingKp *string - sloUrl *string - slug *string - ssoUrl *string - temporaryUserDeleteAfter *string - userMatchingMode *UserMatchingModeEnum - 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 BindingTypeEnum) ApiSourcesSamlListRequest { - r.bindingType = &bindingType - return r -} - -func (r ApiSourcesSamlListRequest) DigestAlgorithm(digestAlgorithm DigestAlgorithmEnum) 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) ForceAuthn(forceAuthn bool) ApiSourcesSamlListRequest { - r.forceAuthn = &forceAuthn - 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 -} - -func (r ApiSourcesSamlListRequest) NameIdPolicy(nameIdPolicy SAMLNameIDPolicyEnum) 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 PolicyEngineMode) 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 SignatureAlgorithmEnum) 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 -} - -func (r ApiSourcesSamlListRequest) UserMatchingMode(userMatchingMode UserMatchingModeEnum) 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.forceAuthn != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "force_authn", r.forceAuthn, "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 *GroupMatchingModeEnum - name *string - ordering *string - page *int32 - pageSize *int32 - pbmUuid *string - policyEngineMode *PolicyEngineMode - requestMessageAccess *bool - search *string - slug *string - userMatchingMode *UserMatchingModeEnum -} - -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 -} - -func (r ApiSourcesTelegramListRequest) GroupMatchingMode(groupMatchingMode GroupMatchingModeEnum) 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 PolicyEngineMode) 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 -} - -func (r ApiSourcesTelegramListRequest) UserMatchingMode(userMatchingMode UserMatchingModeEnum) 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 deleted file mode 100644 index 9e4c08a629..0000000000 --- a/packages/client-go/api_ssf.go +++ /dev/null @@ -1,450 +0,0 @@ -/* -authentik - -Making authentication simple. - -API 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 ApiSsfStreamsDestroyRequest struct { - ctx context.Context - ApiService *SsfAPIService - uuid string -} - -func (r ApiSsfStreamsDestroyRequest) Execute() (*http.Response, error) { - return r.ApiService.SsfStreamsDestroyExecute(r) -} - -/* -SsfStreamsDestroy Method for SsfStreamsDestroy - -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 ApiSsfStreamsDestroyRequest -*/ -func (a *SsfAPIService) SsfStreamsDestroy(ctx context.Context, uuid string) ApiSsfStreamsDestroyRequest { - return ApiSsfStreamsDestroyRequest{ - ApiService: a, - ctx: ctx, - uuid: uuid, - } -} - -// Execute executes the request -func (a *SsfAPIService) SsfStreamsDestroyExecute(r ApiSsfStreamsDestroyRequest) (*http.Response, error) { - var ( - localVarHTTPMethod = http.MethodDelete - localVarPostBody interface{} - formFiles []formFile - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "SsfAPIService.SsfStreamsDestroy") - if err != nil { - return 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 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 ApiSsfStreamsListRequest struct { - ctx context.Context - ApiService *SsfAPIService - deliveryMethod *DeliveryMethodEnum - endpointUrl *string - ordering *string - page *int32 - pageSize *int32 - provider *int32 - search *string -} - -func (r ApiSsfStreamsListRequest) DeliveryMethod(deliveryMethod DeliveryMethodEnum) 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 deleted file mode 100644 index fd8ba4e660..0000000000 --- a/packages/client-go/api_stages.go +++ /dev/null @@ -1,28136 +0,0 @@ -/* -authentik - -Making authentication simple. - -API 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 *AuthTypeEnum - configureFlow *string - friendlyName *string - fromNumber *string - mapping *string - name *string - ordering *string - page *int32 - pageSize *int32 - provider *ProviderEnum - 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 AuthTypeEnum) 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 ProviderEnum) 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 *DigitsEnum - 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 DigitsEnum) 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 *NotConfiguredActionEnum - 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 NotConfiguredActionEnum) 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 *AuthenticatorAttachmentEnum - configureFlow *string - deviceTypeRestrictions *[]string - maxAttempts *int32 - name *string - ordering *string - page *int32 - pageSize *int32 - residentKeyRequirement *UserVerificationEnum - search *string - userVerification *UserVerificationEnum -} - -func (r ApiStagesAuthenticatorWebauthnListRequest) AuthenticatorAttachment(authenticatorAttachment AuthenticatorAttachmentEnum) 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 UserVerificationEnum) 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 UserVerificationEnum) 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 *ConsentModeEnum - 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 ConsentModeEnum) 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 *CertAttributeEnum - certificateAuthorities *[]string - mode *StageModeEnum - name *string - ordering *string - page *int32 - pageSize *int32 - search *string - stageUuid *string - userAttribute *UserAttributeEnum -} - -func (r ApiStagesMtlsListRequest) CertAttribute(certAttribute CertAttributeEnum) ApiStagesMtlsListRequest { - r.certAttribute = &certAttribute - return r -} - -func (r ApiStagesMtlsListRequest) CertificateAuthorities(certificateAuthorities []string) ApiStagesMtlsListRequest { - r.certificateAuthorities = &certificateAuthorities - return r -} - -func (r ApiStagesMtlsListRequest) Mode(mode StageModeEnum) 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 UserAttributeEnum) 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_ *PromptTypeEnum -} - -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_ PromptTypeEnum) 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 *GeoipBindingEnum - name *string - networkBinding *NetworkBindingEnum - ordering *string - page *int32 - pageSize *int32 - rememberDevice *string - rememberMeOffset *string - search *string - sessionDuration *string - stageUuid *string - terminateOtherSessions *bool -} - -func (r ApiStagesUserLoginListRequest) GeoipBinding(geoipBinding GeoipBindingEnum) ApiStagesUserLoginListRequest { - r.geoipBinding = &geoipBinding - return r -} - -func (r ApiStagesUserLoginListRequest) Name(name string) ApiStagesUserLoginListRequest { - r.name = &name - return r -} - -func (r ApiStagesUserLoginListRequest) NetworkBinding(networkBinding NetworkBindingEnum) 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 *UserCreationModeEnum - userPathTemplate *string - userType *UserTypeEnum -} - -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 UserCreationModeEnum) ApiStagesUserWriteListRequest { - r.userCreationMode = &userCreationMode - return r -} - -func (r ApiStagesUserWriteListRequest) UserPathTemplate(userPathTemplate string) ApiStagesUserWriteListRequest { - r.userPathTemplate = &userPathTemplate - return r -} - -func (r ApiStagesUserWriteListRequest) UserType(userType UserTypeEnum) 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 deleted file mode 100644 index e81492be98..0000000000 --- a/packages/client-go/api_tasks.go +++ /dev/null @@ -1,1445 +0,0 @@ -/* -authentik - -Making authentication simple. - -API 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 *[]TaskAggregatedStatusEnum - ordering *string - page *int32 - pageSize *int32 - queueName *string - relObjContentTypeAppLabel *string - relObjContentTypeModel *string - relObjId *string - relObjIdIsnull *bool - search *string - state *TaskStatusEnum -} - -func (r ApiTasksTasksListRequest) ActorName(actorName string) ApiTasksTasksListRequest { - r.actorName = &actorName - return r -} - -func (r ApiTasksTasksListRequest) AggregatedStatus(aggregatedStatus []TaskAggregatedStatusEnum) 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 -} - -func (r ApiTasksTasksListRequest) State(state TaskStatusEnum) 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 deleted file mode 100644 index 1eda4b55af..0000000000 --- a/packages/client-go/api_tenants.go +++ /dev/null @@ -1,1862 +0,0 @@ -/* -authentik - -Making authentication simple. - -API 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 index ed9899e794..2dfb593c04 100644 --- a/packages/client-go/client.go +++ b/packages/client-go/client.go @@ -49,55 +49,17 @@ type APIClient struct { // 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 { @@ -116,31 +78,12 @@ func NewAPIClient(cfg *Configuration) *APIClient { 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 } @@ -490,11 +433,6 @@ func (c *APIClient) prepareRequest( // 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 { diff --git a/packages/client-go/compose.yml b/packages/client-go/compose.yml index fd3ad5c8bb..c155090cd5 100644 --- a/packages/client-go/compose.yml +++ b/packages/client-go/compose.yml @@ -6,4 +6,3 @@ services: network_mode: none volumes: - ./:/local - - ../../schema.yml:/schema.yml:ro diff --git a/packages/client-go/config.yaml b/packages/client-go/config.yaml index b203fc2857..8abb8f757c 100644 --- a/packages/client-go/config.yaml +++ b/packages/client-go/config.yaml @@ -1,5 +1,12 @@ --- -# templateDir: /local/templates/ +globalProperties: + supportingFiles: "" + apis: "" + models: "" + apiDocs: false + apiTests: false + modelDocs: false + modelTests: false additionalProperties: packageName: api enumClassPrefix: true diff --git a/packages/client-go/configuration.go b/packages/client-go/configuration.go index 754d7bed2b..051b41b3dd 100644 --- a/packages/client-go/configuration.go +++ b/packages/client-go/configuration.go @@ -29,9 +29,6 @@ func (c contextKey) String() string { } 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") diff --git a/packages/client-go/model_agent_authentication_response.go b/packages/client-go/model_agent_authentication_response.go deleted file mode 100644 index c662e3ff5e..0000000000 --- a/packages/client-go/model_agent_authentication_response.go +++ /dev/null @@ -1,167 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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 deleted file mode 100644 index c87c533dd4..0000000000 --- a/packages/client-go/model_agent_config.go +++ /dev/null @@ -1,436 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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 deleted file mode 100644 index 7c4e977c33..0000000000 --- a/packages/client-go/model_agent_connector.go +++ /dev/null @@ -1,790 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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 deleted file mode 100644 index 4e56b5806b..0000000000 --- a/packages/client-go/model_agent_connector_request.go +++ /dev/null @@ -1,670 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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 deleted file mode 100644 index ad106c3f70..0000000000 --- a/packages/client-go/model_agent_psso_device_registration_request.go +++ /dev/null @@ -1,254 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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 deleted file mode 100644 index 37d46f1ed0..0000000000 --- a/packages/client-go/model_agent_psso_device_registration_response.go +++ /dev/null @@ -1,312 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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 deleted file mode 100644 index edcb1ac472..0000000000 --- a/packages/client-go/model_agent_psso_user_registration_request.go +++ /dev/null @@ -1,225 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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 deleted file mode 100644 index e4447d2cc6..0000000000 --- a/packages/client-go/model_agent_token_response.go +++ /dev/null @@ -1,204 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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 deleted file mode 100644 index 7bf2fba25a..0000000000 --- a/packages/client-go/model_alg_enum.go +++ /dev/null @@ -1,115 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.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 deleted file mode 100644 index 8d60ecbf5e..0000000000 --- a/packages/client-go/model_app.go +++ /dev/null @@ -1,196 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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 deleted file mode 100644 index 15bbb9fc1d..0000000000 --- a/packages/client-go/model_app_enum.go +++ /dev/null @@ -1,265 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.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_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.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_application.go b/packages/client-go/model_application.go deleted file mode 100644 index 1e85684608..0000000000 --- a/packages/client-go/model_application.go +++ /dev/null @@ -1,727 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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 NullableProvider `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 NullableProvider, 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 -// If the value is explicit nil, the zero value for Provider will be returned -func (o *Application) GetProviderObj() Provider { - if o == nil || o.ProviderObj.Get() == nil { - var ret Provider - return ret - } - - return *o.ProviderObj.Get() -} - -// GetProviderObjOk returns a tuple with the ProviderObj 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) GetProviderObjOk() (*Provider, bool) { - if o == nil { - return nil, false - } - return o.ProviderObj.Get(), o.ProviderObj.IsSet() -} - -// SetProviderObj sets field value -func (o *Application) SetProviderObj(v Provider) { - o.ProviderObj.Set(&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.Get() - 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 deleted file mode 100644 index e2094fd585..0000000000 --- a/packages/client-go/model_application_entitlement.go +++ /dev/null @@ -1,262 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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 deleted file mode 100644 index d0bbc4006d..0000000000 --- a/packages/client-go/model_application_entitlement_request.go +++ /dev/null @@ -1,233 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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 deleted file mode 100644 index a51b63e9e5..0000000000 --- a/packages/client-go/model_application_request.go +++ /dev/null @@ -1,543 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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 deleted file mode 100644 index 0ca91ac490..0000000000 --- a/packages/client-go/model_auth_type_enum.go +++ /dev/null @@ -1,111 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.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 deleted file mode 100644 index 0b3919ea9d..0000000000 --- a/packages/client-go/model_authenticated_session.go +++ /dev/null @@ -1,442 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.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 deleted file mode 100644 index 5eb0d1a227..0000000000 --- a/packages/client-go/model_authenticated_session_asn.go +++ /dev/null @@ -1,231 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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 deleted file mode 100644 index baf03450a0..0000000000 --- a/packages/client-go/model_authenticated_session_geo_ip.go +++ /dev/null @@ -1,291 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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 deleted file mode 100644 index 3e0d6eabb7..0000000000 --- a/packages/client-go/model_authenticated_session_user_agent.go +++ /dev/null @@ -1,254 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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 deleted file mode 100644 index e17f6673d9..0000000000 --- a/packages/client-go/model_authenticated_session_user_agent_device.go +++ /dev/null @@ -1,225 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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 deleted file mode 100644 index 4593ba3ff6..0000000000 --- a/packages/client-go/model_authenticated_session_user_agent_os.go +++ /dev/null @@ -1,283 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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 deleted file mode 100644 index 07470e0525..0000000000 --- a/packages/client-go/model_authenticated_session_user_agent_user_agent.go +++ /dev/null @@ -1,254 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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 deleted file mode 100644 index aed22046f8..0000000000 --- a/packages/client-go/model_authentication_enum.go +++ /dev/null @@ -1,119 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.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 deleted file mode 100644 index 7a83640f6a..0000000000 --- a/packages/client-go/model_authenticator_attachment_enum.go +++ /dev/null @@ -1,111 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.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_stage.go b/packages/client-go/model_authenticator_duo_stage.go deleted file mode 100644 index d07f4e0541..0000000000 --- a/packages/client-go/model_authenticator_duo_stage.go +++ /dev/null @@ -1,526 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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 deleted file mode 100644 index ae896f6b6d..0000000000 --- a/packages/client-go/model_authenticator_duo_stage_device_import_response.go +++ /dev/null @@ -1,196 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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 deleted file mode 100644 index 9a27605841..0000000000 --- a/packages/client-go/model_authenticator_duo_stage_manual_device_import_request.go +++ /dev/null @@ -1,196 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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 deleted file mode 100644 index 2a80a9efb8..0000000000 --- a/packages/client-go/model_authenticator_duo_stage_request.go +++ /dev/null @@ -1,414 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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_stage.go b/packages/client-go/model_authenticator_email_stage.go deleted file mode 100644 index ccfa7fc327..0000000000 --- a/packages/client-go/model_authenticator_email_stage.go +++ /dev/null @@ -1,877 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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 deleted file mode 100644 index 368091d5b8..0000000000 --- a/packages/client-go/model_authenticator_email_stage_request.go +++ /dev/null @@ -1,699 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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 deleted file mode 100644 index 60c62b02f5..0000000000 --- a/packages/client-go/model_authenticator_endpoint_gdtc_stage.go +++ /dev/null @@ -1,460 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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 deleted file mode 100644 index a5cf66b540..0000000000 --- a/packages/client-go/model_authenticator_endpoint_gdtc_stage_request.go +++ /dev/null @@ -1,282 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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_stage.go b/packages/client-go/model_authenticator_sms_stage.go deleted file mode 100644 index ca3ae2596f..0000000000 --- a/packages/client-go/model_authenticator_sms_stage.go +++ /dev/null @@ -1,708 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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 deleted file mode 100644 index 4d15983d3d..0000000000 --- a/packages/client-go/model_authenticator_sms_stage_request.go +++ /dev/null @@ -1,530 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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_stage.go b/packages/client-go/model_authenticator_static_stage.go deleted file mode 100644 index 2f8f293d7f..0000000000 --- a/packages/client-go/model_authenticator_static_stage.go +++ /dev/null @@ -1,505 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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 deleted file mode 100644 index c9f39b8c97..0000000000 --- a/packages/client-go/model_authenticator_static_stage_request.go +++ /dev/null @@ -1,327 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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_stage.go b/packages/client-go/model_authenticator_totp_stage.go deleted file mode 100644 index efb8d556ba..0000000000 --- a/packages/client-go/model_authenticator_totp_stage.go +++ /dev/null @@ -1,460 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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 deleted file mode 100644 index c1e128d0cf..0000000000 --- a/packages/client-go/model_authenticator_totp_stage_request.go +++ /dev/null @@ -1,282 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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 deleted file mode 100644 index 934e9eae35..0000000000 --- a/packages/client-go/model_authenticator_validate_stage.go +++ /dev/null @@ -1,637 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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 deleted file mode 100644 index 08fb2e1e2e..0000000000 --- a/packages/client-go/model_authenticator_validate_stage_request.go +++ /dev/null @@ -1,430 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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_web_authn_stage.go b/packages/client-go/model_authenticator_web_authn_stage.go deleted file mode 100644 index 23cfe5ca80..0000000000 --- a/packages/client-go/model_authenticator_web_authn_stage.go +++ /dev/null @@ -1,731 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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 *UserVerificationEnum `json:"resident_key_requirement,omitempty"` - Hints []WebAuthnHintEnum `json:"hints,omitempty"` - DeviceTypeRestrictions []string `json:"device_type_restrictions,omitempty"` - DeviceTypeRestrictionsObj []WebAuthnDeviceType `json:"device_type_restrictions_obj"` - // When enabled, a given device can only be registered once. - PreventDuplicateDevices *bool `json:"prevent_duplicate_devices,omitempty"` - 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() UserVerificationEnum { - if o == nil || IsNil(o.ResidentKeyRequirement) { - var ret UserVerificationEnum - 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() (*UserVerificationEnum, 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 UserVerificationEnum and assigns it to the ResidentKeyRequirement field. -func (o *AuthenticatorWebAuthnStage) SetResidentKeyRequirement(v UserVerificationEnum) { - 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 -} - -// GetPreventDuplicateDevices returns the PreventDuplicateDevices field value if set, zero value otherwise. -func (o *AuthenticatorWebAuthnStage) GetPreventDuplicateDevices() bool { - if o == nil || IsNil(o.PreventDuplicateDevices) { - var ret bool - return ret - } - return *o.PreventDuplicateDevices -} - -// GetPreventDuplicateDevicesOk returns a tuple with the PreventDuplicateDevices field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *AuthenticatorWebAuthnStage) GetPreventDuplicateDevicesOk() (*bool, bool) { - if o == nil || IsNil(o.PreventDuplicateDevices) { - return nil, false - } - return o.PreventDuplicateDevices, true -} - -// HasPreventDuplicateDevices returns a boolean if a field has been set. -func (o *AuthenticatorWebAuthnStage) HasPreventDuplicateDevices() bool { - if o != nil && !IsNil(o.PreventDuplicateDevices) { - return true - } - - return false -} - -// SetPreventDuplicateDevices gets a reference to the given bool and assigns it to the PreventDuplicateDevices field. -func (o *AuthenticatorWebAuthnStage) SetPreventDuplicateDevices(v bool) { - o.PreventDuplicateDevices = &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.PreventDuplicateDevices) { - toSerialize["prevent_duplicate_devices"] = o.PreventDuplicateDevices - } - 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, "prevent_duplicate_devices") - 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 deleted file mode 100644 index a2c59ccf07..0000000000 --- a/packages/client-go/model_authenticator_web_authn_stage_request.go +++ /dev/null @@ -1,524 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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 *UserVerificationEnum `json:"resident_key_requirement,omitempty"` - Hints []WebAuthnHintEnum `json:"hints,omitempty"` - DeviceTypeRestrictions []string `json:"device_type_restrictions,omitempty"` - // When enabled, a given device can only be registered once. - PreventDuplicateDevices *bool `json:"prevent_duplicate_devices,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() UserVerificationEnum { - if o == nil || IsNil(o.ResidentKeyRequirement) { - var ret UserVerificationEnum - 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() (*UserVerificationEnum, 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 UserVerificationEnum and assigns it to the ResidentKeyRequirement field. -func (o *AuthenticatorWebAuthnStageRequest) SetResidentKeyRequirement(v UserVerificationEnum) { - 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 -} - -// GetPreventDuplicateDevices returns the PreventDuplicateDevices field value if set, zero value otherwise. -func (o *AuthenticatorWebAuthnStageRequest) GetPreventDuplicateDevices() bool { - if o == nil || IsNil(o.PreventDuplicateDevices) { - var ret bool - return ret - } - return *o.PreventDuplicateDevices -} - -// GetPreventDuplicateDevicesOk returns a tuple with the PreventDuplicateDevices field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *AuthenticatorWebAuthnStageRequest) GetPreventDuplicateDevicesOk() (*bool, bool) { - if o == nil || IsNil(o.PreventDuplicateDevices) { - return nil, false - } - return o.PreventDuplicateDevices, true -} - -// HasPreventDuplicateDevices returns a boolean if a field has been set. -func (o *AuthenticatorWebAuthnStageRequest) HasPreventDuplicateDevices() bool { - if o != nil && !IsNil(o.PreventDuplicateDevices) { - return true - } - - return false -} - -// SetPreventDuplicateDevices gets a reference to the given bool and assigns it to the PreventDuplicateDevices field. -func (o *AuthenticatorWebAuthnStageRequest) SetPreventDuplicateDevices(v bool) { - o.PreventDuplicateDevices = &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.PreventDuplicateDevices) { - toSerialize["prevent_duplicate_devices"] = o.PreventDuplicateDevices - } - 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, "prevent_duplicate_devices") - 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 deleted file mode 100644 index 6b4ab0a19c..0000000000 --- a/packages/client-go/model_authorization_code_auth_method_enum.go +++ /dev/null @@ -1,111 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.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_backends_enum.go b/packages/client-go/model_backends_enum.go deleted file mode 100644 index 5cc966ec8f..0000000000 --- a/packages/client-go/model_backends_enum.go +++ /dev/null @@ -1,115 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.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 deleted file mode 100644 index cd503391b4..0000000000 --- a/packages/client-go/model_binding_type_enum.go +++ /dev/null @@ -1,113 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.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 deleted file mode 100644 index 3db2ec20ea..0000000000 --- a/packages/client-go/model_blueprint_file.go +++ /dev/null @@ -1,255 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.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_import_result.go b/packages/client-go/model_blueprint_import_result.go deleted file mode 100644 index d525ab7190..0000000000 --- a/packages/client-go/model_blueprint_import_result.go +++ /dev/null @@ -1,196 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: hello@goauthentik.io -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package api - -import ( - "encoding/json" - "fmt" -) - -// checks if the BlueprintImportResult type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &BlueprintImportResult{} - -// BlueprintImportResult Logs of an attempted blueprint import -type BlueprintImportResult struct { - Logs []LogEvent `json:"logs"` - Success bool `json:"success"` - AdditionalProperties map[string]interface{} -} - -type _BlueprintImportResult BlueprintImportResult - -// NewBlueprintImportResult instantiates a new BlueprintImportResult object -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed -func NewBlueprintImportResult(logs []LogEvent, success bool) *BlueprintImportResult { - this := BlueprintImportResult{} - this.Logs = logs - this.Success = success - return &this -} - -// NewBlueprintImportResultWithDefaults instantiates a new BlueprintImportResult object -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set -func NewBlueprintImportResultWithDefaults() *BlueprintImportResult { - this := BlueprintImportResult{} - return &this -} - -// GetLogs returns the Logs field value -func (o *BlueprintImportResult) 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 *BlueprintImportResult) GetLogsOk() ([]LogEvent, bool) { - if o == nil { - return nil, false - } - return o.Logs, true -} - -// SetLogs sets field value -func (o *BlueprintImportResult) SetLogs(v []LogEvent) { - o.Logs = v -} - -// GetSuccess returns the Success field value -func (o *BlueprintImportResult) 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 *BlueprintImportResult) GetSuccessOk() (*bool, bool) { - if o == nil { - return nil, false - } - return &o.Success, true -} - -// SetSuccess sets field value -func (o *BlueprintImportResult) SetSuccess(v bool) { - o.Success = v -} - -func (o BlueprintImportResult) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o BlueprintImportResult) 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 *BlueprintImportResult) UnmarshalJSON(data []byte) (err error) { - // This validates that all required properties are included in the JSON object - // by unmarshalling the 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) - } - } - - varBlueprintImportResult := _BlueprintImportResult{} - - err = json.Unmarshal(data, &varBlueprintImportResult) - - if err != nil { - return err - } - - *o = BlueprintImportResult(varBlueprintImportResult) - - 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 NullableBlueprintImportResult struct { - value *BlueprintImportResult - isSet bool -} - -func (v NullableBlueprintImportResult) Get() *BlueprintImportResult { - return v.value -} - -func (v *NullableBlueprintImportResult) Set(val *BlueprintImportResult) { - v.value = val - v.isSet = true -} - -func (v NullableBlueprintImportResult) IsSet() bool { - return v.isSet -} - -func (v *NullableBlueprintImportResult) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableBlueprintImportResult(val *BlueprintImportResult) *NullableBlueprintImportResult { - return &NullableBlueprintImportResult{value: val, isSet: true} -} - -func (v NullableBlueprintImportResult) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableBlueprintImportResult) 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 deleted file mode 100644 index 836da4725d..0000000000 --- a/packages/client-go/model_blueprint_instance.go +++ /dev/null @@ -1,494 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.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 deleted file mode 100644 index 90d68de809..0000000000 --- a/packages/client-go/model_blueprint_instance_request.go +++ /dev/null @@ -1,319 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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 deleted file mode 100644 index ea05a74d3d..0000000000 --- a/packages/client-go/model_blueprint_instance_status_enum.go +++ /dev/null @@ -1,117 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.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_request.go b/packages/client-go/model_brand_request.go deleted file mode 100644 index 55e4d0a550..0000000000 --- a/packages/client-go/model_brand_request.go +++ /dev/null @@ -1,851 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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 deleted file mode 100644 index 632796bbe7..0000000000 --- a/packages/client-go/model_bulk_delete_session_response.go +++ /dev/null @@ -1,167 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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 deleted file mode 100644 index 0e44cfb6bd..0000000000 --- a/packages/client-go/model_cache.go +++ /dev/null @@ -1,167 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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_captcha_stage.go b/packages/client-go/model_captcha_stage.go deleted file mode 100644 index 30d2e5bc32..0000000000 --- a/packages/client-go/model_captcha_stage.go +++ /dev/null @@ -1,598 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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 deleted file mode 100644 index bc3b68aeda..0000000000 --- a/packages/client-go/model_captcha_stage_request.go +++ /dev/null @@ -1,450 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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 deleted file mode 100644 index 4c6fb6de55..0000000000 --- a/packages/client-go/model_cert_attribute_enum.go +++ /dev/null @@ -1,113 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.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_generation_request.go b/packages/client-go/model_certificate_generation_request.go deleted file mode 100644 index 69d188cf29..0000000000 --- a/packages/client-go/model_certificate_generation_request.go +++ /dev/null @@ -1,274 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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_request.go b/packages/client-go/model_certificate_key_pair_request.go deleted file mode 100644 index 6ca8eb8d13..0000000000 --- a/packages/client-go/model_certificate_key_pair_request.go +++ /dev/null @@ -1,235 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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_client_type_enum.go b/packages/client-go/model_client_type_enum.go deleted file mode 100644 index f5351944a9..0000000000 --- a/packages/client-go/model_client_type_enum.go +++ /dev/null @@ -1,111 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.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 deleted file mode 100644 index cb10a0d21f..0000000000 --- a/packages/client-go/model_compatibility_mode_enum.go +++ /dev/null @@ -1,117 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.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" - COMPATIBILITYMODEENUM_WEBEX CompatibilityModeEnum = "webex" -) - -// All allowed values of CompatibilityModeEnum enum -var AllowedCompatibilityModeEnumEnumValues = []CompatibilityModeEnum{ - "default", - "aws", - "slack", - "sfdc", - "webex", -} - -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_connection_token.go b/packages/client-go/model_connection_token.go deleted file mode 100644 index e7c1bfc78c..0000000000 --- a/packages/client-go/model_connection_token.go +++ /dev/null @@ -1,320 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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 deleted file mode 100644 index 121eb9d89c..0000000000 --- a/packages/client-go/model_connection_token_request.go +++ /dev/null @@ -1,233 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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 deleted file mode 100644 index 1715c3c951..0000000000 --- a/packages/client-go/model_connector.go +++ /dev/null @@ -1,361 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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_mode_enum.go b/packages/client-go/model_consent_mode_enum.go deleted file mode 100644 index 5f342b0053..0000000000 --- a/packages/client-go/model_consent_mode_enum.go +++ /dev/null @@ -1,113 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: hello@goauthentik.io -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package api - -import ( - "encoding/json" - "fmt" -) - -// ConsentModeEnum the model 'ConsentModeEnum' -type ConsentModeEnum string - -// List of ConsentModeEnum -const ( - CONSENTMODEENUM_ALWAYS_REQUIRE ConsentModeEnum = "always_require" - CONSENTMODEENUM_PERMANENT ConsentModeEnum = "permanent" - CONSENTMODEENUM_EXPIRING ConsentModeEnum = "expiring" -) - -// All allowed values of ConsentModeEnum enum -var AllowedConsentModeEnumEnumValues = []ConsentModeEnum{ - "always_require", - "permanent", - "expiring", -} - -func (v *ConsentModeEnum) UnmarshalJSON(src []byte) error { - var value string - err := json.Unmarshal(src, &value) - if err != nil { - return err - } - enumTypeValue := ConsentModeEnum(value) - for _, existing := range AllowedConsentModeEnumEnumValues { - if existing == enumTypeValue { - *v = enumTypeValue - return nil - } - } - - return fmt.Errorf("%+v is not a valid ConsentModeEnum", value) -} - -// NewConsentModeEnumFromValue returns a pointer to a valid ConsentModeEnum -// for the value passed as argument, or an error if the value passed is not allowed by the enum -func NewConsentModeEnumFromValue(v string) (*ConsentModeEnum, error) { - ev := ConsentModeEnum(v) - if ev.IsValid() { - return &ev, nil - } else { - return nil, fmt.Errorf("invalid value '%v' for ConsentModeEnum: valid values are %v", v, AllowedConsentModeEnumEnumValues) - } -} - -// IsValid return true if the value is valid for the enum, false otherwise -func (v ConsentModeEnum) IsValid() bool { - for _, existing := range AllowedConsentModeEnumEnumValues { - if existing == v { - return true - } - } - return false -} - -// Ptr returns reference to ConsentModeEnum value -func (v ConsentModeEnum) Ptr() *ConsentModeEnum { - return &v -} - -type NullableConsentModeEnum struct { - value *ConsentModeEnum - isSet bool -} - -func (v NullableConsentModeEnum) Get() *ConsentModeEnum { - return v.value -} - -func (v *NullableConsentModeEnum) Set(val *ConsentModeEnum) { - v.value = val - v.isSet = true -} - -func (v NullableConsentModeEnum) IsSet() bool { - return v.isSet -} - -func (v *NullableConsentModeEnum) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableConsentModeEnum(val *ConsentModeEnum) *NullableConsentModeEnum { - return &NullableConsentModeEnum{value: val, isSet: true} -} - -func (v NullableConsentModeEnum) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableConsentModeEnum) 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 deleted file mode 100644 index c5a8bea544..0000000000 --- a/packages/client-go/model_consent_stage.go +++ /dev/null @@ -1,420 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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 *ConsentModeEnum `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() ConsentModeEnum { - if o == nil || IsNil(o.Mode) { - var ret ConsentModeEnum - 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() (*ConsentModeEnum, 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 ConsentModeEnum and assigns it to the Mode field. -func (o *ConsentStage) SetMode(v ConsentModeEnum) { - 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_request.go b/packages/client-go/model_consent_stage_request.go deleted file mode 100644 index 8fc9c836f1..0000000000 --- a/packages/client-go/model_consent_stage_request.go +++ /dev/null @@ -1,242 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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 *ConsentModeEnum `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() ConsentModeEnum { - if o == nil || IsNil(o.Mode) { - var ret ConsentModeEnum - 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() (*ConsentModeEnum, 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 ConsentModeEnum and assigns it to the Mode field. -func (o *ConsentStageRequest) SetMode(v ConsentModeEnum) { - 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 deleted file mode 100644 index 90cebeae33..0000000000 --- a/packages/client-go/model_content_type.go +++ /dev/null @@ -1,254 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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 deleted file mode 100644 index a2d4178770..0000000000 --- a/packages/client-go/model_content_type_enum.go +++ /dev/null @@ -1,113 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.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_country_code_enum.go b/packages/client-go/model_country_code_enum.go deleted file mode 100644 index 0d9e3bfa6f..0000000000 --- a/packages/client-go/model_country_code_enum.go +++ /dev/null @@ -1,605 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.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 deleted file mode 100644 index 06f25c1bfe..0000000000 --- a/packages/client-go/model_current_brand.go +++ /dev/null @@ -1,683 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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 deleted file mode 100644 index d6304bbe75..0000000000 --- a/packages/client-go/model_current_brand_flags.go +++ /dev/null @@ -1,258 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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 deleted file mode 100644 index 7cf578895e..0000000000 --- a/packages/client-go/model_data_export.go +++ /dev/null @@ -1,342 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.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 deleted file mode 100644 index dd8775e260..0000000000 --- a/packages/client-go/model_delivery_method_enum.go +++ /dev/null @@ -1,115 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.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" - DELIVERYMETHODENUM_URN_IETF_RFC_8935 DeliveryMethodEnum = "urn:ietf:rfc:8935" - DELIVERYMETHODENUM_URN_IETF_RFC_8936 DeliveryMethodEnum = "urn:ietf:rfc:8936" -) - -// 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", - "urn:ietf:rfc:8935", - "urn:ietf:rfc:8936", -} - -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 deleted file mode 100644 index 129fe2c09e..0000000000 --- a/packages/client-go/model_denied_action_enum.go +++ /dev/null @@ -1,113 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.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 deleted file mode 100644 index 1bed7f6eb2..0000000000 --- a/packages/client-go/model_deny_stage.go +++ /dev/null @@ -1,382 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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 deleted file mode 100644 index 4f78ccca42..0000000000 --- a/packages/client-go/model_deny_stage_request.go +++ /dev/null @@ -1,204 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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 deleted file mode 100644 index 0244ff5b9d..0000000000 --- a/packages/client-go/model_detailed_country.go +++ /dev/null @@ -1,196 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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 deleted file mode 100644 index b44ac106f9..0000000000 --- a/packages/client-go/model_device.go +++ /dev/null @@ -1,499 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.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 deleted file mode 100644 index 0403d2de1d..0000000000 --- a/packages/client-go/model_device_access_group.go +++ /dev/null @@ -1,233 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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 deleted file mode 100644 index ed6071c6d1..0000000000 --- a/packages/client-go/model_device_access_group_request.go +++ /dev/null @@ -1,204 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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_connection.go b/packages/client-go/model_device_connection.go deleted file mode 100644 index af6401b073..0000000000 --- a/packages/client-go/model_device_connection.go +++ /dev/null @@ -1,256 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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 deleted file mode 100644 index 7c0ec731d1..0000000000 --- a/packages/client-go/model_device_fact_snapshot.go +++ /dev/null @@ -1,286 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.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 deleted file mode 100644 index cc504dbc9e..0000000000 --- a/packages/client-go/model_device_facts.go +++ /dev/null @@ -1,488 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.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 deleted file mode 100644 index e6e4a9875f..0000000000 --- a/packages/client-go/model_device_facts_os_family.go +++ /dev/null @@ -1,123 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.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 deleted file mode 100644 index 5adb65ce0e..0000000000 --- a/packages/client-go/model_device_facts_request.go +++ /dev/null @@ -1,488 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.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 deleted file mode 100644 index aa464553b2..0000000000 --- a/packages/client-go/model_device_group.go +++ /dev/null @@ -1,204 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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 deleted file mode 100644 index d1e189e078..0000000000 --- a/packages/client-go/model_device_group_request.go +++ /dev/null @@ -1,204 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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 deleted file mode 100644 index bc4ae9e096..0000000000 --- a/packages/client-go/model_device_summary.go +++ /dev/null @@ -1,225 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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 deleted file mode 100644 index 6034fa0d67..0000000000 --- a/packages/client-go/model_device_user.go +++ /dev/null @@ -1,278 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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 deleted file mode 100644 index bcbc2e84a4..0000000000 --- a/packages/client-go/model_device_user_binding.go +++ /dev/null @@ -1,710 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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 NullablePolicy `json:"policy_obj"` - GroupObj NullablePartialGroup `json:"group_obj"` - UserObj NullablePartialUser `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 NullablePolicy, groupObj NullablePartialGroup, userObj NullablePartialUser, 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 -// If the value is explicit nil, the zero value for Policy will be returned -func (o *DeviceUserBinding) GetPolicyObj() Policy { - if o == nil || o.PolicyObj.Get() == nil { - var ret Policy - return ret - } - - return *o.PolicyObj.Get() -} - -// GetPolicyObjOk returns a tuple with the PolicyObj 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) GetPolicyObjOk() (*Policy, bool) { - if o == nil { - return nil, false - } - return o.PolicyObj.Get(), o.PolicyObj.IsSet() -} - -// SetPolicyObj sets field value -func (o *DeviceUserBinding) SetPolicyObj(v Policy) { - o.PolicyObj.Set(&v) -} - -// GetGroupObj returns the GroupObj field value -// If the value is explicit nil, the zero value for PartialGroup will be returned -func (o *DeviceUserBinding) GetGroupObj() PartialGroup { - if o == nil || o.GroupObj.Get() == nil { - var ret PartialGroup - return ret - } - - return *o.GroupObj.Get() -} - -// GetGroupObjOk returns a tuple with the GroupObj 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) GetGroupObjOk() (*PartialGroup, bool) { - if o == nil { - return nil, false - } - return o.GroupObj.Get(), o.GroupObj.IsSet() -} - -// SetGroupObj sets field value -func (o *DeviceUserBinding) SetGroupObj(v PartialGroup) { - o.GroupObj.Set(&v) -} - -// GetUserObj returns the UserObj field value -// If the value is explicit nil, the zero value for PartialUser will be returned -func (o *DeviceUserBinding) GetUserObj() PartialUser { - if o == nil || o.UserObj.Get() == nil { - var ret PartialUser - return ret - } - - return *o.UserObj.Get() -} - -// GetUserObjOk returns a tuple with the UserObj 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) GetUserObjOk() (*PartialUser, bool) { - if o == nil { - return nil, false - } - return o.UserObj.Get(), o.UserObj.IsSet() -} - -// SetUserObj sets field value -func (o *DeviceUserBinding) SetUserObj(v PartialUser) { - o.UserObj.Set(&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.Get() - toSerialize["group_obj"] = o.GroupObj.Get() - toSerialize["user_obj"] = o.UserObj.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 - } - 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 deleted file mode 100644 index 0ca4e6e86c..0000000000 --- a/packages/client-go/model_device_user_binding_request.go +++ /dev/null @@ -1,528 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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 deleted file mode 100644 index 6f7a118406..0000000000 --- a/packages/client-go/model_device_user_request.go +++ /dev/null @@ -1,278 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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 deleted file mode 100644 index 804ec00807..0000000000 --- a/packages/client-go/model_digest_algorithm_enum.go +++ /dev/null @@ -1,115 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.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 deleted file mode 100644 index 0fe505cbbf..0000000000 --- a/packages/client-go/model_digits_enum.go +++ /dev/null @@ -1,111 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.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 deleted file mode 100644 index 941746bafe..0000000000 --- a/packages/client-go/model_disk.go +++ /dev/null @@ -1,348 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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 deleted file mode 100644 index d5c02d4511..0000000000 --- a/packages/client-go/model_disk_request.go +++ /dev/null @@ -1,348 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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 deleted file mode 100644 index f04c65ef21..0000000000 --- a/packages/client-go/model_docker_service_connection.go +++ /dev/null @@ -1,481 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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 deleted file mode 100644 index cb6fd33640..0000000000 --- a/packages/client-go/model_docker_service_connection_request.go +++ /dev/null @@ -1,333 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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 deleted file mode 100644 index 25f5fc5414..0000000000 --- a/packages/client-go/model_domain.go +++ /dev/null @@ -1,262 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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 deleted file mode 100644 index 793f9930d7..0000000000 --- a/packages/client-go/model_domain_request.go +++ /dev/null @@ -1,233 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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_policy.go b/packages/client-go/model_dummy_policy.go deleted file mode 100644 index de4584ae4d..0000000000 --- a/packages/client-go/model_dummy_policy.go +++ /dev/null @@ -1,495 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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 deleted file mode 100644 index c42d8efd57..0000000000 --- a/packages/client-go/model_dummy_policy_request.go +++ /dev/null @@ -1,316 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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 deleted file mode 100644 index 7c2d2d5604..0000000000 --- a/packages/client-go/model_dummy_stage.go +++ /dev/null @@ -1,382 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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 deleted file mode 100644 index 760164e469..0000000000 --- a/packages/client-go/model_dummy_stage_request.go +++ /dev/null @@ -1,204 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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 deleted file mode 100644 index f3fc340327..0000000000 --- a/packages/client-go/model_duo_device.go +++ /dev/null @@ -1,226 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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 deleted file mode 100644 index 740fe0dde2..0000000000 --- a/packages/client-go/model_duo_device_enrollment_status.go +++ /dev/null @@ -1,167 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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 deleted file mode 100644 index d85359bf68..0000000000 --- a/packages/client-go/model_duo_device_request.go +++ /dev/null @@ -1,168 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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 deleted file mode 100644 index 98cd4f8c7d..0000000000 --- a/packages/client-go/model_duo_response_enum.go +++ /dev/null @@ -1,113 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.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_device.go b/packages/client-go/model_email_device.go deleted file mode 100644 index c53760a439..0000000000 --- a/packages/client-go/model_email_device.go +++ /dev/null @@ -1,255 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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 deleted file mode 100644 index 136f481b84..0000000000 --- a/packages/client-go/model_email_device_request.go +++ /dev/null @@ -1,168 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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 deleted file mode 100644 index 061040ed3d..0000000000 --- a/packages/client-go/model_email_stage.go +++ /dev/null @@ -1,867 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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 deleted file mode 100644 index 7b832abadc..0000000000 --- a/packages/client-go/model_email_stage_request.go +++ /dev/null @@ -1,726 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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 deleted file mode 100644 index 7c8f3c6a95..0000000000 --- a/packages/client-go/model_endpoint.go +++ /dev/null @@ -1,484 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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_auth_mode_enum.go b/packages/client-go/model_endpoint_auth_mode_enum.go deleted file mode 100644 index d68763d630..0000000000 --- a/packages/client-go/model_endpoint_auth_mode_enum.go +++ /dev/null @@ -1,111 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.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 deleted file mode 100644 index 26d492ede8..0000000000 --- a/packages/client-go/model_endpoint_device.go +++ /dev/null @@ -1,470 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.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 deleted file mode 100644 index 987b24f71e..0000000000 --- a/packages/client-go/model_endpoint_device_details.go +++ /dev/null @@ -1,557 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.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 deleted file mode 100644 index 2a843283f3..0000000000 --- a/packages/client-go/model_endpoint_device_request.go +++ /dev/null @@ -1,412 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.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 deleted file mode 100644 index 54dac10d2c..0000000000 --- a/packages/client-go/model_endpoint_request.go +++ /dev/null @@ -1,394 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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 deleted file mode 100644 index 4ce7d66872..0000000000 --- a/packages/client-go/model_endpoint_stage.go +++ /dev/null @@ -1,440 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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 deleted file mode 100644 index c524a154c0..0000000000 --- a/packages/client-go/model_endpoint_stage_request.go +++ /dev/null @@ -1,233 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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 deleted file mode 100644 index 5b3cab4696..0000000000 --- a/packages/client-go/model_enroll_request.go +++ /dev/null @@ -1,196 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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 deleted file mode 100644 index 377f75eb52..0000000000 --- a/packages/client-go/model_enrollment_token.go +++ /dev/null @@ -1,390 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.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 NullableDeviceAccessGroup `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 NullableDeviceAccessGroup, 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 -// If the value is explicit nil, the zero value for DeviceAccessGroup will be returned -func (o *EnrollmentToken) GetDeviceGroupObj() DeviceAccessGroup { - if o == nil || o.DeviceGroupObj.Get() == nil { - var ret DeviceAccessGroup - return ret - } - - return *o.DeviceGroupObj.Get() -} - -// GetDeviceGroupObjOk returns a tuple with the DeviceGroupObj 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 *EnrollmentToken) GetDeviceGroupObjOk() (*DeviceAccessGroup, bool) { - if o == nil { - return nil, false - } - return o.DeviceGroupObj.Get(), o.DeviceGroupObj.IsSet() -} - -// SetDeviceGroupObj sets field value -func (o *EnrollmentToken) SetDeviceGroupObj(v DeviceAccessGroup) { - o.DeviceGroupObj.Set(&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.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 *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 deleted file mode 100644 index bcb46d4f8b..0000000000 --- a/packages/client-go/model_enrollment_token_request.go +++ /dev/null @@ -1,330 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.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_event_matcher_policy.go b/packages/client-go/model_event_matcher_policy.go deleted file mode 100644 index 857eeda98e..0000000000 --- a/packages/client-go/model_event_matcher_policy.go +++ /dev/null @@ -1,580 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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 deleted file mode 100644 index c7e078ee9f..0000000000 --- a/packages/client-go/model_event_matcher_policy_request.go +++ /dev/null @@ -1,401 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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_stats.go b/packages/client-go/model_event_stats.go deleted file mode 100644 index 3108748d05..0000000000 --- a/packages/client-go/model_event_stats.go +++ /dev/null @@ -1,196 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: hello@goauthentik.io -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package api - -import ( - "encoding/json" - "fmt" -) - -// checks if the EventStats type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &EventStats{} - -// EventStats Count of unique users in events and aggregated counts per specified deltas -type EventStats struct { - UniqueUsers int32 `json:"unique_users"` - CountStep map[string]interface{} `json:"count_step"` - AdditionalProperties map[string]interface{} -} - -type _EventStats EventStats - -// NewEventStats instantiates a new EventStats object -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed -func NewEventStats(uniqueUsers int32, countStep map[string]interface{}) *EventStats { - this := EventStats{} - this.UniqueUsers = uniqueUsers - this.CountStep = countStep - return &this -} - -// NewEventStatsWithDefaults instantiates a new EventStats object -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set -func NewEventStatsWithDefaults() *EventStats { - this := EventStats{} - return &this -} - -// GetUniqueUsers returns the UniqueUsers field value -func (o *EventStats) 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 *EventStats) GetUniqueUsersOk() (*int32, bool) { - if o == nil { - return nil, false - } - return &o.UniqueUsers, true -} - -// SetUniqueUsers sets field value -func (o *EventStats) SetUniqueUsers(v int32) { - o.UniqueUsers = v -} - -// GetCountStep returns the CountStep field value -func (o *EventStats) GetCountStep() map[string]interface{} { - if o == nil { - var ret map[string]interface{} - return ret - } - - return o.CountStep -} - -// GetCountStepOk returns a tuple with the CountStep field value -// and a boolean to check if the value has been set. -func (o *EventStats) GetCountStepOk() (map[string]interface{}, bool) { - if o == nil { - return map[string]interface{}{}, false - } - return o.CountStep, true -} - -// SetCountStep sets field value -func (o *EventStats) SetCountStep(v map[string]interface{}) { - o.CountStep = v -} - -func (o EventStats) MarshalJSON() ([]byte, error) { - toSerialize, err := o.ToMap() - if err != nil { - return []byte{}, err - } - return json.Marshal(toSerialize) -} - -func (o EventStats) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - toSerialize["unique_users"] = o.UniqueUsers - toSerialize["count_step"] = o.CountStep - - for key, value := range o.AdditionalProperties { - toSerialize[key] = value - } - - return toSerialize, nil -} - -func (o *EventStats) UnmarshalJSON(data []byte) (err error) { - // This validates that all required properties are included in the JSON object - // by unmarshalling the object into a generic map with string keys and checking - // that every required field exists as a key in the generic map. - requiredProperties := []string{ - "unique_users", - "count_step", - } - - allProperties := make(map[string]interface{}) - - err = json.Unmarshal(data, &allProperties) - - if err != nil { - return err - } - - for _, requiredProperty := range requiredProperties { - if _, exists := allProperties[requiredProperty]; !exists { - return fmt.Errorf("no value given for required property %v", requiredProperty) - } - } - - varEventStats := _EventStats{} - - err = json.Unmarshal(data, &varEventStats) - - if err != nil { - return err - } - - *o = EventStats(varEventStats) - - additionalProperties := make(map[string]interface{}) - - if err = json.Unmarshal(data, &additionalProperties); err == nil { - delete(additionalProperties, "unique_users") - delete(additionalProperties, "count_step") - o.AdditionalProperties = additionalProperties - } - - return err -} - -type NullableEventStats struct { - value *EventStats - isSet bool -} - -func (v NullableEventStats) Get() *EventStats { - return v.value -} - -func (v *NullableEventStats) Set(val *EventStats) { - v.value = val - v.isSet = true -} - -func (v NullableEventStats) IsSet() bool { - return v.isSet -} - -func (v *NullableEventStats) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableEventStats(val *EventStats) *NullableEventStats { - return &NullableEventStats{value: val, isSet: true} -} - -func (v NullableEventStats) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableEventStats) 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 deleted file mode 100644 index fe3a54df0e..0000000000 --- a/packages/client-go/model_event_top_per_user.go +++ /dev/null @@ -1,225 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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 deleted file mode 100644 index 7a96cf8e24..0000000000 --- a/packages/client-go/model_event_volume.go +++ /dev/null @@ -1,226 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.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 for a single event action -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 deleted file mode 100644 index 357bf7beb5..0000000000 --- a/packages/client-go/model_events_requested_enum.go +++ /dev/null @@ -1,113 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.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 deleted file mode 100644 index af21bf4bc5..0000000000 --- a/packages/client-go/model_expiring_base_grant_model.go +++ /dev/null @@ -1,333 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.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 deleted file mode 100644 index 53b8cc16cb..0000000000 --- a/packages/client-go/model_expression_policy.go +++ /dev/null @@ -1,413 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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 deleted file mode 100644 index 47a463e052..0000000000 --- a/packages/client-go/model_expression_policy_request.go +++ /dev/null @@ -1,234 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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 deleted file mode 100644 index 0d323d8ad4..0000000000 --- a/packages/client-go/model_extra_role_object_permission.go +++ /dev/null @@ -1,404 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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 deleted file mode 100644 index b3a17e0310..0000000000 --- a/packages/client-go/model_file_list.go +++ /dev/null @@ -1,273 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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 deleted file mode 100644 index 77f76bb995..0000000000 --- a/packages/client-go/model_fleet_connector.go +++ /dev/null @@ -1,513 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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 deleted file mode 100644 index af58c931f7..0000000000 --- a/packages/client-go/model_fleet_connector_request.go +++ /dev/null @@ -1,422 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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 deleted file mode 100644 index 3b30fd169a..0000000000 --- a/packages/client-go/model_flow.go +++ /dev/null @@ -1,720 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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_diagram.go b/packages/client-go/model_flow_diagram.go deleted file mode 100644 index 15d973260d..0000000000 --- a/packages/client-go/model_flow_diagram.go +++ /dev/null @@ -1,167 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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_inspection.go b/packages/client-go/model_flow_inspection.go deleted file mode 100644 index fafa51671d..0000000000 --- a/packages/client-go/model_flow_inspection.go +++ /dev/null @@ -1,233 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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 deleted file mode 100644 index 889b9d60e7..0000000000 --- a/packages/client-go/model_flow_inspector_plan.go +++ /dev/null @@ -1,256 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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 deleted file mode 100644 index 1cb8f5d4e1..0000000000 --- a/packages/client-go/model_flow_layout_enum.go +++ /dev/null @@ -1,121 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.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 deleted file mode 100644 index 3d6d2cc2fe..0000000000 --- a/packages/client-go/model_flow_request.go +++ /dev/null @@ -1,483 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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 deleted file mode 100644 index 20535684d3..0000000000 --- a/packages/client-go/model_flow_set.go +++ /dev/null @@ -1,525 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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 deleted file mode 100644 index b2715e92c4..0000000000 --- a/packages/client-go/model_flow_stage_binding.go +++ /dev/null @@ -1,463 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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 deleted file mode 100644 index fb1c092923..0000000000 --- a/packages/client-go/model_flow_stage_binding_request.go +++ /dev/null @@ -1,376 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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 deleted file mode 100644 index 59029649d8..0000000000 --- a/packages/client-go/model_footer_link.go +++ /dev/null @@ -1,198 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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_force_binding_enum.go b/packages/client-go/model_force_binding_enum.go deleted file mode 100644 index bbd97cf840..0000000000 --- a/packages/client-go/model_force_binding_enum.go +++ /dev/null @@ -1,111 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: hello@goauthentik.io -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package api - -import ( - "encoding/json" - "fmt" -) - -// ForceBindingEnum the model 'ForceBindingEnum' -type ForceBindingEnum string - -// List of ForceBindingEnum -const ( - FORCEBINDINGENUM_URN_OASIS_NAMES_TC_SAML_2_0_BINDINGS_HTTP_POST ForceBindingEnum = "urn:oasis:names:tc:SAML:2.0:bindings:HTTP-POST" - FORCEBINDINGENUM_URN_OASIS_NAMES_TC_SAML_2_0_BINDINGS_HTTP_REDIRECT ForceBindingEnum = "urn:oasis:names:tc:SAML:2.0:bindings:HTTP-Redirect" -) - -// All allowed values of ForceBindingEnum enum -var AllowedForceBindingEnumEnumValues = []ForceBindingEnum{ - "urn:oasis:names:tc:SAML:2.0:bindings:HTTP-POST", - "urn:oasis:names:tc:SAML:2.0:bindings:HTTP-Redirect", -} - -func (v *ForceBindingEnum) UnmarshalJSON(src []byte) error { - var value string - err := json.Unmarshal(src, &value) - if err != nil { - return err - } - enumTypeValue := ForceBindingEnum(value) - for _, existing := range AllowedForceBindingEnumEnumValues { - if existing == enumTypeValue { - *v = enumTypeValue - return nil - } - } - - return fmt.Errorf("%+v is not a valid ForceBindingEnum", value) -} - -// NewForceBindingEnumFromValue returns a pointer to a valid ForceBindingEnum -// for the value passed as argument, or an error if the value passed is not allowed by the enum -func NewForceBindingEnumFromValue(v string) (*ForceBindingEnum, error) { - ev := ForceBindingEnum(v) - if ev.IsValid() { - return &ev, nil - } else { - return nil, fmt.Errorf("invalid value '%v' for ForceBindingEnum: valid values are %v", v, AllowedForceBindingEnumEnumValues) - } -} - -// IsValid return true if the value is valid for the enum, false otherwise -func (v ForceBindingEnum) IsValid() bool { - for _, existing := range AllowedForceBindingEnumEnumValues { - if existing == v { - return true - } - } - return false -} - -// Ptr returns reference to ForceBindingEnum value -func (v ForceBindingEnum) Ptr() *ForceBindingEnum { - return &v -} - -type NullableForceBindingEnum struct { - value *ForceBindingEnum - isSet bool -} - -func (v NullableForceBindingEnum) Get() *ForceBindingEnum { - return v.value -} - -func (v *NullableForceBindingEnum) Set(val *ForceBindingEnum) { - v.value = val - v.isSet = true -} - -func (v NullableForceBindingEnum) IsSet() bool { - return v.isSet -} - -func (v *NullableForceBindingEnum) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableForceBindingEnum(val *ForceBindingEnum) *NullableForceBindingEnum { - return &NullableForceBindingEnum{value: val, isSet: true} -} - -func (v NullableForceBindingEnum) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableForceBindingEnum) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/packages/client-go/model_format_enum.go b/packages/client-go/model_format_enum.go deleted file mode 100644 index 521c98e703..0000000000 --- a/packages/client-go/model_format_enum.go +++ /dev/null @@ -1,111 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: hello@goauthentik.io -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package api - -import ( - "encoding/json" - "fmt" -) - -// FormatEnum the model 'FormatEnum' -type FormatEnum string - -// List of FormatEnum -const ( - FORMATENUM_JSON FormatEnum = "json" - FORMATENUM_YAML FormatEnum = "yaml" -) - -// All allowed values of FormatEnum enum -var AllowedFormatEnumEnumValues = []FormatEnum{ - "json", - "yaml", -} - -func (v *FormatEnum) UnmarshalJSON(src []byte) error { - var value string - err := json.Unmarshal(src, &value) - if err != nil { - return err - } - enumTypeValue := FormatEnum(value) - for _, existing := range AllowedFormatEnumEnumValues { - if existing == enumTypeValue { - *v = enumTypeValue - return nil - } - } - - return fmt.Errorf("%+v is not a valid FormatEnum", value) -} - -// NewFormatEnumFromValue returns a pointer to a valid FormatEnum -// for the value passed as argument, or an error if the value passed is not allowed by the enum -func NewFormatEnumFromValue(v string) (*FormatEnum, error) { - ev := FormatEnum(v) - if ev.IsValid() { - return &ev, nil - } else { - return nil, fmt.Errorf("invalid value '%v' for FormatEnum: valid values are %v", v, AllowedFormatEnumEnumValues) - } -} - -// IsValid return true if the value is valid for the enum, false otherwise -func (v FormatEnum) IsValid() bool { - for _, existing := range AllowedFormatEnumEnumValues { - if existing == v { - return true - } - } - return false -} - -// Ptr returns reference to FormatEnum value -func (v FormatEnum) Ptr() *FormatEnum { - return &v -} - -type NullableFormatEnum struct { - value *FormatEnum - isSet bool -} - -func (v NullableFormatEnum) Get() *FormatEnum { - return v.value -} - -func (v *NullableFormatEnum) Set(val *FormatEnum) { - v.value = val - v.isSet = true -} - -func (v NullableFormatEnum) IsSet() bool { - return v.isSet -} - -func (v *NullableFormatEnum) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableFormatEnum(val *FormatEnum) *NullableFormatEnum { - return &NullableFormatEnum{value: val, isSet: true} -} - -func (v NullableFormatEnum) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableFormatEnum) 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 deleted file mode 100644 index c2ed490076..0000000000 --- a/packages/client-go/model_geo_ip_policy.go +++ /dev/null @@ -1,701 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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 deleted file mode 100644 index 9f59f4658e..0000000000 --- a/packages/client-go/model_geo_ip_policy_countries_obj_inner.go +++ /dev/null @@ -1,196 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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 deleted file mode 100644 index 28f2dc7e4f..0000000000 --- a/packages/client-go/model_geo_ip_policy_request.go +++ /dev/null @@ -1,493 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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 deleted file mode 100644 index 130684ffdc..0000000000 --- a/packages/client-go/model_geoip_binding_enum.go +++ /dev/null @@ -1,115 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.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 deleted file mode 100644 index 4a0eb678c0..0000000000 --- a/packages/client-go/model_global_task_status.go +++ /dev/null @@ -1,428 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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 deleted file mode 100644 index c6c1c757c6..0000000000 --- a/packages/client-go/model_google_chrome_connector.go +++ /dev/null @@ -1,422 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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 deleted file mode 100644 index b825b8eb32..0000000000 --- a/packages/client-go/model_google_chrome_connector_request.go +++ /dev/null @@ -1,270 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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 deleted file mode 100644 index 5d62e0fdc6..0000000000 --- a/packages/client-go/model_google_endpoint_device.go +++ /dev/null @@ -1,205 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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 deleted file mode 100644 index fd398676ba..0000000000 --- a/packages/client-go/model_google_endpoint_device_request.go +++ /dev/null @@ -1,205 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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 deleted file mode 100644 index c37ac0e0a2..0000000000 --- a/packages/client-go/model_google_workspace_provider.go +++ /dev/null @@ -1,852 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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 deleted file mode 100644 index c555b87bf3..0000000000 --- a/packages/client-go/model_google_workspace_provider_group.go +++ /dev/null @@ -1,312 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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 deleted file mode 100644 index a025264ec8..0000000000 --- a/packages/client-go/model_google_workspace_provider_group_request.go +++ /dev/null @@ -1,225 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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 deleted file mode 100644 index fdb85f0da9..0000000000 --- a/packages/client-go/model_google_workspace_provider_mapping.go +++ /dev/null @@ -1,394 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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 deleted file mode 100644 index d242f7c3af..0000000000 --- a/packages/client-go/model_google_workspace_provider_mapping_request.go +++ /dev/null @@ -1,245 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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 deleted file mode 100644 index 3e4ac31e74..0000000000 --- a/packages/client-go/model_google_workspace_provider_request.go +++ /dev/null @@ -1,639 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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 deleted file mode 100644 index 6b2c86e2ae..0000000000 --- a/packages/client-go/model_google_workspace_provider_user.go +++ /dev/null @@ -1,312 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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 deleted file mode 100644 index 67d8773907..0000000000 --- a/packages/client-go/model_google_workspace_provider_user_request.go +++ /dev/null @@ -1,225 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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_kerberos_source_connection.go b/packages/client-go/model_group_kerberos_source_connection.go deleted file mode 100644 index 151c5ef5c5..0000000000 --- a/packages/client-go/model_group_kerberos_source_connection.go +++ /dev/null @@ -1,342 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.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 deleted file mode 100644 index 3b1da24f40..0000000000 --- a/packages/client-go/model_group_kerberos_source_connection_request.go +++ /dev/null @@ -1,225 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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 deleted file mode 100644 index d2e63eb84f..0000000000 --- a/packages/client-go/model_group_ldap_source_connection.go +++ /dev/null @@ -1,371 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.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"` - GroupObj PartialGroup `json:"group_obj"` - 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, groupObj PartialGroup) *GroupLDAPSourceConnection { - this := GroupLDAPSourceConnection{} - this.Pk = pk - this.Group = group - this.Source = source - this.SourceObj = sourceObj - this.Identifier = identifier - this.Created = created - this.LastUpdated = lastUpdated - this.GroupObj = groupObj - 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 -} - -// GetGroupObj returns the GroupObj field value -func (o *GroupLDAPSourceConnection) 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 *GroupLDAPSourceConnection) GetGroupObjOk() (*PartialGroup, bool) { - if o == nil { - return nil, false - } - return &o.GroupObj, true -} - -// SetGroupObj sets field value -func (o *GroupLDAPSourceConnection) SetGroupObj(v PartialGroup) { - o.GroupObj = 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 - toSerialize["group_obj"] = o.GroupObj - - 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", - "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) - } - } - - 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") - delete(additionalProperties, "group_obj") - 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 deleted file mode 100644 index ab861637d7..0000000000 --- a/packages/client-go/model_group_ldap_source_connection_request.go +++ /dev/null @@ -1,225 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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 deleted file mode 100644 index 036bc5cf5b..0000000000 --- a/packages/client-go/model_group_matching_mode_enum.go +++ /dev/null @@ -1,113 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.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 deleted file mode 100644 index 27e4d6f33f..0000000000 --- a/packages/client-go/model_group_o_auth_source_connection.go +++ /dev/null @@ -1,342 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.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 deleted file mode 100644 index f1f87c159f..0000000000 --- a/packages/client-go/model_group_o_auth_source_connection_request.go +++ /dev/null @@ -1,225 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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 deleted file mode 100644 index d609fdbe3c..0000000000 --- a/packages/client-go/model_group_plex_source_connection.go +++ /dev/null @@ -1,342 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.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 deleted file mode 100644 index c09aadf523..0000000000 --- a/packages/client-go/model_group_plex_source_connection_request.go +++ /dev/null @@ -1,225 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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 deleted file mode 100644 index b2ddfee594..0000000000 --- a/packages/client-go/model_group_request.go +++ /dev/null @@ -1,353 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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 deleted file mode 100644 index 12cdc6ee8a..0000000000 --- a/packages/client-go/model_group_saml_source_connection.go +++ /dev/null @@ -1,342 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.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 deleted file mode 100644 index 974192060c..0000000000 --- a/packages/client-go/model_group_saml_source_connection_request.go +++ /dev/null @@ -1,225 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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 deleted file mode 100644 index c83d81bae7..0000000000 --- a/packages/client-go/model_group_source_connection.go +++ /dev/null @@ -1,342 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.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 deleted file mode 100644 index 69f8cc2622..0000000000 --- a/packages/client-go/model_group_source_connection_request.go +++ /dev/null @@ -1,225 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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 deleted file mode 100644 index 9639a6962c..0000000000 --- a/packages/client-go/model_group_telegram_source_connection.go +++ /dev/null @@ -1,342 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.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 deleted file mode 100644 index 79dff5c3e4..0000000000 --- a/packages/client-go/model_group_telegram_source_connection_request.go +++ /dev/null @@ -1,225 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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 deleted file mode 100644 index 6326b5bd59..0000000000 --- a/packages/client-go/model_hardware.go +++ /dev/null @@ -1,352 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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 deleted file mode 100644 index 5cdfab2708..0000000000 --- a/packages/client-go/model_hardware_request.go +++ /dev/null @@ -1,352 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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_stage.go b/packages/client-go/model_identification_stage.go deleted file mode 100644 index f02c4967b8..0000000000 --- a/packages/client-go/model_identification_stage.go +++ /dev/null @@ -1,904 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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 deleted file mode 100644 index 301bbb1c5a..0000000000 --- a/packages/client-go/model_identification_stage_request.go +++ /dev/null @@ -1,726 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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_impersonation_request.go b/packages/client-go/model_impersonation_request.go deleted file mode 100644 index 17e45d5122..0000000000 --- a/packages/client-go/model_impersonation_request.go +++ /dev/null @@ -1,167 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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 deleted file mode 100644 index 8038a5e93c..0000000000 --- a/packages/client-go/model_initial_permissions.go +++ /dev/null @@ -1,291 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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 deleted file mode 100644 index ae096cb97b..0000000000 --- a/packages/client-go/model_initial_permissions_request.go +++ /dev/null @@ -1,233 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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 deleted file mode 100644 index a391b3d3b8..0000000000 --- a/packages/client-go/model_install_id.go +++ /dev/null @@ -1,167 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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 deleted file mode 100644 index 727770ed3d..0000000000 --- a/packages/client-go/model_intent_enum.go +++ /dev/null @@ -1,115 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.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 deleted file mode 100644 index 7428a21de3..0000000000 --- a/packages/client-go/model_invalid_response_action_enum.go +++ /dev/null @@ -1,113 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.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 deleted file mode 100644 index 47c2ee2de9..0000000000 --- a/packages/client-go/model_invitation.go +++ /dev/null @@ -1,427 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.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 deleted file mode 100644 index e4fe5d99e2..0000000000 --- a/packages/client-go/model_invitation_request.go +++ /dev/null @@ -1,340 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.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 deleted file mode 100644 index 12668efe73..0000000000 --- a/packages/client-go/model_invitation_send_email_request.go +++ /dev/null @@ -1,282 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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 deleted file mode 100644 index 7bcdfd1f71..0000000000 --- a/packages/client-go/model_invitation_stage.go +++ /dev/null @@ -1,383 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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 deleted file mode 100644 index 0cd60629aa..0000000000 --- a/packages/client-go/model_invitation_stage_request.go +++ /dev/null @@ -1,205 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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 deleted file mode 100644 index b750b1699b..0000000000 --- a/packages/client-go/model_issuer_mode_enum.go +++ /dev/null @@ -1,111 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.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 deleted file mode 100644 index d159298ec3..0000000000 --- a/packages/client-go/model_kadmin_type_enum.go +++ /dev/null @@ -1,111 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.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 deleted file mode 100644 index 442a930cd0..0000000000 --- a/packages/client-go/model_kerberos_source.go +++ /dev/null @@ -1,1317 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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 deleted file mode 100644 index f68eb7ff4c..0000000000 --- a/packages/client-go/model_kerberos_source_property_mapping.go +++ /dev/null @@ -1,394 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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 deleted file mode 100644 index cf1b658e4b..0000000000 --- a/packages/client-go/model_kerberos_source_property_mapping_request.go +++ /dev/null @@ -1,245 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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 deleted file mode 100644 index ca85f4410f..0000000000 --- a/packages/client-go/model_kerberos_source_request.go +++ /dev/null @@ -1,1156 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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 deleted file mode 100644 index 135bd0cd19..0000000000 --- a/packages/client-go/model_key_type_enum.go +++ /dev/null @@ -1,117 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.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_DSA KeyTypeEnum = "dsa" - KEYTYPEENUM_EC KeyTypeEnum = "ec" - KEYTYPEENUM_ED25519 KeyTypeEnum = "ed25519" - KEYTYPEENUM_ED448 KeyTypeEnum = "ed448" - KEYTYPEENUM_RSA KeyTypeEnum = "rsa" -) - -// All allowed values of KeyTypeEnum enum -var AllowedKeyTypeEnumEnumValues = []KeyTypeEnum{ - "dsa", - "ec", - "ed25519", - "ed448", - "rsa", -} - -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 deleted file mode 100644 index 958094129f..0000000000 --- a/packages/client-go/model_kubernetes_service_connection.go +++ /dev/null @@ -1,429 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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 deleted file mode 100644 index 0de4328ad5..0000000000 --- a/packages/client-go/model_kubernetes_service_connection_request.go +++ /dev/null @@ -1,281 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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_lang_enum.go b/packages/client-go/model_lang_enum.go deleted file mode 100644 index 9985044e87..0000000000 --- a/packages/client-go/model_lang_enum.go +++ /dev/null @@ -1,305 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: hello@goauthentik.io -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package api - -import ( - "encoding/json" - "fmt" -) - -// LangEnum the model 'LangEnum' -type LangEnum string - -// List of LangEnum -const ( - LANGENUM_AF LangEnum = "af" - LANGENUM_AR LangEnum = "ar" - LANGENUM_AR_DZ LangEnum = "ar-dz" - LANGENUM_AST LangEnum = "ast" - LANGENUM_AZ LangEnum = "az" - LANGENUM_BE LangEnum = "be" - LANGENUM_BG LangEnum = "bg" - LANGENUM_BN LangEnum = "bn" - LANGENUM_BR LangEnum = "br" - LANGENUM_BS LangEnum = "bs" - LANGENUM_CA LangEnum = "ca" - LANGENUM_CKB LangEnum = "ckb" - LANGENUM_CS LangEnum = "cs" - LANGENUM_CY LangEnum = "cy" - LANGENUM_DA LangEnum = "da" - LANGENUM_DE LangEnum = "de" - LANGENUM_DSB LangEnum = "dsb" - LANGENUM_EL LangEnum = "el" - LANGENUM_EN LangEnum = "en" - LANGENUM_EN_AU LangEnum = "en-au" - LANGENUM_EN_GB LangEnum = "en-gb" - LANGENUM_EO LangEnum = "eo" - LANGENUM_ES LangEnum = "es" - LANGENUM_ES_AR LangEnum = "es-ar" - LANGENUM_ES_CO LangEnum = "es-co" - LANGENUM_ES_MX LangEnum = "es-mx" - LANGENUM_ES_NI LangEnum = "es-ni" - LANGENUM_ES_VE LangEnum = "es-ve" - LANGENUM_ET LangEnum = "et" - LANGENUM_EU LangEnum = "eu" - LANGENUM_FA LangEnum = "fa" - LANGENUM_FI LangEnum = "fi" - LANGENUM_FR LangEnum = "fr" - LANGENUM_FY LangEnum = "fy" - LANGENUM_GA LangEnum = "ga" - LANGENUM_GD LangEnum = "gd" - LANGENUM_GL LangEnum = "gl" - LANGENUM_HE LangEnum = "he" - LANGENUM_HI LangEnum = "hi" - LANGENUM_HR LangEnum = "hr" - LANGENUM_HSB LangEnum = "hsb" - LANGENUM_HU LangEnum = "hu" - LANGENUM_HY LangEnum = "hy" - LANGENUM_IA LangEnum = "ia" - LANGENUM_ID LangEnum = "id" - LANGENUM_IG LangEnum = "ig" - LANGENUM_IO LangEnum = "io" - LANGENUM_IS LangEnum = "is" - LANGENUM_IT LangEnum = "it" - LANGENUM_JA LangEnum = "ja" - LANGENUM_KA LangEnum = "ka" - LANGENUM_KAB LangEnum = "kab" - LANGENUM_KK LangEnum = "kk" - LANGENUM_KM LangEnum = "km" - LANGENUM_KN LangEnum = "kn" - LANGENUM_KO LangEnum = "ko" - LANGENUM_KY LangEnum = "ky" - LANGENUM_LB LangEnum = "lb" - LANGENUM_LT LangEnum = "lt" - LANGENUM_LV LangEnum = "lv" - LANGENUM_MK LangEnum = "mk" - LANGENUM_ML LangEnum = "ml" - LANGENUM_MN LangEnum = "mn" - LANGENUM_MR LangEnum = "mr" - LANGENUM_MS LangEnum = "ms" - LANGENUM_MY LangEnum = "my" - LANGENUM_NB LangEnum = "nb" - LANGENUM_NE LangEnum = "ne" - LANGENUM_NL LangEnum = "nl" - LANGENUM_NN LangEnum = "nn" - LANGENUM_OS LangEnum = "os" - LANGENUM_PA LangEnum = "pa" - LANGENUM_PL LangEnum = "pl" - LANGENUM_PT LangEnum = "pt" - LANGENUM_PT_BR LangEnum = "pt-br" - LANGENUM_RO LangEnum = "ro" - LANGENUM_RU LangEnum = "ru" - LANGENUM_SK LangEnum = "sk" - LANGENUM_SL LangEnum = "sl" - LANGENUM_SQ LangEnum = "sq" - LANGENUM_SR LangEnum = "sr" - LANGENUM_SR_LATN LangEnum = "sr-latn" - LANGENUM_SV LangEnum = "sv" - LANGENUM_SW LangEnum = "sw" - LANGENUM_TA LangEnum = "ta" - LANGENUM_TE LangEnum = "te" - LANGENUM_TG LangEnum = "tg" - LANGENUM_TH LangEnum = "th" - LANGENUM_TK LangEnum = "tk" - LANGENUM_TR LangEnum = "tr" - LANGENUM_TT LangEnum = "tt" - LANGENUM_UDM LangEnum = "udm" - LANGENUM_UG LangEnum = "ug" - LANGENUM_UK LangEnum = "uk" - LANGENUM_UR LangEnum = "ur" - LANGENUM_UZ LangEnum = "uz" - LANGENUM_VI LangEnum = "vi" - LANGENUM_ZH_HANS LangEnum = "zh-hans" - LANGENUM_ZH_HANT LangEnum = "zh-hant" -) - -// All allowed values of LangEnum enum -var AllowedLangEnumEnumValues = []LangEnum{ - "af", - "ar", - "ar-dz", - "ast", - "az", - "be", - "bg", - "bn", - "br", - "bs", - "ca", - "ckb", - "cs", - "cy", - "da", - "de", - "dsb", - "el", - "en", - "en-au", - "en-gb", - "eo", - "es", - "es-ar", - "es-co", - "es-mx", - "es-ni", - "es-ve", - "et", - "eu", - "fa", - "fi", - "fr", - "fy", - "ga", - "gd", - "gl", - "he", - "hi", - "hr", - "hsb", - "hu", - "hy", - "ia", - "id", - "ig", - "io", - "is", - "it", - "ja", - "ka", - "kab", - "kk", - "km", - "kn", - "ko", - "ky", - "lb", - "lt", - "lv", - "mk", - "ml", - "mn", - "mr", - "ms", - "my", - "nb", - "ne", - "nl", - "nn", - "os", - "pa", - "pl", - "pt", - "pt-br", - "ro", - "ru", - "sk", - "sl", - "sq", - "sr", - "sr-latn", - "sv", - "sw", - "ta", - "te", - "tg", - "th", - "tk", - "tr", - "tt", - "udm", - "ug", - "uk", - "ur", - "uz", - "vi", - "zh-hans", - "zh-hant", -} - -func (v *LangEnum) UnmarshalJSON(src []byte) error { - var value string - err := json.Unmarshal(src, &value) - if err != nil { - return err - } - enumTypeValue := LangEnum(value) - for _, existing := range AllowedLangEnumEnumValues { - if existing == enumTypeValue { - *v = enumTypeValue - return nil - } - } - - return fmt.Errorf("%+v is not a valid LangEnum", value) -} - -// NewLangEnumFromValue returns a pointer to a valid LangEnum -// for the value passed as argument, or an error if the value passed is not allowed by the enum -func NewLangEnumFromValue(v string) (*LangEnum, error) { - ev := LangEnum(v) - if ev.IsValid() { - return &ev, nil - } else { - return nil, fmt.Errorf("invalid value '%v' for LangEnum: valid values are %v", v, AllowedLangEnumEnumValues) - } -} - -// IsValid return true if the value is valid for the enum, false otherwise -func (v LangEnum) IsValid() bool { - for _, existing := range AllowedLangEnumEnumValues { - if existing == v { - return true - } - } - return false -} - -// Ptr returns reference to LangEnum value -func (v LangEnum) Ptr() *LangEnum { - return &v -} - -type NullableLangEnum struct { - value *LangEnum - isSet bool -} - -func (v NullableLangEnum) Get() *LangEnum { - return v.value -} - -func (v *NullableLangEnum) Set(val *LangEnum) { - v.value = val - v.isSet = true -} - -func (v NullableLangEnum) IsSet() bool { - return v.isSet -} - -func (v *NullableLangEnum) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableLangEnum(val *LangEnum) *NullableLangEnum { - return &NullableLangEnum{value: val, isSet: true} -} - -func (v NullableLangEnum) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableLangEnum) 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 deleted file mode 100644 index b5ab7b059e..0000000000 --- a/packages/client-go/model_last_task_status_enum.go +++ /dev/null @@ -1,127 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.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_debug.go b/packages/client-go/model_ldap_debug.go deleted file mode 100644 index 2cd4fd88c3..0000000000 --- a/packages/client-go/model_ldap_debug.go +++ /dev/null @@ -1,225 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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_provider.go b/packages/client-go/model_ldap_provider.go deleted file mode 100644 index 3dd72826c4..0000000000 --- a/packages/client-go/model_ldap_provider.go +++ /dev/null @@ -1,930 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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 deleted file mode 100644 index d47ea94b1a..0000000000 --- a/packages/client-go/model_ldap_provider_request.go +++ /dev/null @@ -1,624 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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 deleted file mode 100644 index 4f07a05514..0000000000 --- a/packages/client-go/model_ldap_source.go +++ /dev/null @@ -1,1714 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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 deleted file mode 100644 index e538f5787b..0000000000 --- a/packages/client-go/model_ldap_source_property_mapping.go +++ /dev/null @@ -1,394 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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 deleted file mode 100644 index 89bfc1b84a..0000000000 --- a/packages/client-go/model_ldap_source_property_mapping_request.go +++ /dev/null @@ -1,245 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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 deleted file mode 100644 index 88d05a3ce8..0000000000 --- a/packages/client-go/model_ldap_source_request.go +++ /dev/null @@ -1,1476 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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_license.go b/packages/client-go/model_license.go deleted file mode 100644 index ffd697c566..0000000000 --- a/packages/client-go/model_license.go +++ /dev/null @@ -1,313 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.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 deleted file mode 100644 index 6e5ffba367..0000000000 --- a/packages/client-go/model_license_flags_enum.go +++ /dev/null @@ -1,111 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.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 deleted file mode 100644 index 11c4b06cd7..0000000000 --- a/packages/client-go/model_license_forecast.go +++ /dev/null @@ -1,254 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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 deleted file mode 100644 index d0febbb844..0000000000 --- a/packages/client-go/model_license_request.go +++ /dev/null @@ -1,167 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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 deleted file mode 100644 index fc73d0abec..0000000000 --- a/packages/client-go/model_license_status_enum.go +++ /dev/null @@ -1,121 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.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 deleted file mode 100644 index d245f02567..0000000000 --- a/packages/client-go/model_license_summary.go +++ /dev/null @@ -1,284 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.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 deleted file mode 100644 index ff1d089cf6..0000000000 --- a/packages/client-go/model_license_summary_status_enum.go +++ /dev/null @@ -1,121 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.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 deleted file mode 100644 index 1c32c08684..0000000000 --- a/packages/client-go/model_lifecycle_iteration.go +++ /dev/null @@ -1,545 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.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 deleted file mode 100644 index 484f8105e5..0000000000 --- a/packages/client-go/model_lifecycle_iteration_request.go +++ /dev/null @@ -1,167 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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 deleted file mode 100644 index 11933760f8..0000000000 --- a/packages/client-go/model_lifecycle_iteration_state_enum.go +++ /dev/null @@ -1,115 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.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 deleted file mode 100644 index ed031414e6..0000000000 --- a/packages/client-go/model_lifecycle_rule.go +++ /dev/null @@ -1,612 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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 deleted file mode 100644 index ece13168c2..0000000000 --- a/packages/client-go/model_lifecycle_rule_request.go +++ /dev/null @@ -1,496 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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 deleted file mode 100644 index 82038d6590..0000000000 --- a/packages/client-go/model_link.go +++ /dev/null @@ -1,167 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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_matching_mode_enum.go b/packages/client-go/model_matching_mode_enum.go deleted file mode 100644 index a0007ce1b5..0000000000 --- a/packages/client-go/model_matching_mode_enum.go +++ /dev/null @@ -1,111 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.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 deleted file mode 100644 index 1b53d10887..0000000000 --- a/packages/client-go/model_mdm_config_request.go +++ /dev/null @@ -1,196 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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 deleted file mode 100644 index 1347a11c5c..0000000000 --- a/packages/client-go/model_mdm_config_response.go +++ /dev/null @@ -1,225 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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 deleted file mode 100644 index c879772785..0000000000 --- a/packages/client-go/model_metadata.go +++ /dev/null @@ -1,196 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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 deleted file mode 100644 index ec072237a5..0000000000 --- a/packages/client-go/model_microsoft_entra_provider.go +++ /dev/null @@ -1,815 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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 deleted file mode 100644 index e616c0f25c..0000000000 --- a/packages/client-go/model_microsoft_entra_provider_group.go +++ /dev/null @@ -1,312 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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 deleted file mode 100644 index 5a3cc2017a..0000000000 --- a/packages/client-go/model_microsoft_entra_provider_group_request.go +++ /dev/null @@ -1,225 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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 deleted file mode 100644 index 93c8b47f97..0000000000 --- a/packages/client-go/model_microsoft_entra_provider_mapping.go +++ /dev/null @@ -1,394 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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 deleted file mode 100644 index 338c47670b..0000000000 --- a/packages/client-go/model_microsoft_entra_provider_mapping_request.go +++ /dev/null @@ -1,245 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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 deleted file mode 100644 index 5e43ce4987..0000000000 --- a/packages/client-go/model_microsoft_entra_provider_request.go +++ /dev/null @@ -1,602 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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 deleted file mode 100644 index 3dd633c99a..0000000000 --- a/packages/client-go/model_microsoft_entra_provider_user.go +++ /dev/null @@ -1,312 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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 deleted file mode 100644 index 87ccc6bc0f..0000000000 --- a/packages/client-go/model_microsoft_entra_provider_user_request.go +++ /dev/null @@ -1,225 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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 deleted file mode 100644 index 1e6423e892..0000000000 --- a/packages/client-go/model_model_enum.go +++ /dev/null @@ -1,349 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.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 deleted file mode 100644 index 1bc7a83702..0000000000 --- a/packages/client-go/model_model_request.go +++ /dev/null @@ -1,442 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.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 deleted file mode 100644 index 0102e7f140..0000000000 --- a/packages/client-go/model_mutual_tls_stage.go +++ /dev/null @@ -1,470 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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 deleted file mode 100644 index 75c1501f6f..0000000000 --- a/packages/client-go/model_mutual_tls_stage_request.go +++ /dev/null @@ -1,292 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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_network.go b/packages/client-go/model_network.go deleted file mode 100644 index 69244c314e..0000000000 --- a/packages/client-go/model_network.go +++ /dev/null @@ -1,270 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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 deleted file mode 100644 index ec31984057..0000000000 --- a/packages/client-go/model_network_binding_enum.go +++ /dev/null @@ -1,115 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.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 deleted file mode 100644 index 0d5e1d395a..0000000000 --- a/packages/client-go/model_network_interface.go +++ /dev/null @@ -1,270 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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 deleted file mode 100644 index a9152dbd7f..0000000000 --- a/packages/client-go/model_network_interface_request.go +++ /dev/null @@ -1,270 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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 deleted file mode 100644 index 3f01a558c7..0000000000 --- a/packages/client-go/model_network_request.go +++ /dev/null @@ -1,270 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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 deleted file mode 100644 index 83c7aced28..0000000000 --- a/packages/client-go/model_not_configured_action_enum.go +++ /dev/null @@ -1,113 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.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 deleted file mode 100644 index 3bfdcbd138..0000000000 --- a/packages/client-go/model_notification.go +++ /dev/null @@ -1,425 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.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 deleted file mode 100644 index 75251f47cd..0000000000 --- a/packages/client-go/model_notification_request.go +++ /dev/null @@ -1,287 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.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 deleted file mode 100644 index 7430363d7f..0000000000 --- a/packages/client-go/model_notification_rule.go +++ /dev/null @@ -1,388 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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 deleted file mode 100644 index 47c6c37e4b..0000000000 --- a/packages/client-go/model_notification_rule_request.go +++ /dev/null @@ -1,330 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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 deleted file mode 100644 index 97b35d4c82..0000000000 --- a/packages/client-go/model_notification_transport.go +++ /dev/null @@ -1,559 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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 *TransportModeEnum `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() TransportModeEnum { - if o == nil || IsNil(o.Mode) { - var ret TransportModeEnum - 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() (*TransportModeEnum, 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 TransportModeEnum and assigns it to the Mode field. -func (o *NotificationTransport) SetMode(v TransportModeEnum) { - 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_request.go b/packages/client-go/model_notification_transport_request.go deleted file mode 100644 index 824d1e9ed3..0000000000 --- a/packages/client-go/model_notification_transport_request.go +++ /dev/null @@ -1,500 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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 *TransportModeEnum `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() TransportModeEnum { - if o == nil || IsNil(o.Mode) { - var ret TransportModeEnum - 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() (*TransportModeEnum, 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 TransportModeEnum and assigns it to the Mode field. -func (o *NotificationTransportRequest) SetMode(v TransportModeEnum) { - 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 deleted file mode 100644 index c533d26a73..0000000000 --- a/packages/client-go/model_notification_transport_test_.go +++ /dev/null @@ -1,167 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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 deleted file mode 100644 index d96593fb82..0000000000 --- a/packages/client-go/model_notification_webhook_mapping.go +++ /dev/null @@ -1,225 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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 deleted file mode 100644 index f7b64af6ee..0000000000 --- a/packages/client-go/model_notification_webhook_mapping_request.go +++ /dev/null @@ -1,196 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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 deleted file mode 100644 index ea5612ae3b..0000000000 --- a/packages/client-go/model_o_auth2_provider.go +++ /dev/null @@ -1,1244 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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 deleted file mode 100644 index 7ec8c85a52..0000000000 --- a/packages/client-go/model_o_auth2_provider_logout_method_enum.go +++ /dev/null @@ -1,111 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.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 deleted file mode 100644 index 00d483ba4d..0000000000 --- a/packages/client-go/model_o_auth2_provider_request.go +++ /dev/null @@ -1,967 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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 deleted file mode 100644 index 6691240b20..0000000000 --- a/packages/client-go/model_o_auth2_provider_setup_urls.go +++ /dev/null @@ -1,341 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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_source.go b/packages/client-go/model_o_auth_source.go deleted file mode 100644 index d69b95897d..0000000000 --- a/packages/client-go/model_o_auth_source.go +++ /dev/null @@ -1,1411 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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 deleted file mode 100644 index 183476a864..0000000000 --- a/packages/client-go/model_o_auth_source_property_mapping.go +++ /dev/null @@ -1,394 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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 deleted file mode 100644 index 8a99b432b7..0000000000 --- a/packages/client-go/model_o_auth_source_property_mapping_request.go +++ /dev/null @@ -1,245 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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 deleted file mode 100644 index 7a34462324..0000000000 --- a/packages/client-go/model_o_auth_source_request.go +++ /dev/null @@ -1,1138 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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_operating_system.go b/packages/client-go/model_operating_system.go deleted file mode 100644 index f45fb39264..0000000000 --- a/packages/client-go/model_operating_system.go +++ /dev/null @@ -1,280 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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 deleted file mode 100644 index 3be9feacdd..0000000000 --- a/packages/client-go/model_operating_system_request.go +++ /dev/null @@ -1,280 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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 deleted file mode 100644 index a269c8d817..0000000000 --- a/packages/client-go/model_outgoing_sync_delete_action.go +++ /dev/null @@ -1,113 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.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_default_config.go b/packages/client-go/model_outpost_default_config.go deleted file mode 100644 index a474db4132..0000000000 --- a/packages/client-go/model_outpost_default_config.go +++ /dev/null @@ -1,167 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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 deleted file mode 100644 index 148af858fe..0000000000 --- a/packages/client-go/model_outpost_health.go +++ /dev/null @@ -1,490 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.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 deleted file mode 100644 index cc0c1d2a60..0000000000 --- a/packages/client-go/model_outpost_request.go +++ /dev/null @@ -1,352 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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_paginated_agent_connector_list.go b/packages/client-go/model_paginated_agent_connector_list.go deleted file mode 100644 index 199e04b2a4..0000000000 --- a/packages/client-go/model_paginated_agent_connector_list.go +++ /dev/null @@ -1,225 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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 deleted file mode 100644 index 2355e7a68b..0000000000 --- a/packages/client-go/model_paginated_application_entitlement_list.go +++ /dev/null @@ -1,225 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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 deleted file mode 100644 index 7c8be1de01..0000000000 --- a/packages/client-go/model_paginated_application_list.go +++ /dev/null @@ -1,225 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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 deleted file mode 100644 index 8c3ec87224..0000000000 --- a/packages/client-go/model_paginated_authenticated_session_list.go +++ /dev/null @@ -1,225 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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 deleted file mode 100644 index d447b3b2b9..0000000000 --- a/packages/client-go/model_paginated_authenticator_duo_stage_list.go +++ /dev/null @@ -1,225 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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 deleted file mode 100644 index 89ed9fa623..0000000000 --- a/packages/client-go/model_paginated_authenticator_email_stage_list.go +++ /dev/null @@ -1,225 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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 deleted file mode 100644 index de80423dc3..0000000000 --- a/packages/client-go/model_paginated_authenticator_endpoint_gdtc_stage_list.go +++ /dev/null @@ -1,225 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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 deleted file mode 100644 index de40d0a7c4..0000000000 --- a/packages/client-go/model_paginated_authenticator_sms_stage_list.go +++ /dev/null @@ -1,225 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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 deleted file mode 100644 index 2526e09b78..0000000000 --- a/packages/client-go/model_paginated_authenticator_static_stage_list.go +++ /dev/null @@ -1,225 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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 deleted file mode 100644 index 5b473065d5..0000000000 --- a/packages/client-go/model_paginated_authenticator_totp_stage_list.go +++ /dev/null @@ -1,225 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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 deleted file mode 100644 index b39b354b2a..0000000000 --- a/packages/client-go/model_paginated_authenticator_validate_stage_list.go +++ /dev/null @@ -1,225 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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 deleted file mode 100644 index f63d308cdd..0000000000 --- a/packages/client-go/model_paginated_authenticator_web_authn_stage_list.go +++ /dev/null @@ -1,225 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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 deleted file mode 100644 index 49f49992cf..0000000000 --- a/packages/client-go/model_paginated_blueprint_instance_list.go +++ /dev/null @@ -1,225 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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_captcha_stage_list.go b/packages/client-go/model_paginated_captcha_stage_list.go deleted file mode 100644 index f9bf3aa6bf..0000000000 --- a/packages/client-go/model_paginated_captcha_stage_list.go +++ /dev/null @@ -1,225 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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 deleted file mode 100644 index ce9d4e13de..0000000000 --- a/packages/client-go/model_paginated_certificate_key_pair_list.go +++ /dev/null @@ -1,225 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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 deleted file mode 100644 index 26b96f170b..0000000000 --- a/packages/client-go/model_paginated_connection_token_list.go +++ /dev/null @@ -1,225 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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 deleted file mode 100644 index b79c9a8dee..0000000000 --- a/packages/client-go/model_paginated_connector_list.go +++ /dev/null @@ -1,225 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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 deleted file mode 100644 index ace48637c2..0000000000 --- a/packages/client-go/model_paginated_consent_stage_list.go +++ /dev/null @@ -1,225 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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 deleted file mode 100644 index 8070a1d621..0000000000 --- a/packages/client-go/model_paginated_data_export_list.go +++ /dev/null @@ -1,225 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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 deleted file mode 100644 index a722bc61da..0000000000 --- a/packages/client-go/model_paginated_deny_stage_list.go +++ /dev/null @@ -1,225 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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 deleted file mode 100644 index 0ecf55b263..0000000000 --- a/packages/client-go/model_paginated_device_access_group_list.go +++ /dev/null @@ -1,225 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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 deleted file mode 100644 index 68d1cc8d02..0000000000 --- a/packages/client-go/model_paginated_device_user_binding_list.go +++ /dev/null @@ -1,225 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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 deleted file mode 100644 index 5ab4deba94..0000000000 --- a/packages/client-go/model_paginated_docker_service_connection_list.go +++ /dev/null @@ -1,225 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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 deleted file mode 100644 index d2f17241c1..0000000000 --- a/packages/client-go/model_paginated_domain_list.go +++ /dev/null @@ -1,225 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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 deleted file mode 100644 index 1f146d0022..0000000000 --- a/packages/client-go/model_paginated_dummy_policy_list.go +++ /dev/null @@ -1,225 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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 deleted file mode 100644 index 7cb03d5cf4..0000000000 --- a/packages/client-go/model_paginated_dummy_stage_list.go +++ /dev/null @@ -1,225 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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 deleted file mode 100644 index 78968fe12a..0000000000 --- a/packages/client-go/model_paginated_duo_device_list.go +++ /dev/null @@ -1,225 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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 deleted file mode 100644 index 136f9bfff4..0000000000 --- a/packages/client-go/model_paginated_email_device_list.go +++ /dev/null @@ -1,225 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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 deleted file mode 100644 index e38f7d43b6..0000000000 --- a/packages/client-go/model_paginated_email_stage_list.go +++ /dev/null @@ -1,225 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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 deleted file mode 100644 index b57fe407c3..0000000000 --- a/packages/client-go/model_paginated_endpoint_device_list.go +++ /dev/null @@ -1,225 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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 deleted file mode 100644 index a153d3a4c2..0000000000 --- a/packages/client-go/model_paginated_endpoint_list.go +++ /dev/null @@ -1,225 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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 deleted file mode 100644 index cd33f86ec8..0000000000 --- a/packages/client-go/model_paginated_endpoint_stage_list.go +++ /dev/null @@ -1,225 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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 deleted file mode 100644 index 397d45f79f..0000000000 --- a/packages/client-go/model_paginated_enrollment_token_list.go +++ /dev/null @@ -1,225 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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 deleted file mode 100644 index 158a51869e..0000000000 --- a/packages/client-go/model_paginated_event_list.go +++ /dev/null @@ -1,225 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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 deleted file mode 100644 index 6066e9c8d3..0000000000 --- a/packages/client-go/model_paginated_event_matcher_policy_list.go +++ /dev/null @@ -1,225 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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 deleted file mode 100644 index bbda096cb8..0000000000 --- a/packages/client-go/model_paginated_expiring_base_grant_model_list.go +++ /dev/null @@ -1,225 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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 deleted file mode 100644 index eeccdd7ac0..0000000000 --- a/packages/client-go/model_paginated_expression_policy_list.go +++ /dev/null @@ -1,225 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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 deleted file mode 100644 index 539603fb9e..0000000000 --- a/packages/client-go/model_paginated_extra_role_object_permission_list.go +++ /dev/null @@ -1,225 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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"` - Autocomplete map[string]interface{} `json:"autocomplete"` - 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, autocomplete map[string]interface{}) *PaginatedExtraRoleObjectPermissionList { - this := PaginatedExtraRoleObjectPermissionList{} - this.Pagination = pagination - this.Results = results - this.Autocomplete = autocomplete - 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 -} - -// GetAutocomplete returns the Autocomplete field value -func (o *PaginatedExtraRoleObjectPermissionList) 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 *PaginatedExtraRoleObjectPermissionList) GetAutocompleteOk() (map[string]interface{}, bool) { - if o == nil { - return map[string]interface{}{}, false - } - return o.Autocomplete, true -} - -// SetAutocomplete sets field value -func (o *PaginatedExtraRoleObjectPermissionList) SetAutocomplete(v map[string]interface{}) { - o.Autocomplete = 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 - toSerialize["autocomplete"] = o.Autocomplete - - 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", - "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) - } - } - - 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") - delete(additionalProperties, "autocomplete") - 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 deleted file mode 100644 index 4673f829a1..0000000000 --- a/packages/client-go/model_paginated_fleet_connector_list.go +++ /dev/null @@ -1,225 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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 deleted file mode 100644 index 4f02f92501..0000000000 --- a/packages/client-go/model_paginated_flow_list.go +++ /dev/null @@ -1,225 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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 deleted file mode 100644 index 3930adb1c4..0000000000 --- a/packages/client-go/model_paginated_flow_stage_binding_list.go +++ /dev/null @@ -1,225 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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 deleted file mode 100644 index e18a6bb6d2..0000000000 --- a/packages/client-go/model_paginated_geo_ip_policy_list.go +++ /dev/null @@ -1,225 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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 deleted file mode 100644 index 468b01e89d..0000000000 --- a/packages/client-go/model_paginated_google_chrome_connector_list.go +++ /dev/null @@ -1,225 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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 deleted file mode 100644 index a14b3b77d5..0000000000 --- a/packages/client-go/model_paginated_google_endpoint_device_list.go +++ /dev/null @@ -1,225 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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 deleted file mode 100644 index 6a88161c39..0000000000 --- a/packages/client-go/model_paginated_google_workspace_provider_group_list.go +++ /dev/null @@ -1,225 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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 deleted file mode 100644 index fa4a7a6e07..0000000000 --- a/packages/client-go/model_paginated_google_workspace_provider_list.go +++ /dev/null @@ -1,225 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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 deleted file mode 100644 index a11fc0f35d..0000000000 --- a/packages/client-go/model_paginated_google_workspace_provider_mapping_list.go +++ /dev/null @@ -1,225 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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 deleted file mode 100644 index 4b7a11828d..0000000000 --- a/packages/client-go/model_paginated_google_workspace_provider_user_list.go +++ /dev/null @@ -1,225 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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 deleted file mode 100644 index 6502a300c9..0000000000 --- a/packages/client-go/model_paginated_group_kerberos_source_connection_list.go +++ /dev/null @@ -1,225 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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 deleted file mode 100644 index 9df4652502..0000000000 --- a/packages/client-go/model_paginated_group_ldap_source_connection_list.go +++ /dev/null @@ -1,225 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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_o_auth_source_connection_list.go b/packages/client-go/model_paginated_group_o_auth_source_connection_list.go deleted file mode 100644 index 240e7618f7..0000000000 --- a/packages/client-go/model_paginated_group_o_auth_source_connection_list.go +++ /dev/null @@ -1,225 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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 deleted file mode 100644 index 48da9e3c6a..0000000000 --- a/packages/client-go/model_paginated_group_plex_source_connection_list.go +++ /dev/null @@ -1,225 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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 deleted file mode 100644 index eab1a64b07..0000000000 --- a/packages/client-go/model_paginated_group_saml_source_connection_list.go +++ /dev/null @@ -1,225 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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 deleted file mode 100644 index bec7f61383..0000000000 --- a/packages/client-go/model_paginated_group_source_connection_list.go +++ /dev/null @@ -1,225 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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 deleted file mode 100644 index 06f88ba98a..0000000000 --- a/packages/client-go/model_paginated_group_telegram_source_connection_list.go +++ /dev/null @@ -1,225 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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 deleted file mode 100644 index e62980ef93..0000000000 --- a/packages/client-go/model_paginated_identification_stage_list.go +++ /dev/null @@ -1,225 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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 deleted file mode 100644 index e94c17abc4..0000000000 --- a/packages/client-go/model_paginated_initial_permissions_list.go +++ /dev/null @@ -1,225 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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 deleted file mode 100644 index 4b95dda998..0000000000 --- a/packages/client-go/model_paginated_invitation_list.go +++ /dev/null @@ -1,225 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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 deleted file mode 100644 index 35106f0cd2..0000000000 --- a/packages/client-go/model_paginated_invitation_stage_list.go +++ /dev/null @@ -1,225 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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 deleted file mode 100644 index 895183eb79..0000000000 --- a/packages/client-go/model_paginated_kerberos_source_list.go +++ /dev/null @@ -1,225 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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 deleted file mode 100644 index 084e99ae90..0000000000 --- a/packages/client-go/model_paginated_kerberos_source_property_mapping_list.go +++ /dev/null @@ -1,225 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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 deleted file mode 100644 index ae8c6ef4eb..0000000000 --- a/packages/client-go/model_paginated_kubernetes_service_connection_list.go +++ /dev/null @@ -1,225 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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_provider_list.go b/packages/client-go/model_paginated_ldap_provider_list.go deleted file mode 100644 index 498583f118..0000000000 --- a/packages/client-go/model_paginated_ldap_provider_list.go +++ /dev/null @@ -1,225 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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 deleted file mode 100644 index 2b2ca2bdfc..0000000000 --- a/packages/client-go/model_paginated_ldap_source_list.go +++ /dev/null @@ -1,225 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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 deleted file mode 100644 index 49f7bf96fe..0000000000 --- a/packages/client-go/model_paginated_ldap_source_property_mapping_list.go +++ /dev/null @@ -1,225 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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 deleted file mode 100644 index cf38228ba1..0000000000 --- a/packages/client-go/model_paginated_license_list.go +++ /dev/null @@ -1,225 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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 deleted file mode 100644 index 4aa03b5da7..0000000000 --- a/packages/client-go/model_paginated_lifecycle_iteration_list.go +++ /dev/null @@ -1,225 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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 deleted file mode 100644 index 1961c99417..0000000000 --- a/packages/client-go/model_paginated_lifecycle_rule_list.go +++ /dev/null @@ -1,225 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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 deleted file mode 100644 index 012ad10c38..0000000000 --- a/packages/client-go/model_paginated_microsoft_entra_provider_group_list.go +++ /dev/null @@ -1,225 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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 deleted file mode 100644 index 2e12f28e1c..0000000000 --- a/packages/client-go/model_paginated_microsoft_entra_provider_list.go +++ /dev/null @@ -1,225 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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 deleted file mode 100644 index 1b534d11c8..0000000000 --- a/packages/client-go/model_paginated_microsoft_entra_provider_mapping_list.go +++ /dev/null @@ -1,225 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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 deleted file mode 100644 index 29b9593ad6..0000000000 --- a/packages/client-go/model_paginated_microsoft_entra_provider_user_list.go +++ /dev/null @@ -1,225 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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 deleted file mode 100644 index b2ae43df7a..0000000000 --- a/packages/client-go/model_paginated_mutual_tls_stage_list.go +++ /dev/null @@ -1,225 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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 deleted file mode 100644 index 009471e645..0000000000 --- a/packages/client-go/model_paginated_notification_list.go +++ /dev/null @@ -1,225 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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 deleted file mode 100644 index bd6ad654e2..0000000000 --- a/packages/client-go/model_paginated_notification_rule_list.go +++ /dev/null @@ -1,225 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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 deleted file mode 100644 index 2058e4be42..0000000000 --- a/packages/client-go/model_paginated_notification_transport_list.go +++ /dev/null @@ -1,225 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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 deleted file mode 100644 index 3116ba6c1a..0000000000 --- a/packages/client-go/model_paginated_notification_webhook_mapping_list.go +++ /dev/null @@ -1,225 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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 deleted file mode 100644 index 0cff7ec139..0000000000 --- a/packages/client-go/model_paginated_o_auth2_provider_list.go +++ /dev/null @@ -1,225 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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 deleted file mode 100644 index 625cdb2bb1..0000000000 --- a/packages/client-go/model_paginated_o_auth_source_list.go +++ /dev/null @@ -1,225 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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 deleted file mode 100644 index a0b8b3a88e..0000000000 --- a/packages/client-go/model_paginated_o_auth_source_property_mapping_list.go +++ /dev/null @@ -1,225 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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_password_expiry_policy_list.go b/packages/client-go/model_paginated_password_expiry_policy_list.go deleted file mode 100644 index 78a7fc79bc..0000000000 --- a/packages/client-go/model_paginated_password_expiry_policy_list.go +++ /dev/null @@ -1,225 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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 deleted file mode 100644 index 5775722006..0000000000 --- a/packages/client-go/model_paginated_password_policy_list.go +++ /dev/null @@ -1,225 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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 deleted file mode 100644 index d065c9857f..0000000000 --- a/packages/client-go/model_paginated_password_stage_list.go +++ /dev/null @@ -1,225 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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 deleted file mode 100644 index 90f48d9f5e..0000000000 --- a/packages/client-go/model_paginated_permission_list.go +++ /dev/null @@ -1,225 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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 deleted file mode 100644 index 6d3b1a446e..0000000000 --- a/packages/client-go/model_paginated_plex_source_list.go +++ /dev/null @@ -1,225 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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 deleted file mode 100644 index 516f436457..0000000000 --- a/packages/client-go/model_paginated_plex_source_property_mapping_list.go +++ /dev/null @@ -1,225 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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 deleted file mode 100644 index eb98911c1d..0000000000 --- a/packages/client-go/model_paginated_policy_binding_list.go +++ /dev/null @@ -1,225 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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 deleted file mode 100644 index feb3a9f1dc..0000000000 --- a/packages/client-go/model_paginated_policy_list.go +++ /dev/null @@ -1,225 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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 deleted file mode 100644 index f1074bfdea..0000000000 --- a/packages/client-go/model_paginated_prompt_list.go +++ /dev/null @@ -1,225 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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 deleted file mode 100644 index f440f73368..0000000000 --- a/packages/client-go/model_paginated_prompt_stage_list.go +++ /dev/null @@ -1,225 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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 deleted file mode 100644 index 6936cf7241..0000000000 --- a/packages/client-go/model_paginated_property_mapping_list.go +++ /dev/null @@ -1,225 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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 deleted file mode 100644 index 4feafad863..0000000000 --- a/packages/client-go/model_paginated_provider_list.go +++ /dev/null @@ -1,225 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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_provider_list.go b/packages/client-go/model_paginated_proxy_provider_list.go deleted file mode 100644 index c13a770c32..0000000000 --- a/packages/client-go/model_paginated_proxy_provider_list.go +++ /dev/null @@ -1,225 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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 deleted file mode 100644 index fcea272d95..0000000000 --- a/packages/client-go/model_paginated_rac_property_mapping_list.go +++ /dev/null @@ -1,225 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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 deleted file mode 100644 index 24daef4ca5..0000000000 --- a/packages/client-go/model_paginated_rac_provider_list.go +++ /dev/null @@ -1,225 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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_provider_list.go b/packages/client-go/model_paginated_radius_provider_list.go deleted file mode 100644 index 174f49f549..0000000000 --- a/packages/client-go/model_paginated_radius_provider_list.go +++ /dev/null @@ -1,225 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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 deleted file mode 100644 index 3b12465179..0000000000 --- a/packages/client-go/model_paginated_radius_provider_property_mapping_list.go +++ /dev/null @@ -1,225 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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 deleted file mode 100644 index 64ed9bb22e..0000000000 --- a/packages/client-go/model_paginated_redirect_stage_list.go +++ /dev/null @@ -1,225 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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 deleted file mode 100644 index 8980965cc9..0000000000 --- a/packages/client-go/model_paginated_reputation_list.go +++ /dev/null @@ -1,225 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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 deleted file mode 100644 index b0ca29f2ac..0000000000 --- a/packages/client-go/model_paginated_reputation_policy_list.go +++ /dev/null @@ -1,225 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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 deleted file mode 100644 index 63217f2599..0000000000 --- a/packages/client-go/model_paginated_role_assigned_object_permission_list.go +++ /dev/null @@ -1,225 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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 deleted file mode 100644 index ca95e4b6bf..0000000000 --- a/packages/client-go/model_paginated_role_list.go +++ /dev/null @@ -1,225 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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 deleted file mode 100644 index e537bc510c..0000000000 --- a/packages/client-go/model_paginated_saml_property_mapping_list.go +++ /dev/null @@ -1,225 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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 deleted file mode 100644 index 40d33b6d0a..0000000000 --- a/packages/client-go/model_paginated_saml_provider_list.go +++ /dev/null @@ -1,225 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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 deleted file mode 100644 index 630e3bc82a..0000000000 --- a/packages/client-go/model_paginated_saml_source_list.go +++ /dev/null @@ -1,225 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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 deleted file mode 100644 index 052c548851..0000000000 --- a/packages/client-go/model_paginated_saml_source_property_mapping_list.go +++ /dev/null @@ -1,225 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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 deleted file mode 100644 index 4ed249ce72..0000000000 --- a/packages/client-go/model_paginated_schedule_list.go +++ /dev/null @@ -1,225 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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 deleted file mode 100644 index 6e8c07c748..0000000000 --- a/packages/client-go/model_paginated_scim_mapping_list.go +++ /dev/null @@ -1,225 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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 deleted file mode 100644 index b8b5d48ebe..0000000000 --- a/packages/client-go/model_paginated_scim_provider_group_list.go +++ /dev/null @@ -1,225 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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 deleted file mode 100644 index cba9d6fde0..0000000000 --- a/packages/client-go/model_paginated_scim_provider_list.go +++ /dev/null @@ -1,225 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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 deleted file mode 100644 index bc4d03df40..0000000000 --- a/packages/client-go/model_paginated_scim_provider_user_list.go +++ /dev/null @@ -1,225 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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 deleted file mode 100644 index 751780fc64..0000000000 --- a/packages/client-go/model_paginated_scim_source_group_list.go +++ /dev/null @@ -1,225 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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 deleted file mode 100644 index 49c1db6387..0000000000 --- a/packages/client-go/model_paginated_scim_source_list.go +++ /dev/null @@ -1,225 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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 deleted file mode 100644 index c1db16e727..0000000000 --- a/packages/client-go/model_paginated_scim_source_property_mapping_list.go +++ /dev/null @@ -1,225 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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 deleted file mode 100644 index 0d58bc6dec..0000000000 --- a/packages/client-go/model_paginated_scim_source_user_list.go +++ /dev/null @@ -1,225 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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 deleted file mode 100644 index 80a5e3277f..0000000000 --- a/packages/client-go/model_paginated_scope_mapping_list.go +++ /dev/null @@ -1,225 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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 deleted file mode 100644 index e1bd0f0836..0000000000 --- a/packages/client-go/model_paginated_service_connection_list.go +++ /dev/null @@ -1,225 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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 deleted file mode 100644 index c1585e7a1d..0000000000 --- a/packages/client-go/model_paginated_sms_device_list.go +++ /dev/null @@ -1,225 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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 deleted file mode 100644 index d4b89b0880..0000000000 --- a/packages/client-go/model_paginated_source_list.go +++ /dev/null @@ -1,225 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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 deleted file mode 100644 index 69c3368ffe..0000000000 --- a/packages/client-go/model_paginated_source_stage_list.go +++ /dev/null @@ -1,225 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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 deleted file mode 100644 index c188073c76..0000000000 --- a/packages/client-go/model_paginated_ssf_provider_list.go +++ /dev/null @@ -1,225 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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 deleted file mode 100644 index a8d7495032..0000000000 --- a/packages/client-go/model_paginated_ssf_stream_list.go +++ /dev/null @@ -1,225 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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 deleted file mode 100644 index 31c72fffac..0000000000 --- a/packages/client-go/model_paginated_stage_list.go +++ /dev/null @@ -1,225 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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 deleted file mode 100644 index 6cf191102d..0000000000 --- a/packages/client-go/model_paginated_static_device_list.go +++ /dev/null @@ -1,225 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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 deleted file mode 100644 index 3c43db57b2..0000000000 --- a/packages/client-go/model_paginated_task_list.go +++ /dev/null @@ -1,225 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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 deleted file mode 100644 index 10dd3d70f3..0000000000 --- a/packages/client-go/model_paginated_telegram_source_list.go +++ /dev/null @@ -1,225 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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 deleted file mode 100644 index adffe91bc6..0000000000 --- a/packages/client-go/model_paginated_telegram_source_property_mapping_list.go +++ /dev/null @@ -1,225 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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 deleted file mode 100644 index be16573f34..0000000000 --- a/packages/client-go/model_paginated_tenant_list.go +++ /dev/null @@ -1,225 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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 deleted file mode 100644 index 729aebb189..0000000000 --- a/packages/client-go/model_paginated_token_list.go +++ /dev/null @@ -1,225 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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 deleted file mode 100644 index 73189a5d12..0000000000 --- a/packages/client-go/model_paginated_token_model_list.go +++ /dev/null @@ -1,225 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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 deleted file mode 100644 index 7e52df125f..0000000000 --- a/packages/client-go/model_paginated_totp_device_list.go +++ /dev/null @@ -1,225 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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 deleted file mode 100644 index 31120497c4..0000000000 --- a/packages/client-go/model_paginated_unique_password_policy_list.go +++ /dev/null @@ -1,225 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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 deleted file mode 100644 index c5c710972d..0000000000 --- a/packages/client-go/model_paginated_user_consent_list.go +++ /dev/null @@ -1,225 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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 deleted file mode 100644 index e29f03b34e..0000000000 --- a/packages/client-go/model_paginated_user_delete_stage_list.go +++ /dev/null @@ -1,225 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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 deleted file mode 100644 index 627375e8bc..0000000000 --- a/packages/client-go/model_paginated_user_kerberos_source_connection_list.go +++ /dev/null @@ -1,225 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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 deleted file mode 100644 index c0a045b035..0000000000 --- a/packages/client-go/model_paginated_user_ldap_source_connection_list.go +++ /dev/null @@ -1,225 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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_login_stage_list.go b/packages/client-go/model_paginated_user_login_stage_list.go deleted file mode 100644 index 903aa7e227..0000000000 --- a/packages/client-go/model_paginated_user_login_stage_list.go +++ /dev/null @@ -1,225 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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 deleted file mode 100644 index 16b41ba38b..0000000000 --- a/packages/client-go/model_paginated_user_logout_stage_list.go +++ /dev/null @@ -1,225 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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 deleted file mode 100644 index 9b3e5ce222..0000000000 --- a/packages/client-go/model_paginated_user_o_auth_source_connection_list.go +++ /dev/null @@ -1,225 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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 deleted file mode 100644 index 2982abd769..0000000000 --- a/packages/client-go/model_paginated_user_plex_source_connection_list.go +++ /dev/null @@ -1,225 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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 deleted file mode 100644 index 72d9421436..0000000000 --- a/packages/client-go/model_paginated_user_saml_source_connection_list.go +++ /dev/null @@ -1,225 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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 deleted file mode 100644 index 6120cdc748..0000000000 --- a/packages/client-go/model_paginated_user_source_connection_list.go +++ /dev/null @@ -1,225 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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 deleted file mode 100644 index 014aa7513f..0000000000 --- a/packages/client-go/model_paginated_user_telegram_source_connection_list.go +++ /dev/null @@ -1,225 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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 deleted file mode 100644 index 06590ffd81..0000000000 --- a/packages/client-go/model_paginated_user_write_stage_list.go +++ /dev/null @@ -1,225 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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 deleted file mode 100644 index 15cea8911c..0000000000 --- a/packages/client-go/model_paginated_web_authn_device_list.go +++ /dev/null @@ -1,225 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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 deleted file mode 100644 index 086ce55f2e..0000000000 --- a/packages/client-go/model_paginated_web_authn_device_type_list.go +++ /dev/null @@ -1,225 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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 deleted file mode 100644 index 9aa415a890..0000000000 --- a/packages/client-go/model_paginated_ws_federation_provider_list.go +++ /dev/null @@ -1,225 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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_password_expiry_policy.go b/packages/client-go/model_password_expiry_policy.go deleted file mode 100644 index 4ed793e47b..0000000000 --- a/packages/client-go/model_password_expiry_policy.go +++ /dev/null @@ -1,450 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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 deleted file mode 100644 index 0f11ac2591..0000000000 --- a/packages/client-go/model_password_expiry_policy_request.go +++ /dev/null @@ -1,271 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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 deleted file mode 100644 index 3cff25ee65..0000000000 --- a/packages/client-go/model_password_policy.go +++ /dev/null @@ -1,868 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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 deleted file mode 100644 index ef218388df..0000000000 --- a/packages/client-go/model_password_policy_request.go +++ /dev/null @@ -1,689 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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 deleted file mode 100644 index b7e2ab5ef7..0000000000 --- a/packages/client-go/model_password_stage.go +++ /dev/null @@ -1,500 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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 deleted file mode 100644 index 7086417874..0000000000 --- a/packages/client-go/model_password_stage_request.go +++ /dev/null @@ -1,322 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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 deleted file mode 100644 index cc0b2732df..0000000000 --- a/packages/client-go/model_patched_agent_connector_request.go +++ /dev/null @@ -1,657 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.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 deleted file mode 100644 index 1220b7811e..0000000000 --- a/packages/client-go/model_patched_application_entitlement_request.go +++ /dev/null @@ -1,228 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.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 deleted file mode 100644 index ef6c20cdcc..0000000000 --- a/packages/client-go/model_patched_application_request.go +++ /dev/null @@ -1,538 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.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 deleted file mode 100644 index 08a67ac63b..0000000000 --- a/packages/client-go/model_patched_authenticator_duo_stage_request.go +++ /dev/null @@ -1,425 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.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 deleted file mode 100644 index 812b8adb2b..0000000000 --- a/packages/client-go/model_patched_authenticator_email_stage_request.go +++ /dev/null @@ -1,686 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.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 deleted file mode 100644 index df5dd4665a..0000000000 --- a/packages/client-go/model_patched_authenticator_endpoint_gdtc_stage_request.go +++ /dev/null @@ -1,277 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.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 deleted file mode 100644 index 01178ab1ac..0000000000 --- a/packages/client-go/model_patched_authenticator_sms_stage_request.go +++ /dev/null @@ -1,549 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.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 deleted file mode 100644 index 851c465690..0000000000 --- a/packages/client-go/model_patched_authenticator_static_stage_request.go +++ /dev/null @@ -1,314 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.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 deleted file mode 100644 index 7aede1e475..0000000000 --- a/packages/client-go/model_patched_authenticator_totp_stage_request.go +++ /dev/null @@ -1,277 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.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 deleted file mode 100644 index c24e5c113a..0000000000 --- a/packages/client-go/model_patched_authenticator_validate_stage_request.go +++ /dev/null @@ -1,417 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.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 deleted file mode 100644 index ceb41df98b..0000000000 --- a/packages/client-go/model_patched_authenticator_web_authn_stage_request.go +++ /dev/null @@ -1,511 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.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 *UserVerificationEnum `json:"resident_key_requirement,omitempty"` - Hints []WebAuthnHintEnum `json:"hints,omitempty"` - DeviceTypeRestrictions []string `json:"device_type_restrictions,omitempty"` - // When enabled, a given device can only be registered once. - PreventDuplicateDevices *bool `json:"prevent_duplicate_devices,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() UserVerificationEnum { - if o == nil || IsNil(o.ResidentKeyRequirement) { - var ret UserVerificationEnum - 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() (*UserVerificationEnum, 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 UserVerificationEnum and assigns it to the ResidentKeyRequirement field. -func (o *PatchedAuthenticatorWebAuthnStageRequest) SetResidentKeyRequirement(v UserVerificationEnum) { - 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 -} - -// GetPreventDuplicateDevices returns the PreventDuplicateDevices field value if set, zero value otherwise. -func (o *PatchedAuthenticatorWebAuthnStageRequest) GetPreventDuplicateDevices() bool { - if o == nil || IsNil(o.PreventDuplicateDevices) { - var ret bool - return ret - } - return *o.PreventDuplicateDevices -} - -// GetPreventDuplicateDevicesOk returns a tuple with the PreventDuplicateDevices field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *PatchedAuthenticatorWebAuthnStageRequest) GetPreventDuplicateDevicesOk() (*bool, bool) { - if o == nil || IsNil(o.PreventDuplicateDevices) { - return nil, false - } - return o.PreventDuplicateDevices, true -} - -// HasPreventDuplicateDevices returns a boolean if a field has been set. -func (o *PatchedAuthenticatorWebAuthnStageRequest) HasPreventDuplicateDevices() bool { - if o != nil && !IsNil(o.PreventDuplicateDevices) { - return true - } - - return false -} - -// SetPreventDuplicateDevices gets a reference to the given bool and assigns it to the PreventDuplicateDevices field. -func (o *PatchedAuthenticatorWebAuthnStageRequest) SetPreventDuplicateDevices(v bool) { - o.PreventDuplicateDevices = &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.PreventDuplicateDevices) { - toSerialize["prevent_duplicate_devices"] = o.PreventDuplicateDevices - } - 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, "prevent_duplicate_devices") - 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 deleted file mode 100644 index 4b49d11bb7..0000000000 --- a/packages/client-go/model_patched_blueprint_instance_request.go +++ /dev/null @@ -1,306 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.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 deleted file mode 100644 index 59e547dda5..0000000000 --- a/packages/client-go/model_patched_brand_request.go +++ /dev/null @@ -1,838 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.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 deleted file mode 100644 index 98525ce11a..0000000000 --- a/packages/client-go/model_patched_captcha_stage_request.go +++ /dev/null @@ -1,453 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.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 deleted file mode 100644 index c2d9676ce7..0000000000 --- a/packages/client-go/model_patched_certificate_key_pair_request.go +++ /dev/null @@ -1,230 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.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 deleted file mode 100644 index 729c1ffb56..0000000000 --- a/packages/client-go/model_patched_connection_token_request.go +++ /dev/null @@ -1,228 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.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 deleted file mode 100644 index 932ac9b076..0000000000 --- a/packages/client-go/model_patched_consent_stage_request.go +++ /dev/null @@ -1,229 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.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 *ConsentModeEnum `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() ConsentModeEnum { - if o == nil || IsNil(o.Mode) { - var ret ConsentModeEnum - 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() (*ConsentModeEnum, 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 ConsentModeEnum and assigns it to the Mode field. -func (o *PatchedConsentStageRequest) SetMode(v ConsentModeEnum) { - 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 deleted file mode 100644 index a8acc5ef00..0000000000 --- a/packages/client-go/model_patched_deny_stage_request.go +++ /dev/null @@ -1,191 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.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 deleted file mode 100644 index f8c6dc8043..0000000000 --- a/packages/client-go/model_patched_device_access_group_request.go +++ /dev/null @@ -1,191 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.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 deleted file mode 100644 index 8811fc23d5..0000000000 --- a/packages/client-go/model_patched_device_user_binding_request.go +++ /dev/null @@ -1,523 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.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 deleted file mode 100644 index c80b4fd6a7..0000000000 --- a/packages/client-go/model_patched_docker_service_connection_request.go +++ /dev/null @@ -1,328 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.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 deleted file mode 100644 index 55b9845a21..0000000000 --- a/packages/client-go/model_patched_domain_request.go +++ /dev/null @@ -1,228 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.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 deleted file mode 100644 index a7221d9d9a..0000000000 --- a/packages/client-go/model_patched_dummy_policy_request.go +++ /dev/null @@ -1,303 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.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 deleted file mode 100644 index 4c64483685..0000000000 --- a/packages/client-go/model_patched_dummy_stage_request.go +++ /dev/null @@ -1,191 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.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 deleted file mode 100644 index b1186d802e..0000000000 --- a/packages/client-go/model_patched_duo_device_request.go +++ /dev/null @@ -1,155 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.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 deleted file mode 100644 index 89d04800f5..0000000000 --- a/packages/client-go/model_patched_email_device_request.go +++ /dev/null @@ -1,155 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.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 deleted file mode 100644 index fce2c0fc12..0000000000 --- a/packages/client-go/model_patched_email_stage_request.go +++ /dev/null @@ -1,713 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.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 deleted file mode 100644 index 4db3e7a540..0000000000 --- a/packages/client-go/model_patched_endpoint_device_request.go +++ /dev/null @@ -1,399 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.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 deleted file mode 100644 index 46757b02cc..0000000000 --- a/packages/client-go/model_patched_endpoint_request.go +++ /dev/null @@ -1,413 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.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 deleted file mode 100644 index 66f6b1918d..0000000000 --- a/packages/client-go/model_patched_endpoint_stage_request.go +++ /dev/null @@ -1,228 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.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 deleted file mode 100644 index 42fb0e8ff4..0000000000 --- a/packages/client-go/model_patched_enrollment_token_request.go +++ /dev/null @@ -1,325 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.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 deleted file mode 100644 index 7d137673cc..0000000000 --- a/packages/client-go/model_patched_event_matcher_policy_request.go +++ /dev/null @@ -1,388 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.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 deleted file mode 100644 index c71d23b1ba..0000000000 --- a/packages/client-go/model_patched_event_request.go +++ /dev/null @@ -1,388 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.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 deleted file mode 100644 index 2e19a08fa7..0000000000 --- a/packages/client-go/model_patched_expression_policy_request.go +++ /dev/null @@ -1,229 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.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 deleted file mode 100644 index 46a4b0dc26..0000000000 --- a/packages/client-go/model_patched_fleet_connector_request.go +++ /dev/null @@ -1,425 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.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 deleted file mode 100644 index 1306cf1021..0000000000 --- a/packages/client-go/model_patched_flow_request.go +++ /dev/null @@ -1,494 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.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 deleted file mode 100644 index 907d1cac9a..0000000000 --- a/packages/client-go/model_patched_flow_stage_binding_request.go +++ /dev/null @@ -1,379 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.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 deleted file mode 100644 index 10fcccaa28..0000000000 --- a/packages/client-go/model_patched_geo_ip_policy_request.go +++ /dev/null @@ -1,488 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.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 deleted file mode 100644 index 3b9fde8f8e..0000000000 --- a/packages/client-go/model_patched_google_chrome_connector_request.go +++ /dev/null @@ -1,265 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.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 deleted file mode 100644 index 04e5701a69..0000000000 --- a/packages/client-go/model_patched_google_endpoint_device_request.go +++ /dev/null @@ -1,192 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.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 deleted file mode 100644 index 33d51f3cbd..0000000000 --- a/packages/client-go/model_patched_google_workspace_provider_mapping_request.go +++ /dev/null @@ -1,240 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.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 deleted file mode 100644 index 2ee30f94a7..0000000000 --- a/packages/client-go/model_patched_google_workspace_provider_request.go +++ /dev/null @@ -1,650 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.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 deleted file mode 100644 index 2f39c27de2..0000000000 --- a/packages/client-go/model_patched_group_kerberos_source_connection_request.go +++ /dev/null @@ -1,228 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.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 deleted file mode 100644 index 6142de000e..0000000000 --- a/packages/client-go/model_patched_group_ldap_source_connection_request.go +++ /dev/null @@ -1,228 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.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 deleted file mode 100644 index df20c152f0..0000000000 --- a/packages/client-go/model_patched_group_o_auth_source_connection_request.go +++ /dev/null @@ -1,228 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.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 deleted file mode 100644 index 9bff25e722..0000000000 --- a/packages/client-go/model_patched_group_plex_source_connection_request.go +++ /dev/null @@ -1,228 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.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 deleted file mode 100644 index 927836b5ee..0000000000 --- a/packages/client-go/model_patched_group_request.go +++ /dev/null @@ -1,340 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.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 deleted file mode 100644 index 26f90554ce..0000000000 --- a/packages/client-go/model_patched_group_saml_source_connection_request.go +++ /dev/null @@ -1,228 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.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 deleted file mode 100644 index 7b76da81a1..0000000000 --- a/packages/client-go/model_patched_group_source_connection_request.go +++ /dev/null @@ -1,228 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.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 deleted file mode 100644 index 3477c9cc65..0000000000 --- a/packages/client-go/model_patched_group_telegram_source_connection_request.go +++ /dev/null @@ -1,228 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.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 deleted file mode 100644 index b56995b393..0000000000 --- a/packages/client-go/model_patched_identification_stage_request.go +++ /dev/null @@ -1,713 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.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 deleted file mode 100644 index 0c6abbdf2f..0000000000 --- a/packages/client-go/model_patched_initial_permissions_request.go +++ /dev/null @@ -1,228 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.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 deleted file mode 100644 index 2272f3f212..0000000000 --- a/packages/client-go/model_patched_invitation_request.go +++ /dev/null @@ -1,327 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.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 deleted file mode 100644 index a14846bb4e..0000000000 --- a/packages/client-go/model_patched_invitation_stage_request.go +++ /dev/null @@ -1,192 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.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 deleted file mode 100644 index 01ed9faaf2..0000000000 --- a/packages/client-go/model_patched_kerberos_source_property_mapping_request.go +++ /dev/null @@ -1,240 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.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 deleted file mode 100644 index ad32f0f378..0000000000 --- a/packages/client-go/model_patched_kerberos_source_request.go +++ /dev/null @@ -1,1159 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.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 deleted file mode 100644 index 6f2f829473..0000000000 --- a/packages/client-go/model_patched_kubernetes_service_connection_request.go +++ /dev/null @@ -1,268 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.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 deleted file mode 100644 index dece1d7d46..0000000000 --- a/packages/client-go/model_patched_ldap_provider_request.go +++ /dev/null @@ -1,627 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.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 deleted file mode 100644 index df168b6552..0000000000 --- a/packages/client-go/model_patched_ldap_source_property_mapping_request.go +++ /dev/null @@ -1,240 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.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 deleted file mode 100644 index 1d132ad94e..0000000000 --- a/packages/client-go/model_patched_ldap_source_request.go +++ /dev/null @@ -1,1487 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.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 deleted file mode 100644 index be32458e03..0000000000 --- a/packages/client-go/model_patched_license_request.go +++ /dev/null @@ -1,154 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.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 deleted file mode 100644 index 3e551a70c7..0000000000 --- a/packages/client-go/model_patched_lifecycle_rule_request.go +++ /dev/null @@ -1,499 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.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 deleted file mode 100644 index 424eb3e42c..0000000000 --- a/packages/client-go/model_patched_microsoft_entra_provider_mapping_request.go +++ /dev/null @@ -1,240 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.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 deleted file mode 100644 index 21a557aaa7..0000000000 --- a/packages/client-go/model_patched_microsoft_entra_provider_request.go +++ /dev/null @@ -1,613 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.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 deleted file mode 100644 index 5a01cfc8ed..0000000000 --- a/packages/client-go/model_patched_mutual_tls_stage_request.go +++ /dev/null @@ -1,303 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.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 deleted file mode 100644 index fb0c0d22cc..0000000000 --- a/packages/client-go/model_patched_notification_request.go +++ /dev/null @@ -1,287 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.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 deleted file mode 100644 index 0597c7e01c..0000000000 --- a/packages/client-go/model_patched_notification_rule_request.go +++ /dev/null @@ -1,317 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.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 deleted file mode 100644 index 21fc97f38c..0000000000 --- a/packages/client-go/model_patched_notification_transport_request.go +++ /dev/null @@ -1,487 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.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 *TransportModeEnum `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() TransportModeEnum { - if o == nil || IsNil(o.Mode) { - var ret TransportModeEnum - 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() (*TransportModeEnum, 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 TransportModeEnum and assigns it to the Mode field. -func (o *PatchedNotificationTransportRequest) SetMode(v TransportModeEnum) { - 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 deleted file mode 100644 index b870c9b355..0000000000 --- a/packages/client-go/model_patched_notification_webhook_mapping_request.go +++ /dev/null @@ -1,191 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.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 deleted file mode 100644 index ee9c6b6d18..0000000000 --- a/packages/client-go/model_patched_o_auth2_provider_request.go +++ /dev/null @@ -1,978 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.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 deleted file mode 100644 index 6141ef0120..0000000000 --- a/packages/client-go/model_patched_o_auth_source_property_mapping_request.go +++ /dev/null @@ -1,240 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.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 deleted file mode 100644 index 33f2746d09..0000000000 --- a/packages/client-go/model_patched_o_auth_source_request.go +++ /dev/null @@ -1,1157 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.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 deleted file mode 100644 index 4eaa3015e1..0000000000 --- a/packages/client-go/model_patched_outpost_request.go +++ /dev/null @@ -1,363 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.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 deleted file mode 100644 index 3d63069f3c..0000000000 --- a/packages/client-go/model_patched_password_expiry_policy_request.go +++ /dev/null @@ -1,266 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.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 deleted file mode 100644 index cf929de73f..0000000000 --- a/packages/client-go/model_patched_password_policy_request.go +++ /dev/null @@ -1,676 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.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 deleted file mode 100644 index 90bb803b1a..0000000000 --- a/packages/client-go/model_patched_password_stage_request.go +++ /dev/null @@ -1,317 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.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 deleted file mode 100644 index ba058bf2ed..0000000000 --- a/packages/client-go/model_patched_permission_assign_request.go +++ /dev/null @@ -1,228 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.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 deleted file mode 100644 index b511cc4ab0..0000000000 --- a/packages/client-go/model_patched_plex_source_property_mapping_request.go +++ /dev/null @@ -1,240 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.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 deleted file mode 100644 index 7b739687fc..0000000000 --- a/packages/client-go/model_patched_plex_source_request.go +++ /dev/null @@ -1,779 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.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 deleted file mode 100644 index c8bf7bd2ee..0000000000 --- a/packages/client-go/model_patched_policy_binding_request.go +++ /dev/null @@ -1,486 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.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 deleted file mode 100644 index b10b95f1ce..0000000000 --- a/packages/client-go/model_patched_prompt_request.go +++ /dev/null @@ -1,527 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.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 deleted file mode 100644 index bf6065f000..0000000000 --- a/packages/client-go/model_patched_prompt_stage_request.go +++ /dev/null @@ -1,228 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.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 deleted file mode 100644 index 4dfbca47ac..0000000000 --- a/packages/client-go/model_patched_proxy_provider_request.go +++ /dev/null @@ -1,891 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.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 deleted file mode 100644 index 2a7a1d198b..0000000000 --- a/packages/client-go/model_patched_rac_property_mapping_request.go +++ /dev/null @@ -1,277 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.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 deleted file mode 100644 index 5fe04f8d61..0000000000 --- a/packages/client-go/model_patched_rac_provider_request.go +++ /dev/null @@ -1,391 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.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 deleted file mode 100644 index fc00afe34f..0000000000 --- a/packages/client-go/model_patched_radius_provider_property_mapping_request.go +++ /dev/null @@ -1,240 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.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 deleted file mode 100644 index 58756450cb..0000000000 --- a/packages/client-go/model_patched_radius_provider_request.go +++ /dev/null @@ -1,478 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.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 deleted file mode 100644 index 871f7c1d6d..0000000000 --- a/packages/client-go/model_patched_redirect_stage_request.go +++ /dev/null @@ -1,313 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.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 deleted file mode 100644 index 1acd2c0bd4..0000000000 --- a/packages/client-go/model_patched_reputation_policy_request.go +++ /dev/null @@ -1,303 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.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 deleted file mode 100644 index 6aeb33f992..0000000000 --- a/packages/client-go/model_patched_role_request.go +++ /dev/null @@ -1,154 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.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 deleted file mode 100644 index 4bf4ddbaab..0000000000 --- a/packages/client-go/model_patched_saml_property_mapping_request.go +++ /dev/null @@ -1,325 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.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 deleted file mode 100644 index c3cf05349d..0000000000 --- a/packages/client-go/model_patched_saml_provider_request.go +++ /dev/null @@ -1,1237 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.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 deleted file mode 100644 index 69f17276c0..0000000000 --- a/packages/client-go/model_patched_saml_source_property_mapping_request.go +++ /dev/null @@ -1,240 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.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 deleted file mode 100644 index 4e4cd9cb89..0000000000 --- a/packages/client-go/model_patched_saml_source_request.go +++ /dev/null @@ -1,1274 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.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"` - // When enabled, the IdP will re-authenticate the user even if a session exists. - ForceAuthn *bool `json:"force_authn,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 -} - -// GetForceAuthn returns the ForceAuthn field value if set, zero value otherwise. -func (o *PatchedSAMLSourceRequest) GetForceAuthn() bool { - if o == nil || IsNil(o.ForceAuthn) { - var ret bool - return ret - } - return *o.ForceAuthn -} - -// GetForceAuthnOk returns a tuple with the ForceAuthn field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *PatchedSAMLSourceRequest) GetForceAuthnOk() (*bool, bool) { - if o == nil || IsNil(o.ForceAuthn) { - return nil, false - } - return o.ForceAuthn, true -} - -// HasForceAuthn returns a boolean if a field has been set. -func (o *PatchedSAMLSourceRequest) HasForceAuthn() bool { - if o != nil && !IsNil(o.ForceAuthn) { - return true - } - - return false -} - -// SetForceAuthn gets a reference to the given bool and assigns it to the ForceAuthn field. -func (o *PatchedSAMLSourceRequest) SetForceAuthn(v bool) { - o.ForceAuthn = &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.ForceAuthn) { - toSerialize["force_authn"] = o.ForceAuthn - } - 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, "force_authn") - 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 deleted file mode 100644 index 0c7c74e1b3..0000000000 --- a/packages/client-go/model_patched_schedule_request.go +++ /dev/null @@ -1,241 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.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 deleted file mode 100644 index 6241324e1a..0000000000 --- a/packages/client-go/model_patched_scim_mapping_request.go +++ /dev/null @@ -1,240 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.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 deleted file mode 100644 index 4cc47c0675..0000000000 --- a/packages/client-go/model_patched_scim_provider_request.go +++ /dev/null @@ -1,731 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.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 deleted file mode 100644 index f9eb7787d7..0000000000 --- a/packages/client-go/model_patched_scim_source_group_request.go +++ /dev/null @@ -1,302 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.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 deleted file mode 100644 index 836ff727a2..0000000000 --- a/packages/client-go/model_patched_scim_source_property_mapping_request.go +++ /dev/null @@ -1,240 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.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 deleted file mode 100644 index 08928d785e..0000000000 --- a/packages/client-go/model_patched_scim_source_request.go +++ /dev/null @@ -1,341 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.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 deleted file mode 100644 index c8e362dd1e..0000000000 --- a/packages/client-go/model_patched_scim_source_user_request.go +++ /dev/null @@ -1,302 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.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 deleted file mode 100644 index 6f9eb659c0..0000000000 --- a/packages/client-go/model_patched_scope_mapping_request.go +++ /dev/null @@ -1,316 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.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 deleted file mode 100644 index 8a9ce6dcb7..0000000000 --- a/packages/client-go/model_patched_settings_request.go +++ /dev/null @@ -1,724 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.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 deleted file mode 100644 index 8292b433f6..0000000000 --- a/packages/client-go/model_patched_settings_request_flags.go +++ /dev/null @@ -1,258 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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 deleted file mode 100644 index f25a0fb629..0000000000 --- a/packages/client-go/model_patched_sms_device_request.go +++ /dev/null @@ -1,155 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.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 deleted file mode 100644 index 0e7b56999d..0000000000 --- a/packages/client-go/model_patched_source_stage_request.go +++ /dev/null @@ -1,229 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.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 deleted file mode 100644 index 39a8c0ed9b..0000000000 --- a/packages/client-go/model_patched_ssf_provider_request.go +++ /dev/null @@ -1,303 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.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"` - PushVerifyCertificates *bool `json:"push_verify_certificates,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 -} - -// GetPushVerifyCertificates returns the PushVerifyCertificates field value if set, zero value otherwise. -func (o *PatchedSSFProviderRequest) GetPushVerifyCertificates() bool { - if o == nil || IsNil(o.PushVerifyCertificates) { - var ret bool - return ret - } - return *o.PushVerifyCertificates -} - -// GetPushVerifyCertificatesOk returns a tuple with the PushVerifyCertificates field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *PatchedSSFProviderRequest) GetPushVerifyCertificatesOk() (*bool, bool) { - if o == nil || IsNil(o.PushVerifyCertificates) { - return nil, false - } - return o.PushVerifyCertificates, true -} - -// HasPushVerifyCertificates returns a boolean if a field has been set. -func (o *PatchedSSFProviderRequest) HasPushVerifyCertificates() bool { - if o != nil && !IsNil(o.PushVerifyCertificates) { - return true - } - - return false -} - -// SetPushVerifyCertificates gets a reference to the given bool and assigns it to the PushVerifyCertificates field. -func (o *PatchedSSFProviderRequest) SetPushVerifyCertificates(v bool) { - o.PushVerifyCertificates = &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 - } - if !IsNil(o.PushVerifyCertificates) { - toSerialize["push_verify_certificates"] = o.PushVerifyCertificates - } - - 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") - delete(additionalProperties, "push_verify_certificates") - 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 deleted file mode 100644 index cf56c5af3b..0000000000 --- a/packages/client-go/model_patched_static_device_request.go +++ /dev/null @@ -1,155 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.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 deleted file mode 100644 index f7863bbfa8..0000000000 --- a/packages/client-go/model_patched_telegram_source_property_mapping_request.go +++ /dev/null @@ -1,240 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.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 deleted file mode 100644 index e2a2369da1..0000000000 --- a/packages/client-go/model_patched_telegram_source_request.go +++ /dev/null @@ -1,741 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.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 deleted file mode 100644 index c602ec8c2b..0000000000 --- a/packages/client-go/model_patched_tenant_request.go +++ /dev/null @@ -1,228 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.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 deleted file mode 100644 index 7525d7f031..0000000000 --- a/packages/client-go/model_patched_token_request.go +++ /dev/null @@ -1,400 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.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 deleted file mode 100644 index d370fee468..0000000000 --- a/packages/client-go/model_patched_totp_device_request.go +++ /dev/null @@ -1,155 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.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 deleted file mode 100644 index 1f526e7736..0000000000 --- a/packages/client-go/model_patched_unique_password_policy_request.go +++ /dev/null @@ -1,268 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.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 deleted file mode 100644 index 9948256109..0000000000 --- a/packages/client-go/model_patched_user_delete_stage_request.go +++ /dev/null @@ -1,154 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.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 deleted file mode 100644 index 950ceb5766..0000000000 --- a/packages/client-go/model_patched_user_kerberos_source_connection_request.go +++ /dev/null @@ -1,228 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.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 deleted file mode 100644 index 748ff3b29a..0000000000 --- a/packages/client-go/model_patched_user_ldap_source_connection_request.go +++ /dev/null @@ -1,228 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.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 deleted file mode 100644 index 0557703229..0000000000 --- a/packages/client-go/model_patched_user_login_stage_request.go +++ /dev/null @@ -1,382 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.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 deleted file mode 100644 index fe893b191f..0000000000 --- a/packages/client-go/model_patched_user_logout_stage_request.go +++ /dev/null @@ -1,154 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.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 deleted file mode 100644 index e1584935b9..0000000000 --- a/packages/client-go/model_patched_user_o_auth_source_connection_request.go +++ /dev/null @@ -1,314 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.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 deleted file mode 100644 index 60b3d9c4ca..0000000000 --- a/packages/client-go/model_patched_user_plex_source_connection_request.go +++ /dev/null @@ -1,265 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.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 deleted file mode 100644 index ed1646de0b..0000000000 --- a/packages/client-go/model_patched_user_request.go +++ /dev/null @@ -1,501 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.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 deleted file mode 100644 index e375ba50c1..0000000000 --- a/packages/client-go/model_patched_user_saml_source_connection_request.go +++ /dev/null @@ -1,228 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.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 deleted file mode 100644 index 081fd60749..0000000000 --- a/packages/client-go/model_patched_user_source_connection_request.go +++ /dev/null @@ -1,228 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.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 deleted file mode 100644 index 7c73cb720d..0000000000 --- a/packages/client-go/model_patched_user_telegram_source_connection_request.go +++ /dev/null @@ -1,228 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.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 deleted file mode 100644 index b683a6aa8a..0000000000 --- a/packages/client-go/model_patched_user_write_stage_request.go +++ /dev/null @@ -1,352 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.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 deleted file mode 100644 index d14c41eb0a..0000000000 --- a/packages/client-go/model_patched_web_authn_device_request.go +++ /dev/null @@ -1,154 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.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 deleted file mode 100644 index 5a4ae7517c..0000000000 --- a/packages/client-go/model_patched_ws_federation_provider_request.go +++ /dev/null @@ -1,885 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.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 deleted file mode 100644 index dcb2cdffbb..0000000000 --- a/packages/client-go/model_permission.go +++ /dev/null @@ -1,343 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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 deleted file mode 100644 index bae2aae8ec..0000000000 --- a/packages/client-go/model_permission_assign_request.go +++ /dev/null @@ -1,241 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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 deleted file mode 100644 index 4906fa721c..0000000000 --- a/packages/client-go/model_permission_assign_result.go +++ /dev/null @@ -1,167 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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 deleted file mode 100644 index 6b29cef632..0000000000 --- a/packages/client-go/model_pkce_method_enum.go +++ /dev/null @@ -1,113 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.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_source.go b/packages/client-go/model_plex_source.go deleted file mode 100644 index 3a690a6d4e..0000000000 --- a/packages/client-go/model_plex_source.go +++ /dev/null @@ -1,1017 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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 deleted file mode 100644 index a2e8660ebe..0000000000 --- a/packages/client-go/model_plex_source_property_mapping.go +++ /dev/null @@ -1,394 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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 deleted file mode 100644 index 337abf5432..0000000000 --- a/packages/client-go/model_plex_source_property_mapping_request.go +++ /dev/null @@ -1,245 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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 deleted file mode 100644 index 443478b4f4..0000000000 --- a/packages/client-go/model_plex_source_request.go +++ /dev/null @@ -1,776 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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 deleted file mode 100644 index 9c8c60e8db..0000000000 --- a/packages/client-go/model_plex_token_redeem_request.go +++ /dev/null @@ -1,167 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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 deleted file mode 100644 index cf542de001..0000000000 --- a/packages/client-go/model_policy.go +++ /dev/null @@ -1,384 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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 deleted file mode 100644 index 5dd865db30..0000000000 --- a/packages/client-go/model_policy_binding.go +++ /dev/null @@ -1,613 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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 NullablePolicy `json:"policy_obj"` - GroupObj NullablePartialGroup `json:"group_obj"` - UserObj NullablePartialUser `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 NullablePolicy, groupObj NullablePartialGroup, userObj NullablePartialUser, 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 -// If the value is explicit nil, the zero value for Policy will be returned -func (o *PolicyBinding) GetPolicyObj() Policy { - if o == nil || o.PolicyObj.Get() == nil { - var ret Policy - return ret - } - - return *o.PolicyObj.Get() -} - -// GetPolicyObjOk returns a tuple with the PolicyObj 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 *PolicyBinding) GetPolicyObjOk() (*Policy, bool) { - if o == nil { - return nil, false - } - return o.PolicyObj.Get(), o.PolicyObj.IsSet() -} - -// SetPolicyObj sets field value -func (o *PolicyBinding) SetPolicyObj(v Policy) { - o.PolicyObj.Set(&v) -} - -// GetGroupObj returns the GroupObj field value -// If the value is explicit nil, the zero value for PartialGroup will be returned -func (o *PolicyBinding) GetGroupObj() PartialGroup { - if o == nil || o.GroupObj.Get() == nil { - var ret PartialGroup - return ret - } - - return *o.GroupObj.Get() -} - -// GetGroupObjOk returns a tuple with the GroupObj 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 *PolicyBinding) GetGroupObjOk() (*PartialGroup, bool) { - if o == nil { - return nil, false - } - return o.GroupObj.Get(), o.GroupObj.IsSet() -} - -// SetGroupObj sets field value -func (o *PolicyBinding) SetGroupObj(v PartialGroup) { - o.GroupObj.Set(&v) -} - -// GetUserObj returns the UserObj field value -// If the value is explicit nil, the zero value for PartialUser will be returned -func (o *PolicyBinding) GetUserObj() PartialUser { - if o == nil || o.UserObj.Get() == nil { - var ret PartialUser - return ret - } - - return *o.UserObj.Get() -} - -// GetUserObjOk returns a tuple with the UserObj 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 *PolicyBinding) GetUserObjOk() (*PartialUser, bool) { - if o == nil { - return nil, false - } - return o.UserObj.Get(), o.UserObj.IsSet() -} - -// SetUserObj sets field value -func (o *PolicyBinding) SetUserObj(v PartialUser) { - o.UserObj.Set(&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.Get() - toSerialize["group_obj"] = o.GroupObj.Get() - toSerialize["user_obj"] = o.UserObj.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 *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 deleted file mode 100644 index cd47baf68d..0000000000 --- a/packages/client-go/model_policy_binding_request.go +++ /dev/null @@ -1,491 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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 deleted file mode 100644 index 5e55b2b773..0000000000 --- a/packages/client-go/model_policy_engine_mode.go +++ /dev/null @@ -1,111 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.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 deleted file mode 100644 index 2393a7f1d6..0000000000 --- a/packages/client-go/model_policy_test_request.go +++ /dev/null @@ -1,204 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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_process.go b/packages/client-go/model_process.go deleted file mode 100644 index b93aef5ffd..0000000000 --- a/packages/client-go/model_process.go +++ /dev/null @@ -1,233 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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 deleted file mode 100644 index 41dee798b0..0000000000 --- a/packages/client-go/model_process_request.go +++ /dev/null @@ -1,233 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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 deleted file mode 100644 index 9cb7e8446e..0000000000 --- a/packages/client-go/model_prompt.go +++ /dev/null @@ -1,574 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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_request.go b/packages/client-go/model_prompt_request.go deleted file mode 100644 index fe1a3cc990..0000000000 --- a/packages/client-go/model_prompt_request.go +++ /dev/null @@ -1,516 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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 deleted file mode 100644 index 2ac17a4bac..0000000000 --- a/packages/client-go/model_prompt_stage.go +++ /dev/null @@ -1,411 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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 deleted file mode 100644 index 573b8698ff..0000000000 --- a/packages/client-go/model_prompt_stage_request.go +++ /dev/null @@ -1,233 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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_property_mapping.go b/packages/client-go/model_property_mapping.go deleted file mode 100644 index 3e35a14cb6..0000000000 --- a/packages/client-go/model_property_mapping.go +++ /dev/null @@ -1,394 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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 deleted file mode 100644 index 233ff829d7..0000000000 --- a/packages/client-go/model_property_mapping_preview.go +++ /dev/null @@ -1,167 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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 deleted file mode 100644 index 3c194d5b32..0000000000 --- a/packages/client-go/model_property_mapping_test_request.go +++ /dev/null @@ -1,250 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.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 deleted file mode 100644 index 89755ccd05..0000000000 --- a/packages/client-go/model_property_mapping_test_result.go +++ /dev/null @@ -1,196 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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 deleted file mode 100644 index 1109584c8e..0000000000 --- a/packages/client-go/model_protocol_enum.go +++ /dev/null @@ -1,113 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.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_enum.go b/packages/client-go/model_provider_enum.go deleted file mode 100644 index 75af56e378..0000000000 --- a/packages/client-go/model_provider_enum.go +++ /dev/null @@ -1,111 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.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 deleted file mode 100644 index ff480e5ff2..0000000000 --- a/packages/client-go/model_provider_model_enum.go +++ /dev/null @@ -1,129 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.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 deleted file mode 100644 index 61b0ed4f4a..0000000000 --- a/packages/client-go/model_provider_type_enum.go +++ /dev/null @@ -1,141 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.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_provider.go b/packages/client-go/model_proxy_provider.go deleted file mode 100644 index d95f3cd409..0000000000 --- a/packages/client-go/model_proxy_provider.go +++ /dev/null @@ -1,1244 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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 deleted file mode 100644 index ce59d648f2..0000000000 --- a/packages/client-go/model_proxy_provider_request.go +++ /dev/null @@ -1,880 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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 deleted file mode 100644 index 9a165ce3de..0000000000 --- a/packages/client-go/model_rac_property_mapping.go +++ /dev/null @@ -1,431 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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 deleted file mode 100644 index 0fc2dadcc1..0000000000 --- a/packages/client-go/model_rac_property_mapping_request.go +++ /dev/null @@ -1,282 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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 deleted file mode 100644 index 6e5f2ff3a1..0000000000 --- a/packages/client-go/model_rac_provider.go +++ /dev/null @@ -1,702 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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 deleted file mode 100644 index 1afec53c39..0000000000 --- a/packages/client-go/model_rac_provider_request.go +++ /dev/null @@ -1,396 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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_provider.go b/packages/client-go/model_radius_provider.go deleted file mode 100644 index 82adc80e62..0000000000 --- a/packages/client-go/model_radius_provider.go +++ /dev/null @@ -1,781 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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 deleted file mode 100644 index 29e18882cf..0000000000 --- a/packages/client-go/model_radius_provider_property_mapping.go +++ /dev/null @@ -1,394 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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 deleted file mode 100644 index e2e127efb8..0000000000 --- a/packages/client-go/model_radius_provider_property_mapping_request.go +++ /dev/null @@ -1,245 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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 deleted file mode 100644 index be2710af3b..0000000000 --- a/packages/client-go/model_radius_provider_request.go +++ /dev/null @@ -1,475 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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_stage.go b/packages/client-go/model_redirect_stage.go deleted file mode 100644 index 077ca1db60..0000000000 --- a/packages/client-go/model_redirect_stage.go +++ /dev/null @@ -1,496 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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 deleted file mode 100644 index 25e631a1df..0000000000 --- a/packages/client-go/model_redirect_stage_mode_enum.go +++ /dev/null @@ -1,111 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.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 deleted file mode 100644 index b65a2018b5..0000000000 --- a/packages/client-go/model_redirect_stage_request.go +++ /dev/null @@ -1,318 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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 deleted file mode 100644 index 68c4519d70..0000000000 --- a/packages/client-go/model_redirect_uri.go +++ /dev/null @@ -1,237 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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"` - RedirectUriType *RedirectUriTypeEnum `json:"redirect_uri_type,omitempty"` - 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 - var redirectUriType RedirectUriTypeEnum = REDIRECTURITYPEENUM_AUTHORIZATION - this.RedirectUriType = &redirectUriType - 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{} - var redirectUriType RedirectUriTypeEnum = REDIRECTURITYPEENUM_AUTHORIZATION - this.RedirectUriType = &redirectUriType - 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 -} - -// GetRedirectUriType returns the RedirectUriType field value if set, zero value otherwise. -func (o *RedirectURI) GetRedirectUriType() RedirectUriTypeEnum { - if o == nil || IsNil(o.RedirectUriType) { - var ret RedirectUriTypeEnum - return ret - } - return *o.RedirectUriType -} - -// GetRedirectUriTypeOk returns a tuple with the RedirectUriType field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *RedirectURI) GetRedirectUriTypeOk() (*RedirectUriTypeEnum, bool) { - if o == nil || IsNil(o.RedirectUriType) { - return nil, false - } - return o.RedirectUriType, true -} - -// HasRedirectUriType returns a boolean if a field has been set. -func (o *RedirectURI) HasRedirectUriType() bool { - if o != nil && !IsNil(o.RedirectUriType) { - return true - } - - return false -} - -// SetRedirectUriType gets a reference to the given RedirectUriTypeEnum and assigns it to the RedirectUriType field. -func (o *RedirectURI) SetRedirectUriType(v RedirectUriTypeEnum) { - o.RedirectUriType = &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 - if !IsNil(o.RedirectUriType) { - toSerialize["redirect_uri_type"] = o.RedirectUriType - } - - 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") - delete(additionalProperties, "redirect_uri_type") - 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 deleted file mode 100644 index 11918394c5..0000000000 --- a/packages/client-go/model_redirect_uri_request.go +++ /dev/null @@ -1,237 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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"` - RedirectUriType *RedirectUriTypeEnum `json:"redirect_uri_type,omitempty"` - 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 - var redirectUriType RedirectUriTypeEnum = REDIRECTURITYPEENUM_AUTHORIZATION - this.RedirectUriType = &redirectUriType - 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{} - var redirectUriType RedirectUriTypeEnum = REDIRECTURITYPEENUM_AUTHORIZATION - this.RedirectUriType = &redirectUriType - 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 -} - -// GetRedirectUriType returns the RedirectUriType field value if set, zero value otherwise. -func (o *RedirectURIRequest) GetRedirectUriType() RedirectUriTypeEnum { - if o == nil || IsNil(o.RedirectUriType) { - var ret RedirectUriTypeEnum - return ret - } - return *o.RedirectUriType -} - -// GetRedirectUriTypeOk returns a tuple with the RedirectUriType field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *RedirectURIRequest) GetRedirectUriTypeOk() (*RedirectUriTypeEnum, bool) { - if o == nil || IsNil(o.RedirectUriType) { - return nil, false - } - return o.RedirectUriType, true -} - -// HasRedirectUriType returns a boolean if a field has been set. -func (o *RedirectURIRequest) HasRedirectUriType() bool { - if o != nil && !IsNil(o.RedirectUriType) { - return true - } - - return false -} - -// SetRedirectUriType gets a reference to the given RedirectUriTypeEnum and assigns it to the RedirectUriType field. -func (o *RedirectURIRequest) SetRedirectUriType(v RedirectUriTypeEnum) { - o.RedirectUriType = &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 - if !IsNil(o.RedirectUriType) { - toSerialize["redirect_uri_type"] = o.RedirectUriType - } - - 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") - delete(additionalProperties, "redirect_uri_type") - 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_redirect_uri_type_enum.go b/packages/client-go/model_redirect_uri_type_enum.go deleted file mode 100644 index 8c26452aa8..0000000000 --- a/packages/client-go/model_redirect_uri_type_enum.go +++ /dev/null @@ -1,111 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: hello@goauthentik.io -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package api - -import ( - "encoding/json" - "fmt" -) - -// RedirectUriTypeEnum the model 'RedirectUriTypeEnum' -type RedirectUriTypeEnum string - -// List of RedirectUriTypeEnum -const ( - REDIRECTURITYPEENUM_AUTHORIZATION RedirectUriTypeEnum = "authorization" - REDIRECTURITYPEENUM_LOGOUT RedirectUriTypeEnum = "logout" -) - -// All allowed values of RedirectUriTypeEnum enum -var AllowedRedirectUriTypeEnumEnumValues = []RedirectUriTypeEnum{ - "authorization", - "logout", -} - -func (v *RedirectUriTypeEnum) UnmarshalJSON(src []byte) error { - var value string - err := json.Unmarshal(src, &value) - if err != nil { - return err - } - enumTypeValue := RedirectUriTypeEnum(value) - for _, existing := range AllowedRedirectUriTypeEnumEnumValues { - if existing == enumTypeValue { - *v = enumTypeValue - return nil - } - } - - return fmt.Errorf("%+v is not a valid RedirectUriTypeEnum", value) -} - -// NewRedirectUriTypeEnumFromValue returns a pointer to a valid RedirectUriTypeEnum -// for the value passed as argument, or an error if the value passed is not allowed by the enum -func NewRedirectUriTypeEnumFromValue(v string) (*RedirectUriTypeEnum, error) { - ev := RedirectUriTypeEnum(v) - if ev.IsValid() { - return &ev, nil - } else { - return nil, fmt.Errorf("invalid value '%v' for RedirectUriTypeEnum: valid values are %v", v, AllowedRedirectUriTypeEnumEnumValues) - } -} - -// IsValid return true if the value is valid for the enum, false otherwise -func (v RedirectUriTypeEnum) IsValid() bool { - for _, existing := range AllowedRedirectUriTypeEnumEnumValues { - if existing == v { - return true - } - } - return false -} - -// Ptr returns reference to RedirectUriTypeEnum value -func (v RedirectUriTypeEnum) Ptr() *RedirectUriTypeEnum { - return &v -} - -type NullableRedirectUriTypeEnum struct { - value *RedirectUriTypeEnum - isSet bool -} - -func (v NullableRedirectUriTypeEnum) Get() *RedirectUriTypeEnum { - return v.value -} - -func (v *NullableRedirectUriTypeEnum) Set(val *RedirectUriTypeEnum) { - v.value = val - v.isSet = true -} - -func (v NullableRedirectUriTypeEnum) IsSet() bool { - return v.isSet -} - -func (v *NullableRedirectUriTypeEnum) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableRedirectUriTypeEnum(val *RedirectUriTypeEnum) *NullableRedirectUriTypeEnum { - return &NullableRedirectUriTypeEnum{value: val, isSet: true} -} - -func (v NullableRedirectUriTypeEnum) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableRedirectUriTypeEnum) 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 deleted file mode 100644 index d35a88ba05..0000000000 --- a/packages/client-go/model_reputation.go +++ /dev/null @@ -1,374 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.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 deleted file mode 100644 index a4a0e1f855..0000000000 --- a/packages/client-go/model_reputation_policy.go +++ /dev/null @@ -1,495 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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 deleted file mode 100644 index 521dade30f..0000000000 --- a/packages/client-go/model_reputation_policy_request.go +++ /dev/null @@ -1,316 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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_review.go b/packages/client-go/model_review.go deleted file mode 100644 index 62e64aa655..0000000000 --- a/packages/client-go/model_review.go +++ /dev/null @@ -1,303 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.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 deleted file mode 100644 index c7edfd99d6..0000000000 --- a/packages/client-go/model_review_request.go +++ /dev/null @@ -1,215 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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 deleted file mode 100644 index 9ba749267f..0000000000 --- a/packages/client-go/model_reviewer_group.go +++ /dev/null @@ -1,196 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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 deleted file mode 100644 index bcc6453c55..0000000000 --- a/packages/client-go/model_reviewer_user.go +++ /dev/null @@ -1,256 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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_assigned_object_permission.go b/packages/client-go/model_role_assigned_object_permission.go deleted file mode 100644 index 2e6bd7b175..0000000000 --- a/packages/client-go/model_role_assigned_object_permission.go +++ /dev/null @@ -1,254 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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 deleted file mode 100644 index 7c27eff3d1..0000000000 --- a/packages/client-go/model_role_model_permission.go +++ /dev/null @@ -1,283 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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 deleted file mode 100644 index 958a357e04..0000000000 --- a/packages/client-go/model_role_object_permission.go +++ /dev/null @@ -1,312 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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 deleted file mode 100644 index ffbbea97dd..0000000000 --- a/packages/client-go/model_role_request.go +++ /dev/null @@ -1,167 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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_logout_methods.go b/packages/client-go/model_saml_logout_methods.go deleted file mode 100644 index 8b07d1f3fd..0000000000 --- a/packages/client-go/model_saml_logout_methods.go +++ /dev/null @@ -1,113 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.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 deleted file mode 100644 index 76a3d25b3d..0000000000 --- a/packages/client-go/model_saml_metadata.go +++ /dev/null @@ -1,215 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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 NullableString `json:"download_url,omitempty"` - 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) *SAMLMetadata { - this := SAMLMetadata{} - this.Metadata = metadata - 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 if set, zero value otherwise (both if not set or set to explicit null). -func (o *SAMLMetadata) GetDownloadUrl() string { - if o == nil || IsNil(o.DownloadUrl.Get()) { - var ret string - return ret - } - return *o.DownloadUrl.Get() -} - -// GetDownloadUrlOk returns a tuple with the DownloadUrl field value if set, nil otherwise -// and a boolean to check if the value has been set. -// NOTE: If the value is an explicit nil, `nil, true` will be returned -func (o *SAMLMetadata) GetDownloadUrlOk() (*string, bool) { - if o == nil { - return nil, false - } - return o.DownloadUrl.Get(), o.DownloadUrl.IsSet() -} - -// HasDownloadUrl returns a boolean if a field has been set. -func (o *SAMLMetadata) HasDownloadUrl() bool { - if o != nil && o.DownloadUrl.IsSet() { - return true - } - - return false -} - -// SetDownloadUrl gets a reference to the given NullableString and assigns it to the DownloadUrl field. -func (o *SAMLMetadata) SetDownloadUrl(v string) { - o.DownloadUrl.Set(&v) -} - -// SetDownloadUrlNil sets the value for DownloadUrl to be an explicit nil -func (o *SAMLMetadata) SetDownloadUrlNil() { - o.DownloadUrl.Set(nil) -} - -// UnsetDownloadUrl ensures that no value is present for DownloadUrl, not even an explicit nil -func (o *SAMLMetadata) UnsetDownloadUrl() { - o.DownloadUrl.Unset() -} - -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 - if o.DownloadUrl.IsSet() { - toSerialize["download_url"] = o.DownloadUrl.Get() - } - - 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", - } - - allProperties := make(map[string]interface{}) - - err = json.Unmarshal(data, &allProperties) - - if 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 deleted file mode 100644 index 4ae9b2ca46..0000000000 --- a/packages/client-go/model_saml_name_id_policy_enum.go +++ /dev/null @@ -1,119 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.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 deleted file mode 100644 index a7f9328aed..0000000000 --- a/packages/client-go/model_saml_property_mapping.go +++ /dev/null @@ -1,471 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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 deleted file mode 100644 index fb368e0fb6..0000000000 --- a/packages/client-go/model_saml_property_mapping_request.go +++ /dev/null @@ -1,322 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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 deleted file mode 100644 index e0cd278bec..0000000000 --- a/packages/client-go/model_saml_provider.go +++ /dev/null @@ -1,1683 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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 deleted file mode 100644 index 0e3bf65397..0000000000 --- a/packages/client-go/model_saml_provider_request.go +++ /dev/null @@ -1,1226 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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 deleted file mode 100644 index 3728832683..0000000000 --- a/packages/client-go/model_saml_source.go +++ /dev/null @@ -1,1504 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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"` - // When enabled, the IdP will re-authenticate the user even if a session exists. - ForceAuthn *bool `json:"force_authn,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 -} - -// GetForceAuthn returns the ForceAuthn field value if set, zero value otherwise. -func (o *SAMLSource) GetForceAuthn() bool { - if o == nil || IsNil(o.ForceAuthn) { - var ret bool - return ret - } - return *o.ForceAuthn -} - -// GetForceAuthnOk returns a tuple with the ForceAuthn field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *SAMLSource) GetForceAuthnOk() (*bool, bool) { - if o == nil || IsNil(o.ForceAuthn) { - return nil, false - } - return o.ForceAuthn, true -} - -// HasForceAuthn returns a boolean if a field has been set. -func (o *SAMLSource) HasForceAuthn() bool { - if o != nil && !IsNil(o.ForceAuthn) { - return true - } - - return false -} - -// SetForceAuthn gets a reference to the given bool and assigns it to the ForceAuthn field. -func (o *SAMLSource) SetForceAuthn(v bool) { - o.ForceAuthn = &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.ForceAuthn) { - toSerialize["force_authn"] = o.ForceAuthn - } - 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, "force_authn") - 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 deleted file mode 100644 index 02791b8a16..0000000000 --- a/packages/client-go/model_saml_source_property_mapping.go +++ /dev/null @@ -1,394 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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 deleted file mode 100644 index 835eb488b2..0000000000 --- a/packages/client-go/model_saml_source_property_mapping_request.go +++ /dev/null @@ -1,245 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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 deleted file mode 100644 index 8084c0d512..0000000000 --- a/packages/client-go/model_saml_source_request.go +++ /dev/null @@ -1,1263 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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"` - // When enabled, the IdP will re-authenticate the user even if a session exists. - ForceAuthn *bool `json:"force_authn,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 -} - -// GetForceAuthn returns the ForceAuthn field value if set, zero value otherwise. -func (o *SAMLSourceRequest) GetForceAuthn() bool { - if o == nil || IsNil(o.ForceAuthn) { - var ret bool - return ret - } - return *o.ForceAuthn -} - -// GetForceAuthnOk returns a tuple with the ForceAuthn field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *SAMLSourceRequest) GetForceAuthnOk() (*bool, bool) { - if o == nil || IsNil(o.ForceAuthn) { - return nil, false - } - return o.ForceAuthn, true -} - -// HasForceAuthn returns a boolean if a field has been set. -func (o *SAMLSourceRequest) HasForceAuthn() bool { - if o != nil && !IsNil(o.ForceAuthn) { - return true - } - - return false -} - -// SetForceAuthn gets a reference to the given bool and assigns it to the ForceAuthn field. -func (o *SAMLSourceRequest) SetForceAuthn(v bool) { - o.ForceAuthn = &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.ForceAuthn) { - toSerialize["force_authn"] = o.ForceAuthn - } - 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, "force_authn") - 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 deleted file mode 100644 index 19915d66ef..0000000000 --- a/packages/client-go/model_schedule.go +++ /dev/null @@ -1,524 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.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 deleted file mode 100644 index 4107416c68..0000000000 --- a/packages/client-go/model_schedule_request.go +++ /dev/null @@ -1,254 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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 deleted file mode 100644 index 6357b27420..0000000000 --- a/packages/client-go/model_scim_authentication_mode_enum.go +++ /dev/null @@ -1,111 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.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 deleted file mode 100644 index 1d65078bac..0000000000 --- a/packages/client-go/model_scim_mapping.go +++ /dev/null @@ -1,394 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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 deleted file mode 100644 index 4eaf538505..0000000000 --- a/packages/client-go/model_scim_mapping_request.go +++ /dev/null @@ -1,245 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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 deleted file mode 100644 index c41b1620a5..0000000000 --- a/packages/client-go/model_scim_provider.go +++ /dev/null @@ -1,949 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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 deleted file mode 100644 index 843ef008fa..0000000000 --- a/packages/client-go/model_scim_provider_group.go +++ /dev/null @@ -1,312 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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 deleted file mode 100644 index 8855f5f4dd..0000000000 --- a/packages/client-go/model_scim_provider_group_request.go +++ /dev/null @@ -1,225 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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 deleted file mode 100644 index 582a950bc4..0000000000 --- a/packages/client-go/model_scim_provider_request.go +++ /dev/null @@ -1,736 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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 deleted file mode 100644 index d7068655e9..0000000000 --- a/packages/client-go/model_scim_provider_user.go +++ /dev/null @@ -1,312 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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 deleted file mode 100644 index 22f8a02888..0000000000 --- a/packages/client-go/model_scim_provider_user_request.go +++ /dev/null @@ -1,225 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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 deleted file mode 100644 index 030ff1ef4d..0000000000 --- a/packages/client-go/model_scim_source.go +++ /dev/null @@ -1,586 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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 deleted file mode 100644 index e8793c7806..0000000000 --- a/packages/client-go/model_scim_source_group.go +++ /dev/null @@ -1,328 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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 deleted file mode 100644 index 19811297eb..0000000000 --- a/packages/client-go/model_scim_source_group_request.go +++ /dev/null @@ -1,299 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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 deleted file mode 100644 index 9d611ae2f5..0000000000 --- a/packages/client-go/model_scim_source_property_mapping.go +++ /dev/null @@ -1,394 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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 deleted file mode 100644 index 5493018d75..0000000000 --- a/packages/client-go/model_scim_source_property_mapping_request.go +++ /dev/null @@ -1,245 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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 deleted file mode 100644 index b7192be613..0000000000 --- a/packages/client-go/model_scim_source_request.go +++ /dev/null @@ -1,346 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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 deleted file mode 100644 index 04d3dc0a6b..0000000000 --- a/packages/client-go/model_scim_source_user.go +++ /dev/null @@ -1,328 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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 deleted file mode 100644 index 28f02c3e07..0000000000 --- a/packages/client-go/model_scim_source_user_request.go +++ /dev/null @@ -1,299 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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 deleted file mode 100644 index dd7526af2b..0000000000 --- a/packages/client-go/model_scope_mapping.go +++ /dev/null @@ -1,462 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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 deleted file mode 100644 index 9f21c95a22..0000000000 --- a/packages/client-go/model_scope_mapping_request.go +++ /dev/null @@ -1,313 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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_service_connection_state.go b/packages/client-go/model_service_connection_state.go deleted file mode 100644 index 4e3b042ed9..0000000000 --- a/packages/client-go/model_service_connection_state.go +++ /dev/null @@ -1,196 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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_settings.go b/packages/client-go/model_settings.go deleted file mode 100644 index 28a86e7400..0000000000 --- a/packages/client-go/model_settings.go +++ /dev/null @@ -1,737 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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 deleted file mode 100644 index ccdefe1f12..0000000000 --- a/packages/client-go/model_settings_request.go +++ /dev/null @@ -1,737 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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 deleted file mode 100644 index 82ae5720b2..0000000000 --- a/packages/client-go/model_severity_enum.go +++ /dev/null @@ -1,113 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.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_signature_algorithm_enum.go b/packages/client-go/model_signature_algorithm_enum.go deleted file mode 100644 index 1a615fa048..0000000000 --- a/packages/client-go/model_signature_algorithm_enum.go +++ /dev/null @@ -1,125 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.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 deleted file mode 100644 index 6394f0004a..0000000000 --- a/packages/client-go/model_sms_device.go +++ /dev/null @@ -1,255 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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 deleted file mode 100644 index dab4fba35d..0000000000 --- a/packages/client-go/model_sms_device_request.go +++ /dev/null @@ -1,168 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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 deleted file mode 100644 index fd6791459e..0000000000 --- a/packages/client-go/model_software.go +++ /dev/null @@ -1,270 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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 deleted file mode 100644 index 441e726abf..0000000000 --- a/packages/client-go/model_software_request.go +++ /dev/null @@ -1,270 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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 deleted file mode 100644 index abf4b3332a..0000000000 --- a/packages/client-go/model_source.go +++ /dev/null @@ -1,838 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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 deleted file mode 100644 index dd18f1b99c..0000000000 --- a/packages/client-go/model_source_stage.go +++ /dev/null @@ -1,412 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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 deleted file mode 100644 index cb9939fa5d..0000000000 --- a/packages/client-go/model_source_stage_request.go +++ /dev/null @@ -1,234 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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 deleted file mode 100644 index 96ccaee7a8..0000000000 --- a/packages/client-go/model_source_type.go +++ /dev/null @@ -1,411 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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 deleted file mode 100644 index bf820eec1e..0000000000 --- a/packages/client-go/model_ssf_provider.go +++ /dev/null @@ -1,546 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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"` - OidcAuthProvidersObj []Provider `json:"oidc_auth_providers_obj"` - SsfUrl NullableString `json:"ssf_url"` - EventRetention *string `json:"event_retention,omitempty"` - PushVerifyCertificates *bool `json:"push_verify_certificates,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, oidcAuthProvidersObj []Provider, 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.OidcAuthProvidersObj = oidcAuthProvidersObj - 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 -} - -// GetOidcAuthProvidersObj returns the OidcAuthProvidersObj field value -func (o *SSFProvider) GetOidcAuthProvidersObj() []Provider { - if o == nil { - var ret []Provider - return ret - } - - return o.OidcAuthProvidersObj -} - -// GetOidcAuthProvidersObjOk returns a tuple with the OidcAuthProvidersObj field value -// and a boolean to check if the value has been set. -func (o *SSFProvider) GetOidcAuthProvidersObjOk() ([]Provider, bool) { - if o == nil { - return nil, false - } - return o.OidcAuthProvidersObj, true -} - -// SetOidcAuthProvidersObj sets field value -func (o *SSFProvider) SetOidcAuthProvidersObj(v []Provider) { - o.OidcAuthProvidersObj = 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 -} - -// GetPushVerifyCertificates returns the PushVerifyCertificates field value if set, zero value otherwise. -func (o *SSFProvider) GetPushVerifyCertificates() bool { - if o == nil || IsNil(o.PushVerifyCertificates) { - var ret bool - return ret - } - return *o.PushVerifyCertificates -} - -// GetPushVerifyCertificatesOk returns a tuple with the PushVerifyCertificates field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *SSFProvider) GetPushVerifyCertificatesOk() (*bool, bool) { - if o == nil || IsNil(o.PushVerifyCertificates) { - return nil, false - } - return o.PushVerifyCertificates, true -} - -// HasPushVerifyCertificates returns a boolean if a field has been set. -func (o *SSFProvider) HasPushVerifyCertificates() bool { - if o != nil && !IsNil(o.PushVerifyCertificates) { - return true - } - - return false -} - -// SetPushVerifyCertificates gets a reference to the given bool and assigns it to the PushVerifyCertificates field. -func (o *SSFProvider) SetPushVerifyCertificates(v bool) { - o.PushVerifyCertificates = &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["oidc_auth_providers_obj"] = o.OidcAuthProvidersObj - toSerialize["ssf_url"] = o.SsfUrl.Get() - if !IsNil(o.EventRetention) { - toSerialize["event_retention"] = o.EventRetention - } - if !IsNil(o.PushVerifyCertificates) { - toSerialize["push_verify_certificates"] = o.PushVerifyCertificates - } - - 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", - "oidc_auth_providers_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, "oidc_auth_providers_obj") - delete(additionalProperties, "ssf_url") - delete(additionalProperties, "event_retention") - delete(additionalProperties, "push_verify_certificates") - 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 deleted file mode 100644 index ac362f53b5..0000000000 --- a/packages/client-go/model_ssf_provider_request.go +++ /dev/null @@ -1,308 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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"` - PushVerifyCertificates *bool `json:"push_verify_certificates,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 -} - -// GetPushVerifyCertificates returns the PushVerifyCertificates field value if set, zero value otherwise. -func (o *SSFProviderRequest) GetPushVerifyCertificates() bool { - if o == nil || IsNil(o.PushVerifyCertificates) { - var ret bool - return ret - } - return *o.PushVerifyCertificates -} - -// GetPushVerifyCertificatesOk returns a tuple with the PushVerifyCertificates field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *SSFProviderRequest) GetPushVerifyCertificatesOk() (*bool, bool) { - if o == nil || IsNil(o.PushVerifyCertificates) { - return nil, false - } - return o.PushVerifyCertificates, true -} - -// HasPushVerifyCertificates returns a boolean if a field has been set. -func (o *SSFProviderRequest) HasPushVerifyCertificates() bool { - if o != nil && !IsNil(o.PushVerifyCertificates) { - return true - } - - return false -} - -// SetPushVerifyCertificates gets a reference to the given bool and assigns it to the PushVerifyCertificates field. -func (o *SSFProviderRequest) SetPushVerifyCertificates(v bool) { - o.PushVerifyCertificates = &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 - } - if !IsNil(o.PushVerifyCertificates) { - toSerialize["push_verify_certificates"] = o.PushVerifyCertificates - } - - 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") - delete(additionalProperties, "push_verify_certificates") - 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 deleted file mode 100644 index 169aae7b82..0000000000 --- a/packages/client-go/model_ssf_stream.go +++ /dev/null @@ -1,471 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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"` - Status *SSFStreamStatusEnum `json:"status,omitempty"` - 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 -} - -// GetStatus returns the Status field value if set, zero value otherwise. -func (o *SSFStream) GetStatus() SSFStreamStatusEnum { - if o == nil || IsNil(o.Status) { - var ret SSFStreamStatusEnum - return ret - } - return *o.Status -} - -// GetStatusOk returns a tuple with the Status field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *SSFStream) GetStatusOk() (*SSFStreamStatusEnum, bool) { - if o == nil || IsNil(o.Status) { - return nil, false - } - return o.Status, true -} - -// HasStatus returns a boolean if a field has been set. -func (o *SSFStream) HasStatus() bool { - if o != nil && !IsNil(o.Status) { - return true - } - - return false -} - -// SetStatus gets a reference to the given SSFStreamStatusEnum and assigns it to the Status field. -func (o *SSFStream) SetStatus(v SSFStreamStatusEnum) { - o.Status = &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 - if !IsNil(o.Status) { - toSerialize["status"] = o.Status - } - 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, "status") - 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_ssf_stream_status_enum.go b/packages/client-go/model_ssf_stream_status_enum.go deleted file mode 100644 index b45731afe7..0000000000 --- a/packages/client-go/model_ssf_stream_status_enum.go +++ /dev/null @@ -1,113 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: hello@goauthentik.io -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package api - -import ( - "encoding/json" - "fmt" -) - -// SSFStreamStatusEnum the model 'SSFStreamStatusEnum' -type SSFStreamStatusEnum string - -// List of SSFStreamStatusEnum -const ( - SSFSTREAMSTATUSENUM_ENABLED SSFStreamStatusEnum = "enabled" - SSFSTREAMSTATUSENUM_PAUSED SSFStreamStatusEnum = "paused" - SSFSTREAMSTATUSENUM_DISABLED SSFStreamStatusEnum = "disabled" -) - -// All allowed values of SSFStreamStatusEnum enum -var AllowedSSFStreamStatusEnumEnumValues = []SSFStreamStatusEnum{ - "enabled", - "paused", - "disabled", -} - -func (v *SSFStreamStatusEnum) UnmarshalJSON(src []byte) error { - var value string - err := json.Unmarshal(src, &value) - if err != nil { - return err - } - enumTypeValue := SSFStreamStatusEnum(value) - for _, existing := range AllowedSSFStreamStatusEnumEnumValues { - if existing == enumTypeValue { - *v = enumTypeValue - return nil - } - } - - return fmt.Errorf("%+v is not a valid SSFStreamStatusEnum", value) -} - -// NewSSFStreamStatusEnumFromValue returns a pointer to a valid SSFStreamStatusEnum -// for the value passed as argument, or an error if the value passed is not allowed by the enum -func NewSSFStreamStatusEnumFromValue(v string) (*SSFStreamStatusEnum, error) { - ev := SSFStreamStatusEnum(v) - if ev.IsValid() { - return &ev, nil - } else { - return nil, fmt.Errorf("invalid value '%v' for SSFStreamStatusEnum: valid values are %v", v, AllowedSSFStreamStatusEnumEnumValues) - } -} - -// IsValid return true if the value is valid for the enum, false otherwise -func (v SSFStreamStatusEnum) IsValid() bool { - for _, existing := range AllowedSSFStreamStatusEnumEnumValues { - if existing == v { - return true - } - } - return false -} - -// Ptr returns reference to SSFStreamStatusEnum value -func (v SSFStreamStatusEnum) Ptr() *SSFStreamStatusEnum { - return &v -} - -type NullableSSFStreamStatusEnum struct { - value *SSFStreamStatusEnum - isSet bool -} - -func (v NullableSSFStreamStatusEnum) Get() *SSFStreamStatusEnum { - return v.value -} - -func (v *NullableSSFStreamStatusEnum) Set(val *SSFStreamStatusEnum) { - v.value = val - v.isSet = true -} - -func (v NullableSSFStreamStatusEnum) IsSet() bool { - return v.isSet -} - -func (v *NullableSSFStreamStatusEnum) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableSSFStreamStatusEnum(val *SSFStreamStatusEnum) *NullableSSFStreamStatusEnum { - return &NullableSSFStreamStatusEnum{value: val, isSet: true} -} - -func (v NullableSSFStreamStatusEnum) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableSSFStreamStatusEnum) 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 deleted file mode 100644 index 975636ff42..0000000000 --- a/packages/client-go/model_stage.go +++ /dev/null @@ -1,345 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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 deleted file mode 100644 index 6de4d539a9..0000000000 --- a/packages/client-go/model_stage_mode_enum.go +++ /dev/null @@ -1,111 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.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_static_device.go b/packages/client-go/model_static_device.go deleted file mode 100644 index 79bb281ad3..0000000000 --- a/packages/client-go/model_static_device.go +++ /dev/null @@ -1,255 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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 deleted file mode 100644 index c7e71cc6db..0000000000 --- a/packages/client-go/model_static_device_request.go +++ /dev/null @@ -1,168 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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 deleted file mode 100644 index 57b0048b4b..0000000000 --- a/packages/client-go/model_static_device_token.go +++ /dev/null @@ -1,167 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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 deleted file mode 100644 index e0e86196c2..0000000000 --- a/packages/client-go/model_sub_mode_enum.go +++ /dev/null @@ -1,119 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.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 deleted file mode 100644 index 0d2be976bd..0000000000 --- a/packages/client-go/model_sync_object_model_enum.go +++ /dev/null @@ -1,111 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.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 deleted file mode 100644 index 1e76e688bb..0000000000 --- a/packages/client-go/model_sync_object_request.go +++ /dev/null @@ -1,237 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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 deleted file mode 100644 index f68b46c5e2..0000000000 --- a/packages/client-go/model_sync_object_result.go +++ /dev/null @@ -1,167 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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 deleted file mode 100644 index 8aa49b90c5..0000000000 --- a/packages/client-go/model_sync_outgoing_trigger_mode_enum.go +++ /dev/null @@ -1,113 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.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 deleted file mode 100644 index e64fc11369..0000000000 --- a/packages/client-go/model_sync_status.go +++ /dev/null @@ -1,242 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.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 deleted file mode 100644 index 7ffcdf077f..0000000000 --- a/packages/client-go/model_system_info.go +++ /dev/null @@ -1,378 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.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 deleted file mode 100644 index 3e3862cdc2..0000000000 --- a/packages/client-go/model_system_info_runtime.go +++ /dev/null @@ -1,372 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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 deleted file mode 100644 index a29e57e2cb..0000000000 --- a/packages/client-go/model_task.go +++ /dev/null @@ -1,660 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.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 *TaskStatusEnum `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() TaskStatusEnum { - if o == nil || IsNil(o.State) { - var ret TaskStatusEnum - 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() (*TaskStatusEnum, 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 TaskStatusEnum and assigns it to the State field. -func (o *Task) SetState(v TaskStatusEnum) { - 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 deleted file mode 100644 index 81b70c989e..0000000000 --- a/packages/client-go/model_task_aggregated_status_enum.go +++ /dev/null @@ -1,127 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.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_status_enum.go b/packages/client-go/model_task_status_enum.go deleted file mode 100644 index a1ef94008a..0000000000 --- a/packages/client-go/model_task_status_enum.go +++ /dev/null @@ -1,121 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: hello@goauthentik.io -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package api - -import ( - "encoding/json" - "fmt" -) - -// TaskStatusEnum the model 'TaskStatusEnum' -type TaskStatusEnum string - -// List of TaskStatusEnum -const ( - TASKSTATUSENUM_QUEUED TaskStatusEnum = "queued" - TASKSTATUSENUM_CONSUMED TaskStatusEnum = "consumed" - TASKSTATUSENUM_PREPROCESS TaskStatusEnum = "preprocess" - TASKSTATUSENUM_RUNNING TaskStatusEnum = "running" - TASKSTATUSENUM_POSTPROCESS TaskStatusEnum = "postprocess" - TASKSTATUSENUM_REJECTED TaskStatusEnum = "rejected" - TASKSTATUSENUM_DONE TaskStatusEnum = "done" -) - -// All allowed values of TaskStatusEnum enum -var AllowedTaskStatusEnumEnumValues = []TaskStatusEnum{ - "queued", - "consumed", - "preprocess", - "running", - "postprocess", - "rejected", - "done", -} - -func (v *TaskStatusEnum) UnmarshalJSON(src []byte) error { - var value string - err := json.Unmarshal(src, &value) - if err != nil { - return err - } - enumTypeValue := TaskStatusEnum(value) - for _, existing := range AllowedTaskStatusEnumEnumValues { - if existing == enumTypeValue { - *v = enumTypeValue - return nil - } - } - - return fmt.Errorf("%+v is not a valid TaskStatusEnum", value) -} - -// NewTaskStatusEnumFromValue returns a pointer to a valid TaskStatusEnum -// for the value passed as argument, or an error if the value passed is not allowed by the enum -func NewTaskStatusEnumFromValue(v string) (*TaskStatusEnum, error) { - ev := TaskStatusEnum(v) - if ev.IsValid() { - return &ev, nil - } else { - return nil, fmt.Errorf("invalid value '%v' for TaskStatusEnum: valid values are %v", v, AllowedTaskStatusEnumEnumValues) - } -} - -// IsValid return true if the value is valid for the enum, false otherwise -func (v TaskStatusEnum) IsValid() bool { - for _, existing := range AllowedTaskStatusEnumEnumValues { - if existing == v { - return true - } - } - return false -} - -// Ptr returns reference to TaskStatusEnum value -func (v TaskStatusEnum) Ptr() *TaskStatusEnum { - return &v -} - -type NullableTaskStatusEnum struct { - value *TaskStatusEnum - isSet bool -} - -func (v NullableTaskStatusEnum) Get() *TaskStatusEnum { - return v.value -} - -func (v *NullableTaskStatusEnum) Set(val *TaskStatusEnum) { - v.value = val - v.isSet = true -} - -func (v NullableTaskStatusEnum) IsSet() bool { - return v.isSet -} - -func (v *NullableTaskStatusEnum) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableTaskStatusEnum(val *TaskStatusEnum) *NullableTaskStatusEnum { - return &NullableTaskStatusEnum{value: val, isSet: true} -} - -func (v NullableTaskStatusEnum) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableTaskStatusEnum) 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 deleted file mode 100644 index a2850a5c81..0000000000 --- a/packages/client-go/model_telegram_auth_request.go +++ /dev/null @@ -1,373 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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_source.go b/packages/client-go/model_telegram_source.go deleted file mode 100644 index b706f3af6a..0000000000 --- a/packages/client-go/model_telegram_source.go +++ /dev/null @@ -1,935 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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 deleted file mode 100644 index 3a0ea18234..0000000000 --- a/packages/client-go/model_telegram_source_property_mapping.go +++ /dev/null @@ -1,394 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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 deleted file mode 100644 index 9659a72d93..0000000000 --- a/packages/client-go/model_telegram_source_property_mapping_request.go +++ /dev/null @@ -1,245 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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 deleted file mode 100644 index c56aec938f..0000000000 --- a/packages/client-go/model_telegram_source_request.go +++ /dev/null @@ -1,722 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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 deleted file mode 100644 index 4f50b7abc8..0000000000 --- a/packages/client-go/model_tenant.go +++ /dev/null @@ -1,262 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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 deleted file mode 100644 index 20b47ba930..0000000000 --- a/packages/client-go/model_tenant_admin_group_request_request.go +++ /dev/null @@ -1,167 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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 deleted file mode 100644 index 5ddd7ca71d..0000000000 --- a/packages/client-go/model_tenant_recovery_key_request_request.go +++ /dev/null @@ -1,196 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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 deleted file mode 100644 index eb98919113..0000000000 --- a/packages/client-go/model_tenant_recovery_key_response.go +++ /dev/null @@ -1,197 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.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 deleted file mode 100644 index ac11778fb8..0000000000 --- a/packages/client-go/model_tenant_request.go +++ /dev/null @@ -1,233 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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_token.go b/packages/client-go/model_token.go deleted file mode 100644 index c47e02376e..0000000000 --- a/packages/client-go/model_token.go +++ /dev/null @@ -1,471 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.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 deleted file mode 100644 index 9fb8de3758..0000000000 --- a/packages/client-go/model_token_model.go +++ /dev/null @@ -1,400 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.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 deleted file mode 100644 index c54d233702..0000000000 --- a/packages/client-go/model_token_request.go +++ /dev/null @@ -1,413 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.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 deleted file mode 100644 index f5c7d32f2b..0000000000 --- a/packages/client-go/model_token_set_key_request.go +++ /dev/null @@ -1,167 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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 deleted file mode 100644 index db44415cdc..0000000000 --- a/packages/client-go/model_token_view.go +++ /dev/null @@ -1,167 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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 deleted file mode 100644 index 6ac31b0f24..0000000000 --- a/packages/client-go/model_totp_device.go +++ /dev/null @@ -1,226 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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 deleted file mode 100644 index 005bdcedc7..0000000000 --- a/packages/client-go/model_totp_device_request.go +++ /dev/null @@ -1,168 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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 deleted file mode 100644 index 100723893c..0000000000 --- a/packages/client-go/model_transaction_application_request.go +++ /dev/null @@ -1,262 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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 deleted file mode 100644 index 9ed3d03c91..0000000000 --- a/packages/client-go/model_transaction_application_response.go +++ /dev/null @@ -1,196 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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 deleted file mode 100644 index 593bdd0190..0000000000 --- a/packages/client-go/model_transaction_policy_binding_request.go +++ /dev/null @@ -1,462 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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_transport_mode_enum.go b/packages/client-go/model_transport_mode_enum.go deleted file mode 100644 index 36e7ec3de8..0000000000 --- a/packages/client-go/model_transport_mode_enum.go +++ /dev/null @@ -1,115 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: hello@goauthentik.io -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package api - -import ( - "encoding/json" - "fmt" -) - -// TransportModeEnum the model 'TransportModeEnum' -type TransportModeEnum string - -// List of TransportModeEnum -const ( - TRANSPORTMODEENUM_LOCAL TransportModeEnum = "local" - TRANSPORTMODEENUM_WEBHOOK TransportModeEnum = "webhook" - TRANSPORTMODEENUM_WEBHOOK_SLACK TransportModeEnum = "webhook_slack" - TRANSPORTMODEENUM_EMAIL TransportModeEnum = "email" -) - -// All allowed values of TransportModeEnum enum -var AllowedTransportModeEnumEnumValues = []TransportModeEnum{ - "local", - "webhook", - "webhook_slack", - "email", -} - -func (v *TransportModeEnum) UnmarshalJSON(src []byte) error { - var value string - err := json.Unmarshal(src, &value) - if err != nil { - return err - } - enumTypeValue := TransportModeEnum(value) - for _, existing := range AllowedTransportModeEnumEnumValues { - if existing == enumTypeValue { - *v = enumTypeValue - return nil - } - } - - return fmt.Errorf("%+v is not a valid TransportModeEnum", value) -} - -// NewTransportModeEnumFromValue returns a pointer to a valid TransportModeEnum -// for the value passed as argument, or an error if the value passed is not allowed by the enum -func NewTransportModeEnumFromValue(v string) (*TransportModeEnum, error) { - ev := TransportModeEnum(v) - if ev.IsValid() { - return &ev, nil - } else { - return nil, fmt.Errorf("invalid value '%v' for TransportModeEnum: valid values are %v", v, AllowedTransportModeEnumEnumValues) - } -} - -// IsValid return true if the value is valid for the enum, false otherwise -func (v TransportModeEnum) IsValid() bool { - for _, existing := range AllowedTransportModeEnumEnumValues { - if existing == v { - return true - } - } - return false -} - -// Ptr returns reference to TransportModeEnum value -func (v TransportModeEnum) Ptr() *TransportModeEnum { - return &v -} - -type NullableTransportModeEnum struct { - value *TransportModeEnum - isSet bool -} - -func (v NullableTransportModeEnum) Get() *TransportModeEnum { - return v.value -} - -func (v *NullableTransportModeEnum) Set(val *TransportModeEnum) { - v.value = val - v.isSet = true -} - -func (v NullableTransportModeEnum) IsSet() bool { - return v.isSet -} - -func (v *NullableTransportModeEnum) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableTransportModeEnum(val *TransportModeEnum) *NullableTransportModeEnum { - return &NullableTransportModeEnum{value: val, isSet: true} -} - -func (v NullableTransportModeEnum) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableTransportModeEnum) 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 deleted file mode 100644 index baa5017f4d..0000000000 --- a/packages/client-go/model_type_create.go +++ /dev/null @@ -1,373 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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 deleted file mode 100644 index fe117717b9..0000000000 --- a/packages/client-go/model_ui_theme_enum.go +++ /dev/null @@ -1,113 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.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 deleted file mode 100644 index 33c19f7c5a..0000000000 --- a/packages/client-go/model_unique_password_policy.go +++ /dev/null @@ -1,460 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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 deleted file mode 100644 index 3b1bc30091..0000000000 --- a/packages/client-go/model_unique_password_policy_request.go +++ /dev/null @@ -1,281 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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_usage_enum.go b/packages/client-go/model_usage_enum.go deleted file mode 100644 index dac2b56f92..0000000000 --- a/packages/client-go/model_usage_enum.go +++ /dev/null @@ -1,109 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: hello@goauthentik.io -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package api - -import ( - "encoding/json" - "fmt" -) - -// UsageEnum the model 'UsageEnum' -type UsageEnum string - -// List of UsageEnum -const ( - USAGEENUM_MEDIA UsageEnum = "media" -) - -// All allowed values of UsageEnum enum -var AllowedUsageEnumEnumValues = []UsageEnum{ - "media", -} - -func (v *UsageEnum) UnmarshalJSON(src []byte) error { - var value string - err := json.Unmarshal(src, &value) - if err != nil { - return err - } - enumTypeValue := UsageEnum(value) - for _, existing := range AllowedUsageEnumEnumValues { - if existing == enumTypeValue { - *v = enumTypeValue - return nil - } - } - - return fmt.Errorf("%+v is not a valid UsageEnum", value) -} - -// NewUsageEnumFromValue returns a pointer to a valid UsageEnum -// for the value passed as argument, or an error if the value passed is not allowed by the enum -func NewUsageEnumFromValue(v string) (*UsageEnum, error) { - ev := UsageEnum(v) - if ev.IsValid() { - return &ev, nil - } else { - return nil, fmt.Errorf("invalid value '%v' for UsageEnum: valid values are %v", v, AllowedUsageEnumEnumValues) - } -} - -// IsValid return true if the value is valid for the enum, false otherwise -func (v UsageEnum) IsValid() bool { - for _, existing := range AllowedUsageEnumEnumValues { - if existing == v { - return true - } - } - return false -} - -// Ptr returns reference to UsageEnum value -func (v UsageEnum) Ptr() *UsageEnum { - return &v -} - -type NullableUsageEnum struct { - value *UsageEnum - isSet bool -} - -func (v NullableUsageEnum) Get() *UsageEnum { - return v.value -} - -func (v *NullableUsageEnum) Set(val *UsageEnum) { - v.value = val - v.isSet = true -} - -func (v NullableUsageEnum) IsSet() bool { - return v.isSet -} - -func (v *NullableUsageEnum) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableUsageEnum(val *UsageEnum) *NullableUsageEnum { - return &NullableUsageEnum{value: val, isSet: true} -} - -func (v NullableUsageEnum) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableUsageEnum) 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 deleted file mode 100644 index d55e055161..0000000000 --- a/packages/client-go/model_used_by.go +++ /dev/null @@ -1,283 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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 deleted file mode 100644 index 4c37799f62..0000000000 --- a/packages/client-go/model_used_by_action_enum.go +++ /dev/null @@ -1,117 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.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_account_request.go b/packages/client-go/model_user_account_request.go deleted file mode 100644 index 180b121de9..0000000000 --- a/packages/client-go/model_user_account_request.go +++ /dev/null @@ -1,167 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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 deleted file mode 100644 index d920b5ebff..0000000000 --- a/packages/client-go/model_user_account_serializer_for_role_request.go +++ /dev/null @@ -1,167 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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 deleted file mode 100644 index 95dccb3af9..0000000000 --- a/packages/client-go/model_user_attribute_enum.go +++ /dev/null @@ -1,111 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.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 deleted file mode 100644 index 4f52124a57..0000000000 --- a/packages/client-go/model_user_consent.go +++ /dev/null @@ -1,352 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.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 deleted file mode 100644 index eca0d7e814..0000000000 --- a/packages/client-go/model_user_creation_mode_enum.go +++ /dev/null @@ -1,113 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.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 deleted file mode 100644 index 2eabfb5181..0000000000 --- a/packages/client-go/model_user_delete_stage.go +++ /dev/null @@ -1,345 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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 deleted file mode 100644 index c618c1a38a..0000000000 --- a/packages/client-go/model_user_delete_stage_request.go +++ /dev/null @@ -1,167 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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 deleted file mode 100644 index 84602e4159..0000000000 --- a/packages/client-go/model_user_fields_enum.go +++ /dev/null @@ -1,113 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.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 deleted file mode 100644 index a251ffafec..0000000000 --- a/packages/client-go/model_user_kerberos_source_connection.go +++ /dev/null @@ -1,342 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.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 deleted file mode 100644 index f54cfa662f..0000000000 --- a/packages/client-go/model_user_kerberos_source_connection_request.go +++ /dev/null @@ -1,225 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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 deleted file mode 100644 index d6a243420a..0000000000 --- a/packages/client-go/model_user_ldap_source_connection.go +++ /dev/null @@ -1,371 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.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"` - UserObj PartialUser `json:"user_obj"` - 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, userObj PartialUser) *UserLDAPSourceConnection { - this := UserLDAPSourceConnection{} - this.Pk = pk - this.User = user - this.Source = source - this.SourceObj = sourceObj - this.Identifier = identifier - this.Created = created - this.LastUpdated = lastUpdated - this.UserObj = userObj - 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 -} - -// GetUserObj returns the UserObj field value -func (o *UserLDAPSourceConnection) 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 *UserLDAPSourceConnection) GetUserObjOk() (*PartialUser, bool) { - if o == nil { - return nil, false - } - return &o.UserObj, true -} - -// SetUserObj sets field value -func (o *UserLDAPSourceConnection) SetUserObj(v PartialUser) { - o.UserObj = 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 - toSerialize["user_obj"] = o.UserObj - - 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", - "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) - } - } - - 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") - delete(additionalProperties, "user_obj") - 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 deleted file mode 100644 index 05f2768651..0000000000 --- a/packages/client-go/model_user_ldap_source_connection_request.go +++ /dev/null @@ -1,225 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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_stage.go b/packages/client-go/model_user_login_stage.go deleted file mode 100644 index 0b18c0ed63..0000000000 --- a/packages/client-go/model_user_login_stage.go +++ /dev/null @@ -1,573 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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 deleted file mode 100644 index 89ab790440..0000000000 --- a/packages/client-go/model_user_login_stage_request.go +++ /dev/null @@ -1,395 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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 deleted file mode 100644 index 8813806ade..0000000000 --- a/packages/client-go/model_user_logout_stage.go +++ /dev/null @@ -1,345 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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 deleted file mode 100644 index 3776634799..0000000000 --- a/packages/client-go/model_user_logout_stage_request.go +++ /dev/null @@ -1,167 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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 deleted file mode 100644 index ce345aad24..0000000000 --- a/packages/client-go/model_user_matching_mode_enum.go +++ /dev/null @@ -1,117 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.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 deleted file mode 100644 index f2a47763cb..0000000000 --- a/packages/client-go/model_user_o_auth_source_connection.go +++ /dev/null @@ -1,379 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.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 deleted file mode 100644 index e9738ca47c..0000000000 --- a/packages/client-go/model_user_o_auth_source_connection_request.go +++ /dev/null @@ -1,311 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.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 deleted file mode 100644 index 134d04fbff..0000000000 --- a/packages/client-go/model_user_password_set_request.go +++ /dev/null @@ -1,167 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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 deleted file mode 100644 index 9d3d03ee0e..0000000000 --- a/packages/client-go/model_user_path.go +++ /dev/null @@ -1,167 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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 deleted file mode 100644 index 14fd637bf2..0000000000 --- a/packages/client-go/model_user_plex_source_connection.go +++ /dev/null @@ -1,342 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.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 deleted file mode 100644 index 4641c24bf0..0000000000 --- a/packages/client-go/model_user_plex_source_connection_request.go +++ /dev/null @@ -1,254 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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 deleted file mode 100644 index 149a83a9e3..0000000000 --- a/packages/client-go/model_user_recovery_email_request.go +++ /dev/null @@ -1,204 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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 deleted file mode 100644 index a7bc788cbb..0000000000 --- a/packages/client-go/model_user_recovery_link_request.go +++ /dev/null @@ -1,154 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.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 deleted file mode 100644 index 02b9573bdf..0000000000 --- a/packages/client-go/model_user_request.go +++ /dev/null @@ -1,506 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.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 deleted file mode 100644 index 9c107f9cb5..0000000000 --- a/packages/client-go/model_user_saml_source_connection.go +++ /dev/null @@ -1,342 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.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 deleted file mode 100644 index 2717beec7d..0000000000 --- a/packages/client-go/model_user_saml_source_connection_request.go +++ /dev/null @@ -1,225 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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_service_account_request.go b/packages/client-go/model_user_service_account_request.go deleted file mode 100644 index cdc6bd8036..0000000000 --- a/packages/client-go/model_user_service_account_request.go +++ /dev/null @@ -1,288 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.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 deleted file mode 100644 index a78097f471..0000000000 --- a/packages/client-go/model_user_service_account_response.go +++ /dev/null @@ -1,291 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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 deleted file mode 100644 index 8b48c1e0c0..0000000000 --- a/packages/client-go/model_user_setting.go +++ /dev/null @@ -1,299 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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 deleted file mode 100644 index 12b00a5929..0000000000 --- a/packages/client-go/model_user_source_connection.go +++ /dev/null @@ -1,342 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.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 deleted file mode 100644 index c650287eff..0000000000 --- a/packages/client-go/model_user_source_connection_request.go +++ /dev/null @@ -1,225 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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 deleted file mode 100644 index a31d9e0b96..0000000000 --- a/packages/client-go/model_user_telegram_source_connection.go +++ /dev/null @@ -1,342 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.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 deleted file mode 100644 index 252d7f5568..0000000000 --- a/packages/client-go/model_user_telegram_source_connection_request.go +++ /dev/null @@ -1,225 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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_verification_enum.go b/packages/client-go/model_user_verification_enum.go deleted file mode 100644 index 6167bb1fb9..0000000000 --- a/packages/client-go/model_user_verification_enum.go +++ /dev/null @@ -1,113 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.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 deleted file mode 100644 index 1302db95dc..0000000000 --- a/packages/client-go/model_user_write_stage.go +++ /dev/null @@ -1,543 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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 deleted file mode 100644 index 80345ed545..0000000000 --- a/packages/client-go/model_user_write_stage_request.go +++ /dev/null @@ -1,365 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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_vendor_enum.go b/packages/client-go/model_vendor_enum.go deleted file mode 100644 index a3a8939fec..0000000000 --- a/packages/client-go/model_vendor_enum.go +++ /dev/null @@ -1,115 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.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 deleted file mode 100644 index 0f308d686e..0000000000 --- a/packages/client-go/model_version.go +++ /dev/null @@ -1,318 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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 deleted file mode 100644 index 32e0365041..0000000000 --- a/packages/client-go/model_version_history.go +++ /dev/null @@ -1,255 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.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 deleted file mode 100644 index a052ae1546..0000000000 --- a/packages/client-go/model_web_authn_device.go +++ /dev/null @@ -1,315 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.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 deleted file mode 100644 index e7d42fd1c6..0000000000 --- a/packages/client-go/model_web_authn_device_request.go +++ /dev/null @@ -1,167 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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 deleted file mode 100644 index 1392cdd0f9..0000000000 --- a/packages/client-go/model_web_authn_device_type.go +++ /dev/null @@ -1,196 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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 deleted file mode 100644 index 39736f9d31..0000000000 --- a/packages/client-go/model_web_authn_hint_enum.go +++ /dev/null @@ -1,113 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.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 deleted file mode 100644 index 854eb37440..0000000000 --- a/packages/client-go/model_worker.go +++ /dev/null @@ -1,225 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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 deleted file mode 100644 index 2afc01f5de..0000000000 --- a/packages/client-go/model_ws_federation_provider.go +++ /dev/null @@ -1,1203 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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 deleted file mode 100644 index 4fb993f585..0000000000 --- a/packages/client-go/model_ws_federation_provider_request.go +++ /dev/null @@ -1,866 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2026.5.0-rc1 -Contact: 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/operation_ids b/packages/client-go/operation_ids new file mode 100644 index 0000000000..af6fa9056a --- /dev/null +++ b/packages/client-go/operation_ids @@ -0,0 +1,18 @@ +core_brands_list +core_groups_list +core_users_list +core_users_me_retrieve +core_users_retrieve +crypto_certificatekeypairs_retrieve +crypto_certificatekeypairs_view_certificate_retrieve +crypto_certificatekeypairs_view_private_key_retrieve +events_events_create +flows_executor_get +flows_executor_solve +outposts_instances_list +outposts_ldap_access_check +outposts_ldap_list +outposts_proxy_list +outposts_radius_access_check +outposts_radius_list +root_config_retrieve diff --git a/packages/client-rust/.openapi-generator-ignore b/packages/client-rust/.openapi-generator-ignore index 12de6b7814..138548437f 100644 --- a/packages/client-rust/.openapi-generator-ignore +++ b/packages/client-rust/.openapi-generator-ignore @@ -1,7 +1,6 @@ Cargo.toml .gitignore .openapi-generator/** -docs/** git_push.sh .travis.yml README.md diff --git a/packages/client-rust/Cargo.toml b/packages/client-rust/Cargo.toml index 20939478b8..7fb8527bed 100644 --- a/packages/client-rust/Cargo.toml +++ b/packages/client-rust/Cargo.toml @@ -18,8 +18,6 @@ serde_json.workspace = true serde_repr.workspace = true url.workspace = true uuid.workspace = true -tokio.workspace = true -tokio-util.workspace = true reqwest.workspace = true reqwest-middleware.workspace = true rustls.workspace = true diff --git a/packages/client-rust/Makefile b/packages/client-rust/Makefile index 7dbcf8f2aa..2d11217b44 100644 --- a/packages/client-rust/Makefile +++ b/packages/client-rust/Makefile @@ -15,12 +15,13 @@ ifndef version $(error Usage: make build version=20xx.xx.xx) endif rm -rf "${PWD}/src" + "${PWD}/../../scripts/api_filter_schema.py" "${PWD}/../../schema.yml" "${PWD}/schema.yml" "${PWD}/operation_ids" docker compose run --rm --user "${UID}:${GID}" gen \ generate \ - -i /schema.yml \ + -i /local/schema.yml \ -g rust \ -o local \ -c /local/config.yaml \ --additional-properties=packageVersion=$(version) $(SED_INPLACE) 's/models::models::/models::/g' ${PWD}/src/apis/* - rm -rf "${PWD}/.openapi-generator" + rm -rf "${PWD}/.openapi-generator" "${PWD}/api/openapi.yaml" "${PWD}/schema.yml" diff --git a/packages/client-rust/compose.yml b/packages/client-rust/compose.yml index fd3ad5c8bb..c155090cd5 100644 --- a/packages/client-rust/compose.yml +++ b/packages/client-rust/compose.yml @@ -6,4 +6,3 @@ services: network_mode: none volumes: - ./:/local - - ../../schema.yml:/schema.yml:ro diff --git a/packages/client-rust/config.yaml b/packages/client-rust/config.yaml index 46aa72b843..4747127ff7 100644 --- a/packages/client-rust/config.yaml +++ b/packages/client-rust/config.yaml @@ -1,4 +1,12 @@ --- +globalProperties: + supportingFiles: "" + apis: "" + models: "" + apiDocs: false + apiTests: false + modelDocs: false + modelTests: false additionalProperties: packageName: authentik-client avoidBoxedModels: true diff --git a/packages/client-rust/operation_ids b/packages/client-rust/operation_ids new file mode 100644 index 0000000000..af6fa9056a --- /dev/null +++ b/packages/client-rust/operation_ids @@ -0,0 +1,18 @@ +core_brands_list +core_groups_list +core_users_list +core_users_me_retrieve +core_users_retrieve +crypto_certificatekeypairs_retrieve +crypto_certificatekeypairs_view_certificate_retrieve +crypto_certificatekeypairs_view_private_key_retrieve +events_events_create +flows_executor_get +flows_executor_solve +outposts_instances_list +outposts_ldap_access_check +outposts_ldap_list +outposts_proxy_list +outposts_radius_access_check +outposts_radius_list +root_config_retrieve diff --git a/packages/client-rust/src/apis/admin_api.rs b/packages/client-rust/src/apis/admin_api.rs deleted file mode 100644 index f4ae6a8a70..0000000000 --- a/packages/client-rust/src/apis/admin_api.rs +++ /dev/null @@ -1,949 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use reqwest; -use serde::{Deserialize, Serialize, de::Error as _}; -use tokio::fs::File as TokioFile; -use tokio_util::codec::{BytesCodec, FramedRead}; - -use super::{ContentType, Error, configuration}; -use crate::{apis::ResponseContent, models}; - -/// struct for typed errors of method [`admin_apps_list`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum AdminAppsListError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`admin_file_create`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum AdminFileCreateError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`admin_file_destroy`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum AdminFileDestroyError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`admin_file_list`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum AdminFileListError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`admin_file_used_by_list`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum AdminFileUsedByListError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`admin_models_list`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum AdminModelsListError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`admin_settings_partial_update`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum AdminSettingsPartialUpdateError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`admin_settings_retrieve`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum AdminSettingsRetrieveError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`admin_settings_update`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum AdminSettingsUpdateError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`admin_system_create`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum AdminSystemCreateError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`admin_system_retrieve`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum AdminSystemRetrieveError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`admin_version_history_list`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum AdminVersionHistoryListError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`admin_version_history_retrieve`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum AdminVersionHistoryRetrieveError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`admin_version_retrieve`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum AdminVersionRetrieveError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// Read-only view list all installed apps -pub async fn admin_apps_list( - configuration: &configuration::Configuration, -) -> Result, Error> { - let uri_str = format!("{}/admin/apps/", configuration.base_path); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `Vec<models::App>`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `Vec<models::App>`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Upload file to storage backend. -pub async fn admin_file_create( - configuration: &configuration::Configuration, - file: std::path::PathBuf, - name: Option<&str>, - usage: Option<&str>, -) -> Result<(), Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_form_file = file; - let p_form_name = name; - let p_form_usage = usage; - - let uri_str = format!("{}/admin/file/", configuration.base_path); - let mut req_builder = configuration - .client - .request(reqwest::Method::POST, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - let mut multipart_form = reqwest::multipart::Form::new(); - let file = TokioFile::open(&p_form_file).await?; - let stream = FramedRead::new(file, BytesCodec::new()); - let file_name = p_form_file - .file_name() - .map(|n| n.to_string_lossy().to_string()) - .unwrap_or_default(); - let file_part = - reqwest::multipart::Part::stream(reqwest::Body::wrap_stream(stream)).file_name(file_name); - multipart_form = multipart_form.part("file", file_part); - if let Some(param_value) = p_form_name { - multipart_form = multipart_form.text("name", param_value.to_string()); - } - if let Some(param_value) = p_form_usage { - multipart_form = multipart_form.text("usage", param_value.to_string()); - } - req_builder = req_builder.multipart(multipart_form); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - - if !status.is_client_error() && !status.is_server_error() { - Ok(()) - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Delete file from storage backend. -pub async fn admin_file_destroy( - configuration: &configuration::Configuration, - name: Option<&str>, - usage: Option, -) -> Result<(), Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_query_name = name; - let p_query_usage = usage; - - let uri_str = format!("{}/admin/file/", configuration.base_path); - let mut req_builder = configuration - .client - .request(reqwest::Method::DELETE, &uri_str); - - if let Some(ref param_value) = p_query_name { - req_builder = req_builder.query(&[("name", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_usage { - req_builder = req_builder.query(&[("usage", ¶m_value.to_string())]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - - if !status.is_client_error() && !status.is_server_error() { - Ok(()) - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// List files from storage backend. -pub async fn admin_file_list( - configuration: &configuration::Configuration, - manageable_only: Option, - search: Option<&str>, - usage: Option, -) -> Result, Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_query_manageable_only = manageable_only; - let p_query_search = search; - let p_query_usage = usage; - - let uri_str = format!("{}/admin/file/", configuration.base_path); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref param_value) = p_query_manageable_only { - req_builder = req_builder.query(&[("manageable_only", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_search { - req_builder = req_builder.query(&[("search", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_usage { - req_builder = req_builder.query(&[("usage", ¶m_value.to_string())]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `Vec<models::FileList>`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `Vec<models::FileList>`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -pub async fn admin_file_used_by_list( - configuration: &configuration::Configuration, - name: Option<&str>, -) -> Result, Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_query_name = name; - - let uri_str = format!("{}/admin/file/used_by/", configuration.base_path); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref param_value) = p_query_name { - req_builder = req_builder.query(&[("name", ¶m_value.to_string())]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `Vec<models::UsedBy>`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `Vec<models::UsedBy>`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Read-only view list all installed models -pub async fn admin_models_list( - configuration: &configuration::Configuration, -) -> Result, Error> { - let uri_str = format!("{}/admin/models/", configuration.base_path); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `Vec<models::App>`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `Vec<models::App>`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Settings view -pub async fn admin_settings_partial_update( - configuration: &configuration::Configuration, - patched_settings_request: Option, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_body_patched_settings_request = patched_settings_request; - - let uri_str = format!("{}/admin/settings/", configuration.base_path); - let mut req_builder = configuration - .client - .request(reqwest::Method::PATCH, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - req_builder = req_builder.json(&p_body_patched_settings_request); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::Settings`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::Settings`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Settings view -pub async fn admin_settings_retrieve( - configuration: &configuration::Configuration, -) -> Result> { - let uri_str = format!("{}/admin/settings/", configuration.base_path); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::Settings`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::Settings`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Settings view -pub async fn admin_settings_update( - configuration: &configuration::Configuration, - settings_request: models::SettingsRequest, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_body_settings_request = settings_request; - - let uri_str = format!("{}/admin/settings/", configuration.base_path); - let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - req_builder = req_builder.json(&p_body_settings_request); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::Settings`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::Settings`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Get system information. -pub async fn admin_system_create( - configuration: &configuration::Configuration, -) -> Result> { - let uri_str = format!("{}/admin/system/", configuration.base_path); - let mut req_builder = configuration - .client - .request(reqwest::Method::POST, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::SystemInfo`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::SystemInfo`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Get system information. -pub async fn admin_system_retrieve( - configuration: &configuration::Configuration, -) -> Result> { - let uri_str = format!("{}/admin/system/", configuration.base_path); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::SystemInfo`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::SystemInfo`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// VersionHistory Viewset -pub async fn admin_version_history_list( - configuration: &configuration::Configuration, - build: Option<&str>, - ordering: Option<&str>, - search: Option<&str>, - version: Option<&str>, -) -> Result, Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_query_build = build; - let p_query_ordering = ordering; - let p_query_search = search; - let p_query_version = version; - - let uri_str = format!("{}/admin/version/history/", configuration.base_path); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref param_value) = p_query_build { - req_builder = req_builder.query(&[("build", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_ordering { - req_builder = req_builder.query(&[("ordering", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_search { - req_builder = req_builder.query(&[("search", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_version { - req_builder = req_builder.query(&[("version", ¶m_value.to_string())]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `Vec<models::VersionHistory>`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `Vec<models::VersionHistory>`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// VersionHistory Viewset -pub async fn admin_version_history_retrieve( - configuration: &configuration::Configuration, - id: i32, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_id = id; - - let uri_str = format!( - "{}/admin/version/history/{id}/", - configuration.base_path, - id = p_path_id - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::VersionHistory`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::VersionHistory`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Get running and latest version. -pub async fn admin_version_retrieve( - configuration: &configuration::Configuration, -) -> Result> { - let uri_str = format!("{}/admin/version/", configuration.base_path); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::Version`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::Version`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} diff --git a/packages/client-rust/src/apis/authenticators_api.rs b/packages/client-rust/src/apis/authenticators_api.rs deleted file mode 100644 index ad64510260..0000000000 --- a/packages/client-rust/src/apis/authenticators_api.rs +++ /dev/null @@ -1,5978 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use reqwest; -use serde::{Deserialize, Serialize, de::Error as _}; - -use super::{ContentType, Error, configuration}; -use crate::{apis::ResponseContent, models}; - -/// struct for typed errors of method [`authenticators_admin_all_list`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum AuthenticatorsAdminAllListError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`authenticators_admin_duo_create`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum AuthenticatorsAdminDuoCreateError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`authenticators_admin_duo_destroy`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum AuthenticatorsAdminDuoDestroyError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`authenticators_admin_duo_list`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum AuthenticatorsAdminDuoListError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`authenticators_admin_duo_partial_update`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum AuthenticatorsAdminDuoPartialUpdateError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`authenticators_admin_duo_retrieve`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum AuthenticatorsAdminDuoRetrieveError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`authenticators_admin_duo_update`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum AuthenticatorsAdminDuoUpdateError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`authenticators_admin_email_create`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum AuthenticatorsAdminEmailCreateError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`authenticators_admin_email_destroy`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum AuthenticatorsAdminEmailDestroyError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`authenticators_admin_email_list`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum AuthenticatorsAdminEmailListError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`authenticators_admin_email_partial_update`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum AuthenticatorsAdminEmailPartialUpdateError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`authenticators_admin_email_retrieve`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum AuthenticatorsAdminEmailRetrieveError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`authenticators_admin_email_update`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum AuthenticatorsAdminEmailUpdateError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`authenticators_admin_endpoint_create`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum AuthenticatorsAdminEndpointCreateError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`authenticators_admin_endpoint_destroy`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum AuthenticatorsAdminEndpointDestroyError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`authenticators_admin_endpoint_list`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum AuthenticatorsAdminEndpointListError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`authenticators_admin_endpoint_partial_update`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum AuthenticatorsAdminEndpointPartialUpdateError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`authenticators_admin_endpoint_retrieve`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum AuthenticatorsAdminEndpointRetrieveError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`authenticators_admin_endpoint_update`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum AuthenticatorsAdminEndpointUpdateError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`authenticators_admin_sms_create`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum AuthenticatorsAdminSmsCreateError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`authenticators_admin_sms_destroy`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum AuthenticatorsAdminSmsDestroyError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`authenticators_admin_sms_list`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum AuthenticatorsAdminSmsListError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`authenticators_admin_sms_partial_update`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum AuthenticatorsAdminSmsPartialUpdateError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`authenticators_admin_sms_retrieve`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum AuthenticatorsAdminSmsRetrieveError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`authenticators_admin_sms_update`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum AuthenticatorsAdminSmsUpdateError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`authenticators_admin_static_create`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum AuthenticatorsAdminStaticCreateError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`authenticators_admin_static_destroy`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum AuthenticatorsAdminStaticDestroyError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`authenticators_admin_static_list`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum AuthenticatorsAdminStaticListError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`authenticators_admin_static_partial_update`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum AuthenticatorsAdminStaticPartialUpdateError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`authenticators_admin_static_retrieve`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum AuthenticatorsAdminStaticRetrieveError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`authenticators_admin_static_update`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum AuthenticatorsAdminStaticUpdateError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`authenticators_admin_totp_create`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum AuthenticatorsAdminTotpCreateError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`authenticators_admin_totp_destroy`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum AuthenticatorsAdminTotpDestroyError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`authenticators_admin_totp_list`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum AuthenticatorsAdminTotpListError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`authenticators_admin_totp_partial_update`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum AuthenticatorsAdminTotpPartialUpdateError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`authenticators_admin_totp_retrieve`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum AuthenticatorsAdminTotpRetrieveError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`authenticators_admin_totp_update`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum AuthenticatorsAdminTotpUpdateError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`authenticators_admin_webauthn_create`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum AuthenticatorsAdminWebauthnCreateError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`authenticators_admin_webauthn_destroy`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum AuthenticatorsAdminWebauthnDestroyError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`authenticators_admin_webauthn_list`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum AuthenticatorsAdminWebauthnListError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`authenticators_admin_webauthn_partial_update`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum AuthenticatorsAdminWebauthnPartialUpdateError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`authenticators_admin_webauthn_retrieve`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum AuthenticatorsAdminWebauthnRetrieveError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`authenticators_admin_webauthn_update`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum AuthenticatorsAdminWebauthnUpdateError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`authenticators_all_list`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum AuthenticatorsAllListError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`authenticators_duo_destroy`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum AuthenticatorsDuoDestroyError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`authenticators_duo_list`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum AuthenticatorsDuoListError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`authenticators_duo_partial_update`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum AuthenticatorsDuoPartialUpdateError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`authenticators_duo_retrieve`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum AuthenticatorsDuoRetrieveError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`authenticators_duo_update`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum AuthenticatorsDuoUpdateError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`authenticators_duo_used_by_list`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum AuthenticatorsDuoUsedByListError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`authenticators_email_destroy`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum AuthenticatorsEmailDestroyError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`authenticators_email_list`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum AuthenticatorsEmailListError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`authenticators_email_partial_update`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum AuthenticatorsEmailPartialUpdateError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`authenticators_email_retrieve`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum AuthenticatorsEmailRetrieveError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`authenticators_email_update`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum AuthenticatorsEmailUpdateError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`authenticators_email_used_by_list`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum AuthenticatorsEmailUsedByListError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`authenticators_endpoint_list`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum AuthenticatorsEndpointListError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`authenticators_endpoint_retrieve`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum AuthenticatorsEndpointRetrieveError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`authenticators_endpoint_used_by_list`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum AuthenticatorsEndpointUsedByListError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`authenticators_sms_destroy`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum AuthenticatorsSmsDestroyError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`authenticators_sms_list`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum AuthenticatorsSmsListError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`authenticators_sms_partial_update`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum AuthenticatorsSmsPartialUpdateError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`authenticators_sms_retrieve`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum AuthenticatorsSmsRetrieveError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`authenticators_sms_update`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum AuthenticatorsSmsUpdateError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`authenticators_sms_used_by_list`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum AuthenticatorsSmsUsedByListError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`authenticators_static_destroy`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum AuthenticatorsStaticDestroyError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`authenticators_static_list`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum AuthenticatorsStaticListError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`authenticators_static_partial_update`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum AuthenticatorsStaticPartialUpdateError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`authenticators_static_retrieve`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum AuthenticatorsStaticRetrieveError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`authenticators_static_update`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum AuthenticatorsStaticUpdateError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`authenticators_static_used_by_list`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum AuthenticatorsStaticUsedByListError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`authenticators_totp_destroy`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum AuthenticatorsTotpDestroyError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`authenticators_totp_list`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum AuthenticatorsTotpListError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`authenticators_totp_partial_update`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum AuthenticatorsTotpPartialUpdateError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`authenticators_totp_retrieve`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum AuthenticatorsTotpRetrieveError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`authenticators_totp_update`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum AuthenticatorsTotpUpdateError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`authenticators_totp_used_by_list`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum AuthenticatorsTotpUsedByListError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`authenticators_webauthn_destroy`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum AuthenticatorsWebauthnDestroyError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`authenticators_webauthn_list`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum AuthenticatorsWebauthnListError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`authenticators_webauthn_partial_update`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum AuthenticatorsWebauthnPartialUpdateError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`authenticators_webauthn_retrieve`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum AuthenticatorsWebauthnRetrieveError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`authenticators_webauthn_update`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum AuthenticatorsWebauthnUpdateError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`authenticators_webauthn_used_by_list`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum AuthenticatorsWebauthnUsedByListError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// Get all devices for current user -pub async fn authenticators_admin_all_list( - configuration: &configuration::Configuration, - user: Option, -) -> Result, Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_query_user = user; - - let uri_str = format!("{}/authenticators/admin/all/", configuration.base_path); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref param_value) = p_query_user { - req_builder = req_builder.query(&[("user", ¶m_value.to_string())]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `Vec<models::Device>`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `Vec<models::Device>`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Viewset for Duo authenticator devices (for admins) -pub async fn authenticators_admin_duo_create( - configuration: &configuration::Configuration, - duo_device_request: models::DuoDeviceRequest, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_body_duo_device_request = duo_device_request; - - let uri_str = format!("{}/authenticators/admin/duo/", configuration.base_path); - let mut req_builder = configuration - .client - .request(reqwest::Method::POST, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - req_builder = req_builder.json(&p_body_duo_device_request); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::DuoDevice`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::DuoDevice`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Viewset for Duo authenticator devices (for admins) -pub async fn authenticators_admin_duo_destroy( - configuration: &configuration::Configuration, - id: i32, -) -> Result<(), Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_id = id; - - let uri_str = format!( - "{}/authenticators/admin/duo/{id}/", - configuration.base_path, - id = p_path_id - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::DELETE, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - - if !status.is_client_error() && !status.is_server_error() { - Ok(()) - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Viewset for Duo authenticator devices (for admins) -pub async fn authenticators_admin_duo_list( - configuration: &configuration::Configuration, - name: Option<&str>, - ordering: Option<&str>, - page: Option, - page_size: Option, - search: Option<&str>, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_query_name = name; - let p_query_ordering = ordering; - let p_query_page = page; - let p_query_page_size = page_size; - let p_query_search = search; - - let uri_str = format!("{}/authenticators/admin/duo/", configuration.base_path); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref param_value) = p_query_name { - req_builder = req_builder.query(&[("name", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_ordering { - req_builder = req_builder.query(&[("ordering", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_page { - req_builder = req_builder.query(&[("page", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_page_size { - req_builder = req_builder.query(&[("page_size", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_search { - req_builder = req_builder.query(&[("search", ¶m_value.to_string())]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::PaginatedDuoDeviceList`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::PaginatedDuoDeviceList`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Viewset for Duo authenticator devices (for admins) -pub async fn authenticators_admin_duo_partial_update( - configuration: &configuration::Configuration, - id: i32, - patched_duo_device_request: Option, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_id = id; - let p_body_patched_duo_device_request = patched_duo_device_request; - - let uri_str = format!( - "{}/authenticators/admin/duo/{id}/", - configuration.base_path, - id = p_path_id - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::PATCH, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - req_builder = req_builder.json(&p_body_patched_duo_device_request); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::DuoDevice`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::DuoDevice`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Viewset for Duo authenticator devices (for admins) -pub async fn authenticators_admin_duo_retrieve( - configuration: &configuration::Configuration, - id: i32, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_id = id; - - let uri_str = format!( - "{}/authenticators/admin/duo/{id}/", - configuration.base_path, - id = p_path_id - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::DuoDevice`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::DuoDevice`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Viewset for Duo authenticator devices (for admins) -pub async fn authenticators_admin_duo_update( - configuration: &configuration::Configuration, - id: i32, - duo_device_request: models::DuoDeviceRequest, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_id = id; - let p_body_duo_device_request = duo_device_request; - - let uri_str = format!( - "{}/authenticators/admin/duo/{id}/", - configuration.base_path, - id = p_path_id - ); - let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - req_builder = req_builder.json(&p_body_duo_device_request); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::DuoDevice`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::DuoDevice`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Viewset for email authenticator devices (for admins) -pub async fn authenticators_admin_email_create( - configuration: &configuration::Configuration, - email_device_request: models::EmailDeviceRequest, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_body_email_device_request = email_device_request; - - let uri_str = format!("{}/authenticators/admin/email/", configuration.base_path); - let mut req_builder = configuration - .client - .request(reqwest::Method::POST, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - req_builder = req_builder.json(&p_body_email_device_request); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::EmailDevice`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::EmailDevice`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Viewset for email authenticator devices (for admins) -pub async fn authenticators_admin_email_destroy( - configuration: &configuration::Configuration, - id: i32, -) -> Result<(), Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_id = id; - - let uri_str = format!( - "{}/authenticators/admin/email/{id}/", - configuration.base_path, - id = p_path_id - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::DELETE, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - - if !status.is_client_error() && !status.is_server_error() { - Ok(()) - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Viewset for email authenticator devices (for admins) -pub async fn authenticators_admin_email_list( - configuration: &configuration::Configuration, - name: Option<&str>, - ordering: Option<&str>, - page: Option, - page_size: Option, - search: Option<&str>, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_query_name = name; - let p_query_ordering = ordering; - let p_query_page = page; - let p_query_page_size = page_size; - let p_query_search = search; - - let uri_str = format!("{}/authenticators/admin/email/", configuration.base_path); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref param_value) = p_query_name { - req_builder = req_builder.query(&[("name", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_ordering { - req_builder = req_builder.query(&[("ordering", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_page { - req_builder = req_builder.query(&[("page", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_page_size { - req_builder = req_builder.query(&[("page_size", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_search { - req_builder = req_builder.query(&[("search", ¶m_value.to_string())]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::PaginatedEmailDeviceList`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::PaginatedEmailDeviceList`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Viewset for email authenticator devices (for admins) -pub async fn authenticators_admin_email_partial_update( - configuration: &configuration::Configuration, - id: i32, - patched_email_device_request: Option, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_id = id; - let p_body_patched_email_device_request = patched_email_device_request; - - let uri_str = format!( - "{}/authenticators/admin/email/{id}/", - configuration.base_path, - id = p_path_id - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::PATCH, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - req_builder = req_builder.json(&p_body_patched_email_device_request); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::EmailDevice`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::EmailDevice`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Viewset for email authenticator devices (for admins) -pub async fn authenticators_admin_email_retrieve( - configuration: &configuration::Configuration, - id: i32, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_id = id; - - let uri_str = format!( - "{}/authenticators/admin/email/{id}/", - configuration.base_path, - id = p_path_id - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::EmailDevice`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::EmailDevice`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Viewset for email authenticator devices (for admins) -pub async fn authenticators_admin_email_update( - configuration: &configuration::Configuration, - id: i32, - email_device_request: models::EmailDeviceRequest, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_id = id; - let p_body_email_device_request = email_device_request; - - let uri_str = format!( - "{}/authenticators/admin/email/{id}/", - configuration.base_path, - id = p_path_id - ); - let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - req_builder = req_builder.json(&p_body_email_device_request); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::EmailDevice`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::EmailDevice`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Viewset for Endpoint authenticator devices (for admins) -pub async fn authenticators_admin_endpoint_create( - configuration: &configuration::Configuration, - google_endpoint_device_request: models::GoogleEndpointDeviceRequest, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_body_google_endpoint_device_request = google_endpoint_device_request; - - let uri_str = format!("{}/authenticators/admin/endpoint/", configuration.base_path); - let mut req_builder = configuration - .client - .request(reqwest::Method::POST, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - req_builder = req_builder.json(&p_body_google_endpoint_device_request); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::GoogleEndpointDevice`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::GoogleEndpointDevice`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Viewset for Endpoint authenticator devices (for admins) -pub async fn authenticators_admin_endpoint_destroy( - configuration: &configuration::Configuration, - uuid: &str, -) -> Result<(), Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_uuid = uuid; - - let uri_str = format!( - "{}/authenticators/admin/endpoint/{uuid}/", - configuration.base_path, - uuid = crate::apis::urlencode(p_path_uuid) - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::DELETE, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - - if !status.is_client_error() && !status.is_server_error() { - Ok(()) - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Viewset for Endpoint authenticator devices (for admins) -pub async fn authenticators_admin_endpoint_list( - configuration: &configuration::Configuration, - name: Option<&str>, - ordering: Option<&str>, - page: Option, - page_size: Option, - search: Option<&str>, -) -> Result> -{ - // add a prefix to parameters to efficiently prevent name collisions - let p_query_name = name; - let p_query_ordering = ordering; - let p_query_page = page; - let p_query_page_size = page_size; - let p_query_search = search; - - let uri_str = format!("{}/authenticators/admin/endpoint/", configuration.base_path); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref param_value) = p_query_name { - req_builder = req_builder.query(&[("name", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_ordering { - req_builder = req_builder.query(&[("ordering", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_page { - req_builder = req_builder.query(&[("page", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_page_size { - req_builder = req_builder.query(&[("page_size", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_search { - req_builder = req_builder.query(&[("search", ¶m_value.to_string())]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::PaginatedGoogleEndpointDeviceList`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::PaginatedGoogleEndpointDeviceList`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Viewset for Endpoint authenticator devices (for admins) -pub async fn authenticators_admin_endpoint_partial_update( - configuration: &configuration::Configuration, - uuid: &str, - patched_google_endpoint_device_request: Option, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_uuid = uuid; - let p_body_patched_google_endpoint_device_request = patched_google_endpoint_device_request; - - let uri_str = format!( - "{}/authenticators/admin/endpoint/{uuid}/", - configuration.base_path, - uuid = crate::apis::urlencode(p_path_uuid) - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::PATCH, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - req_builder = req_builder.json(&p_body_patched_google_endpoint_device_request); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::GoogleEndpointDevice`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::GoogleEndpointDevice`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Viewset for Endpoint authenticator devices (for admins) -pub async fn authenticators_admin_endpoint_retrieve( - configuration: &configuration::Configuration, - uuid: &str, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_uuid = uuid; - - let uri_str = format!( - "{}/authenticators/admin/endpoint/{uuid}/", - configuration.base_path, - uuid = crate::apis::urlencode(p_path_uuid) - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::GoogleEndpointDevice`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::GoogleEndpointDevice`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Viewset for Endpoint authenticator devices (for admins) -pub async fn authenticators_admin_endpoint_update( - configuration: &configuration::Configuration, - uuid: &str, - google_endpoint_device_request: models::GoogleEndpointDeviceRequest, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_uuid = uuid; - let p_body_google_endpoint_device_request = google_endpoint_device_request; - - let uri_str = format!( - "{}/authenticators/admin/endpoint/{uuid}/", - configuration.base_path, - uuid = crate::apis::urlencode(p_path_uuid) - ); - let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - req_builder = req_builder.json(&p_body_google_endpoint_device_request); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::GoogleEndpointDevice`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::GoogleEndpointDevice`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Viewset for sms authenticator devices (for admins) -pub async fn authenticators_admin_sms_create( - configuration: &configuration::Configuration, - sms_device_request: models::SmsDeviceRequest, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_body_sms_device_request = sms_device_request; - - let uri_str = format!("{}/authenticators/admin/sms/", configuration.base_path); - let mut req_builder = configuration - .client - .request(reqwest::Method::POST, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - req_builder = req_builder.json(&p_body_sms_device_request); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::SmsDevice`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::SmsDevice`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Viewset for sms authenticator devices (for admins) -pub async fn authenticators_admin_sms_destroy( - configuration: &configuration::Configuration, - id: i32, -) -> Result<(), Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_id = id; - - let uri_str = format!( - "{}/authenticators/admin/sms/{id}/", - configuration.base_path, - id = p_path_id - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::DELETE, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - - if !status.is_client_error() && !status.is_server_error() { - Ok(()) - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Viewset for sms authenticator devices (for admins) -pub async fn authenticators_admin_sms_list( - configuration: &configuration::Configuration, - name: Option<&str>, - ordering: Option<&str>, - page: Option, - page_size: Option, - search: Option<&str>, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_query_name = name; - let p_query_ordering = ordering; - let p_query_page = page; - let p_query_page_size = page_size; - let p_query_search = search; - - let uri_str = format!("{}/authenticators/admin/sms/", configuration.base_path); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref param_value) = p_query_name { - req_builder = req_builder.query(&[("name", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_ordering { - req_builder = req_builder.query(&[("ordering", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_page { - req_builder = req_builder.query(&[("page", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_page_size { - req_builder = req_builder.query(&[("page_size", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_search { - req_builder = req_builder.query(&[("search", ¶m_value.to_string())]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::PaginatedSmsDeviceList`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::PaginatedSmsDeviceList`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Viewset for sms authenticator devices (for admins) -pub async fn authenticators_admin_sms_partial_update( - configuration: &configuration::Configuration, - id: i32, - patched_sms_device_request: Option, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_id = id; - let p_body_patched_sms_device_request = patched_sms_device_request; - - let uri_str = format!( - "{}/authenticators/admin/sms/{id}/", - configuration.base_path, - id = p_path_id - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::PATCH, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - req_builder = req_builder.json(&p_body_patched_sms_device_request); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::SmsDevice`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::SmsDevice`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Viewset for sms authenticator devices (for admins) -pub async fn authenticators_admin_sms_retrieve( - configuration: &configuration::Configuration, - id: i32, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_id = id; - - let uri_str = format!( - "{}/authenticators/admin/sms/{id}/", - configuration.base_path, - id = p_path_id - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::SmsDevice`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::SmsDevice`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Viewset for sms authenticator devices (for admins) -pub async fn authenticators_admin_sms_update( - configuration: &configuration::Configuration, - id: i32, - sms_device_request: models::SmsDeviceRequest, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_id = id; - let p_body_sms_device_request = sms_device_request; - - let uri_str = format!( - "{}/authenticators/admin/sms/{id}/", - configuration.base_path, - id = p_path_id - ); - let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - req_builder = req_builder.json(&p_body_sms_device_request); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::SmsDevice`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::SmsDevice`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Viewset for static authenticator devices (for admins) -pub async fn authenticators_admin_static_create( - configuration: &configuration::Configuration, - static_device_request: models::StaticDeviceRequest, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_body_static_device_request = static_device_request; - - let uri_str = format!("{}/authenticators/admin/static/", configuration.base_path); - let mut req_builder = configuration - .client - .request(reqwest::Method::POST, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - req_builder = req_builder.json(&p_body_static_device_request); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::StaticDevice`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::StaticDevice`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Viewset for static authenticator devices (for admins) -pub async fn authenticators_admin_static_destroy( - configuration: &configuration::Configuration, - id: i32, -) -> Result<(), Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_id = id; - - let uri_str = format!( - "{}/authenticators/admin/static/{id}/", - configuration.base_path, - id = p_path_id - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::DELETE, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - - if !status.is_client_error() && !status.is_server_error() { - Ok(()) - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Viewset for static authenticator devices (for admins) -pub async fn authenticators_admin_static_list( - configuration: &configuration::Configuration, - name: Option<&str>, - ordering: Option<&str>, - page: Option, - page_size: Option, - search: Option<&str>, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_query_name = name; - let p_query_ordering = ordering; - let p_query_page = page; - let p_query_page_size = page_size; - let p_query_search = search; - - let uri_str = format!("{}/authenticators/admin/static/", configuration.base_path); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref param_value) = p_query_name { - req_builder = req_builder.query(&[("name", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_ordering { - req_builder = req_builder.query(&[("ordering", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_page { - req_builder = req_builder.query(&[("page", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_page_size { - req_builder = req_builder.query(&[("page_size", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_search { - req_builder = req_builder.query(&[("search", ¶m_value.to_string())]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::PaginatedStaticDeviceList`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::PaginatedStaticDeviceList`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Viewset for static authenticator devices (for admins) -pub async fn authenticators_admin_static_partial_update( - configuration: &configuration::Configuration, - id: i32, - patched_static_device_request: Option, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_id = id; - let p_body_patched_static_device_request = patched_static_device_request; - - let uri_str = format!( - "{}/authenticators/admin/static/{id}/", - configuration.base_path, - id = p_path_id - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::PATCH, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - req_builder = req_builder.json(&p_body_patched_static_device_request); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::StaticDevice`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::StaticDevice`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Viewset for static authenticator devices (for admins) -pub async fn authenticators_admin_static_retrieve( - configuration: &configuration::Configuration, - id: i32, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_id = id; - - let uri_str = format!( - "{}/authenticators/admin/static/{id}/", - configuration.base_path, - id = p_path_id - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::StaticDevice`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::StaticDevice`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Viewset for static authenticator devices (for admins) -pub async fn authenticators_admin_static_update( - configuration: &configuration::Configuration, - id: i32, - static_device_request: models::StaticDeviceRequest, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_id = id; - let p_body_static_device_request = static_device_request; - - let uri_str = format!( - "{}/authenticators/admin/static/{id}/", - configuration.base_path, - id = p_path_id - ); - let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - req_builder = req_builder.json(&p_body_static_device_request); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::StaticDevice`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::StaticDevice`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Viewset for totp authenticator devices (for admins) -pub async fn authenticators_admin_totp_create( - configuration: &configuration::Configuration, - totp_device_request: models::TotpDeviceRequest, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_body_totp_device_request = totp_device_request; - - let uri_str = format!("{}/authenticators/admin/totp/", configuration.base_path); - let mut req_builder = configuration - .client - .request(reqwest::Method::POST, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - req_builder = req_builder.json(&p_body_totp_device_request); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::TotpDevice`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::TotpDevice`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Viewset for totp authenticator devices (for admins) -pub async fn authenticators_admin_totp_destroy( - configuration: &configuration::Configuration, - id: i32, -) -> Result<(), Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_id = id; - - let uri_str = format!( - "{}/authenticators/admin/totp/{id}/", - configuration.base_path, - id = p_path_id - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::DELETE, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - - if !status.is_client_error() && !status.is_server_error() { - Ok(()) - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Viewset for totp authenticator devices (for admins) -pub async fn authenticators_admin_totp_list( - configuration: &configuration::Configuration, - name: Option<&str>, - ordering: Option<&str>, - page: Option, - page_size: Option, - search: Option<&str>, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_query_name = name; - let p_query_ordering = ordering; - let p_query_page = page; - let p_query_page_size = page_size; - let p_query_search = search; - - let uri_str = format!("{}/authenticators/admin/totp/", configuration.base_path); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref param_value) = p_query_name { - req_builder = req_builder.query(&[("name", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_ordering { - req_builder = req_builder.query(&[("ordering", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_page { - req_builder = req_builder.query(&[("page", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_page_size { - req_builder = req_builder.query(&[("page_size", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_search { - req_builder = req_builder.query(&[("search", ¶m_value.to_string())]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::PaginatedTotpDeviceList`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::PaginatedTotpDeviceList`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Viewset for totp authenticator devices (for admins) -pub async fn authenticators_admin_totp_partial_update( - configuration: &configuration::Configuration, - id: i32, - patched_totp_device_request: Option, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_id = id; - let p_body_patched_totp_device_request = patched_totp_device_request; - - let uri_str = format!( - "{}/authenticators/admin/totp/{id}/", - configuration.base_path, - id = p_path_id - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::PATCH, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - req_builder = req_builder.json(&p_body_patched_totp_device_request); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::TotpDevice`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::TotpDevice`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Viewset for totp authenticator devices (for admins) -pub async fn authenticators_admin_totp_retrieve( - configuration: &configuration::Configuration, - id: i32, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_id = id; - - let uri_str = format!( - "{}/authenticators/admin/totp/{id}/", - configuration.base_path, - id = p_path_id - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::TotpDevice`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::TotpDevice`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Viewset for totp authenticator devices (for admins) -pub async fn authenticators_admin_totp_update( - configuration: &configuration::Configuration, - id: i32, - totp_device_request: models::TotpDeviceRequest, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_id = id; - let p_body_totp_device_request = totp_device_request; - - let uri_str = format!( - "{}/authenticators/admin/totp/{id}/", - configuration.base_path, - id = p_path_id - ); - let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - req_builder = req_builder.json(&p_body_totp_device_request); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::TotpDevice`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::TotpDevice`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Viewset for WebAuthn authenticator devices (for admins) -pub async fn authenticators_admin_webauthn_create( - configuration: &configuration::Configuration, - web_authn_device_request: models::WebAuthnDeviceRequest, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_body_web_authn_device_request = web_authn_device_request; - - let uri_str = format!("{}/authenticators/admin/webauthn/", configuration.base_path); - let mut req_builder = configuration - .client - .request(reqwest::Method::POST, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - req_builder = req_builder.json(&p_body_web_authn_device_request); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::WebAuthnDevice`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::WebAuthnDevice`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Viewset for WebAuthn authenticator devices (for admins) -pub async fn authenticators_admin_webauthn_destroy( - configuration: &configuration::Configuration, - id: i32, -) -> Result<(), Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_id = id; - - let uri_str = format!( - "{}/authenticators/admin/webauthn/{id}/", - configuration.base_path, - id = p_path_id - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::DELETE, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - - if !status.is_client_error() && !status.is_server_error() { - Ok(()) - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Viewset for WebAuthn authenticator devices (for admins) -pub async fn authenticators_admin_webauthn_list( - configuration: &configuration::Configuration, - name: Option<&str>, - ordering: Option<&str>, - page: Option, - page_size: Option, - search: Option<&str>, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_query_name = name; - let p_query_ordering = ordering; - let p_query_page = page; - let p_query_page_size = page_size; - let p_query_search = search; - - let uri_str = format!("{}/authenticators/admin/webauthn/", configuration.base_path); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref param_value) = p_query_name { - req_builder = req_builder.query(&[("name", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_ordering { - req_builder = req_builder.query(&[("ordering", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_page { - req_builder = req_builder.query(&[("page", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_page_size { - req_builder = req_builder.query(&[("page_size", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_search { - req_builder = req_builder.query(&[("search", ¶m_value.to_string())]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::PaginatedWebAuthnDeviceList`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::PaginatedWebAuthnDeviceList`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Viewset for WebAuthn authenticator devices (for admins) -pub async fn authenticators_admin_webauthn_partial_update( - configuration: &configuration::Configuration, - id: i32, - patched_web_authn_device_request: Option, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_id = id; - let p_body_patched_web_authn_device_request = patched_web_authn_device_request; - - let uri_str = format!( - "{}/authenticators/admin/webauthn/{id}/", - configuration.base_path, - id = p_path_id - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::PATCH, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - req_builder = req_builder.json(&p_body_patched_web_authn_device_request); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::WebAuthnDevice`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::WebAuthnDevice`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Viewset for WebAuthn authenticator devices (for admins) -pub async fn authenticators_admin_webauthn_retrieve( - configuration: &configuration::Configuration, - id: i32, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_id = id; - - let uri_str = format!( - "{}/authenticators/admin/webauthn/{id}/", - configuration.base_path, - id = p_path_id - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::WebAuthnDevice`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::WebAuthnDevice`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Viewset for WebAuthn authenticator devices (for admins) -pub async fn authenticators_admin_webauthn_update( - configuration: &configuration::Configuration, - id: i32, - web_authn_device_request: models::WebAuthnDeviceRequest, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_id = id; - let p_body_web_authn_device_request = web_authn_device_request; - - let uri_str = format!( - "{}/authenticators/admin/webauthn/{id}/", - configuration.base_path, - id = p_path_id - ); - let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - req_builder = req_builder.json(&p_body_web_authn_device_request); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::WebAuthnDevice`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::WebAuthnDevice`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Get all devices for current user -pub async fn authenticators_all_list( - configuration: &configuration::Configuration, -) -> Result, Error> { - let uri_str = format!("{}/authenticators/all/", configuration.base_path); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `Vec<models::Device>`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `Vec<models::Device>`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Viewset for Duo authenticator devices -pub async fn authenticators_duo_destroy( - configuration: &configuration::Configuration, - id: i32, -) -> Result<(), Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_id = id; - - let uri_str = format!( - "{}/authenticators/duo/{id}/", - configuration.base_path, - id = p_path_id - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::DELETE, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - - if !status.is_client_error() && !status.is_server_error() { - Ok(()) - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Viewset for Duo authenticator devices -pub async fn authenticators_duo_list( - configuration: &configuration::Configuration, - name: Option<&str>, - ordering: Option<&str>, - page: Option, - page_size: Option, - search: Option<&str>, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_query_name = name; - let p_query_ordering = ordering; - let p_query_page = page; - let p_query_page_size = page_size; - let p_query_search = search; - - let uri_str = format!("{}/authenticators/duo/", configuration.base_path); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref param_value) = p_query_name { - req_builder = req_builder.query(&[("name", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_ordering { - req_builder = req_builder.query(&[("ordering", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_page { - req_builder = req_builder.query(&[("page", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_page_size { - req_builder = req_builder.query(&[("page_size", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_search { - req_builder = req_builder.query(&[("search", ¶m_value.to_string())]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::PaginatedDuoDeviceList`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::PaginatedDuoDeviceList`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Viewset for Duo authenticator devices -pub async fn authenticators_duo_partial_update( - configuration: &configuration::Configuration, - id: i32, - patched_duo_device_request: Option, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_id = id; - let p_body_patched_duo_device_request = patched_duo_device_request; - - let uri_str = format!( - "{}/authenticators/duo/{id}/", - configuration.base_path, - id = p_path_id - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::PATCH, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - req_builder = req_builder.json(&p_body_patched_duo_device_request); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::DuoDevice`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::DuoDevice`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Viewset for Duo authenticator devices -pub async fn authenticators_duo_retrieve( - configuration: &configuration::Configuration, - id: i32, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_id = id; - - let uri_str = format!( - "{}/authenticators/duo/{id}/", - configuration.base_path, - id = p_path_id - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::DuoDevice`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::DuoDevice`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Viewset for Duo authenticator devices -pub async fn authenticators_duo_update( - configuration: &configuration::Configuration, - id: i32, - duo_device_request: models::DuoDeviceRequest, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_id = id; - let p_body_duo_device_request = duo_device_request; - - let uri_str = format!( - "{}/authenticators/duo/{id}/", - configuration.base_path, - id = p_path_id - ); - let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - req_builder = req_builder.json(&p_body_duo_device_request); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::DuoDevice`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::DuoDevice`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Get a list of all objects that use this object -pub async fn authenticators_duo_used_by_list( - configuration: &configuration::Configuration, - id: i32, -) -> Result, Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_id = id; - - let uri_str = format!( - "{}/authenticators/duo/{id}/used_by/", - configuration.base_path, - id = p_path_id - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `Vec<models::UsedBy>`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `Vec<models::UsedBy>`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Viewset for email authenticator devices -pub async fn authenticators_email_destroy( - configuration: &configuration::Configuration, - id: i32, -) -> Result<(), Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_id = id; - - let uri_str = format!( - "{}/authenticators/email/{id}/", - configuration.base_path, - id = p_path_id - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::DELETE, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - - if !status.is_client_error() && !status.is_server_error() { - Ok(()) - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Viewset for email authenticator devices -pub async fn authenticators_email_list( - configuration: &configuration::Configuration, - name: Option<&str>, - ordering: Option<&str>, - page: Option, - page_size: Option, - search: Option<&str>, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_query_name = name; - let p_query_ordering = ordering; - let p_query_page = page; - let p_query_page_size = page_size; - let p_query_search = search; - - let uri_str = format!("{}/authenticators/email/", configuration.base_path); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref param_value) = p_query_name { - req_builder = req_builder.query(&[("name", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_ordering { - req_builder = req_builder.query(&[("ordering", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_page { - req_builder = req_builder.query(&[("page", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_page_size { - req_builder = req_builder.query(&[("page_size", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_search { - req_builder = req_builder.query(&[("search", ¶m_value.to_string())]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::PaginatedEmailDeviceList`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::PaginatedEmailDeviceList`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Viewset for email authenticator devices -pub async fn authenticators_email_partial_update( - configuration: &configuration::Configuration, - id: i32, - patched_email_device_request: Option, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_id = id; - let p_body_patched_email_device_request = patched_email_device_request; - - let uri_str = format!( - "{}/authenticators/email/{id}/", - configuration.base_path, - id = p_path_id - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::PATCH, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - req_builder = req_builder.json(&p_body_patched_email_device_request); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::EmailDevice`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::EmailDevice`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Viewset for email authenticator devices -pub async fn authenticators_email_retrieve( - configuration: &configuration::Configuration, - id: i32, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_id = id; - - let uri_str = format!( - "{}/authenticators/email/{id}/", - configuration.base_path, - id = p_path_id - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::EmailDevice`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::EmailDevice`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Viewset for email authenticator devices -pub async fn authenticators_email_update( - configuration: &configuration::Configuration, - id: i32, - email_device_request: models::EmailDeviceRequest, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_id = id; - let p_body_email_device_request = email_device_request; - - let uri_str = format!( - "{}/authenticators/email/{id}/", - configuration.base_path, - id = p_path_id - ); - let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - req_builder = req_builder.json(&p_body_email_device_request); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::EmailDevice`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::EmailDevice`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Get a list of all objects that use this object -pub async fn authenticators_email_used_by_list( - configuration: &configuration::Configuration, - id: i32, -) -> Result, Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_id = id; - - let uri_str = format!( - "{}/authenticators/email/{id}/used_by/", - configuration.base_path, - id = p_path_id - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `Vec<models::UsedBy>`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `Vec<models::UsedBy>`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Viewset for Endpoint authenticator devices -pub async fn authenticators_endpoint_list( - configuration: &configuration::Configuration, - name: Option<&str>, - ordering: Option<&str>, - page: Option, - page_size: Option, - search: Option<&str>, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_query_name = name; - let p_query_ordering = ordering; - let p_query_page = page; - let p_query_page_size = page_size; - let p_query_search = search; - - let uri_str = format!("{}/authenticators/endpoint/", configuration.base_path); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref param_value) = p_query_name { - req_builder = req_builder.query(&[("name", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_ordering { - req_builder = req_builder.query(&[("ordering", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_page { - req_builder = req_builder.query(&[("page", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_page_size { - req_builder = req_builder.query(&[("page_size", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_search { - req_builder = req_builder.query(&[("search", ¶m_value.to_string())]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::PaginatedGoogleEndpointDeviceList`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::PaginatedGoogleEndpointDeviceList`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Viewset for Endpoint authenticator devices -pub async fn authenticators_endpoint_retrieve( - configuration: &configuration::Configuration, - uuid: &str, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_uuid = uuid; - - let uri_str = format!( - "{}/authenticators/endpoint/{uuid}/", - configuration.base_path, - uuid = crate::apis::urlencode(p_path_uuid) - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::GoogleEndpointDevice`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::GoogleEndpointDevice`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Get a list of all objects that use this object -pub async fn authenticators_endpoint_used_by_list( - configuration: &configuration::Configuration, - uuid: &str, -) -> Result, Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_uuid = uuid; - - let uri_str = format!( - "{}/authenticators/endpoint/{uuid}/used_by/", - configuration.base_path, - uuid = crate::apis::urlencode(p_path_uuid) - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `Vec<models::UsedBy>`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `Vec<models::UsedBy>`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Viewset for sms authenticator devices -pub async fn authenticators_sms_destroy( - configuration: &configuration::Configuration, - id: i32, -) -> Result<(), Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_id = id; - - let uri_str = format!( - "{}/authenticators/sms/{id}/", - configuration.base_path, - id = p_path_id - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::DELETE, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - - if !status.is_client_error() && !status.is_server_error() { - Ok(()) - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Viewset for sms authenticator devices -pub async fn authenticators_sms_list( - configuration: &configuration::Configuration, - name: Option<&str>, - ordering: Option<&str>, - page: Option, - page_size: Option, - search: Option<&str>, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_query_name = name; - let p_query_ordering = ordering; - let p_query_page = page; - let p_query_page_size = page_size; - let p_query_search = search; - - let uri_str = format!("{}/authenticators/sms/", configuration.base_path); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref param_value) = p_query_name { - req_builder = req_builder.query(&[("name", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_ordering { - req_builder = req_builder.query(&[("ordering", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_page { - req_builder = req_builder.query(&[("page", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_page_size { - req_builder = req_builder.query(&[("page_size", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_search { - req_builder = req_builder.query(&[("search", ¶m_value.to_string())]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::PaginatedSmsDeviceList`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::PaginatedSmsDeviceList`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Viewset for sms authenticator devices -pub async fn authenticators_sms_partial_update( - configuration: &configuration::Configuration, - id: i32, - patched_sms_device_request: Option, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_id = id; - let p_body_patched_sms_device_request = patched_sms_device_request; - - let uri_str = format!( - "{}/authenticators/sms/{id}/", - configuration.base_path, - id = p_path_id - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::PATCH, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - req_builder = req_builder.json(&p_body_patched_sms_device_request); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::SmsDevice`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::SmsDevice`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Viewset for sms authenticator devices -pub async fn authenticators_sms_retrieve( - configuration: &configuration::Configuration, - id: i32, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_id = id; - - let uri_str = format!( - "{}/authenticators/sms/{id}/", - configuration.base_path, - id = p_path_id - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::SmsDevice`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::SmsDevice`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Viewset for sms authenticator devices -pub async fn authenticators_sms_update( - configuration: &configuration::Configuration, - id: i32, - sms_device_request: models::SmsDeviceRequest, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_id = id; - let p_body_sms_device_request = sms_device_request; - - let uri_str = format!( - "{}/authenticators/sms/{id}/", - configuration.base_path, - id = p_path_id - ); - let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - req_builder = req_builder.json(&p_body_sms_device_request); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::SmsDevice`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::SmsDevice`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Get a list of all objects that use this object -pub async fn authenticators_sms_used_by_list( - configuration: &configuration::Configuration, - id: i32, -) -> Result, Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_id = id; - - let uri_str = format!( - "{}/authenticators/sms/{id}/used_by/", - configuration.base_path, - id = p_path_id - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `Vec<models::UsedBy>`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `Vec<models::UsedBy>`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Viewset for static authenticator devices -pub async fn authenticators_static_destroy( - configuration: &configuration::Configuration, - id: i32, -) -> Result<(), Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_id = id; - - let uri_str = format!( - "{}/authenticators/static/{id}/", - configuration.base_path, - id = p_path_id - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::DELETE, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - - if !status.is_client_error() && !status.is_server_error() { - Ok(()) - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Viewset for static authenticator devices -pub async fn authenticators_static_list( - configuration: &configuration::Configuration, - name: Option<&str>, - ordering: Option<&str>, - page: Option, - page_size: Option, - search: Option<&str>, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_query_name = name; - let p_query_ordering = ordering; - let p_query_page = page; - let p_query_page_size = page_size; - let p_query_search = search; - - let uri_str = format!("{}/authenticators/static/", configuration.base_path); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref param_value) = p_query_name { - req_builder = req_builder.query(&[("name", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_ordering { - req_builder = req_builder.query(&[("ordering", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_page { - req_builder = req_builder.query(&[("page", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_page_size { - req_builder = req_builder.query(&[("page_size", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_search { - req_builder = req_builder.query(&[("search", ¶m_value.to_string())]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::PaginatedStaticDeviceList`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::PaginatedStaticDeviceList`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Viewset for static authenticator devices -pub async fn authenticators_static_partial_update( - configuration: &configuration::Configuration, - id: i32, - patched_static_device_request: Option, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_id = id; - let p_body_patched_static_device_request = patched_static_device_request; - - let uri_str = format!( - "{}/authenticators/static/{id}/", - configuration.base_path, - id = p_path_id - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::PATCH, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - req_builder = req_builder.json(&p_body_patched_static_device_request); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::StaticDevice`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::StaticDevice`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Viewset for static authenticator devices -pub async fn authenticators_static_retrieve( - configuration: &configuration::Configuration, - id: i32, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_id = id; - - let uri_str = format!( - "{}/authenticators/static/{id}/", - configuration.base_path, - id = p_path_id - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::StaticDevice`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::StaticDevice`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Viewset for static authenticator devices -pub async fn authenticators_static_update( - configuration: &configuration::Configuration, - id: i32, - static_device_request: models::StaticDeviceRequest, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_id = id; - let p_body_static_device_request = static_device_request; - - let uri_str = format!( - "{}/authenticators/static/{id}/", - configuration.base_path, - id = p_path_id - ); - let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - req_builder = req_builder.json(&p_body_static_device_request); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::StaticDevice`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::StaticDevice`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Get a list of all objects that use this object -pub async fn authenticators_static_used_by_list( - configuration: &configuration::Configuration, - id: i32, -) -> Result, Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_id = id; - - let uri_str = format!( - "{}/authenticators/static/{id}/used_by/", - configuration.base_path, - id = p_path_id - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `Vec<models::UsedBy>`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `Vec<models::UsedBy>`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Viewset for totp authenticator devices -pub async fn authenticators_totp_destroy( - configuration: &configuration::Configuration, - id: i32, -) -> Result<(), Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_id = id; - - let uri_str = format!( - "{}/authenticators/totp/{id}/", - configuration.base_path, - id = p_path_id - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::DELETE, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - - if !status.is_client_error() && !status.is_server_error() { - Ok(()) - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Viewset for totp authenticator devices -pub async fn authenticators_totp_list( - configuration: &configuration::Configuration, - name: Option<&str>, - ordering: Option<&str>, - page: Option, - page_size: Option, - search: Option<&str>, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_query_name = name; - let p_query_ordering = ordering; - let p_query_page = page; - let p_query_page_size = page_size; - let p_query_search = search; - - let uri_str = format!("{}/authenticators/totp/", configuration.base_path); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref param_value) = p_query_name { - req_builder = req_builder.query(&[("name", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_ordering { - req_builder = req_builder.query(&[("ordering", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_page { - req_builder = req_builder.query(&[("page", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_page_size { - req_builder = req_builder.query(&[("page_size", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_search { - req_builder = req_builder.query(&[("search", ¶m_value.to_string())]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::PaginatedTotpDeviceList`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::PaginatedTotpDeviceList`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Viewset for totp authenticator devices -pub async fn authenticators_totp_partial_update( - configuration: &configuration::Configuration, - id: i32, - patched_totp_device_request: Option, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_id = id; - let p_body_patched_totp_device_request = patched_totp_device_request; - - let uri_str = format!( - "{}/authenticators/totp/{id}/", - configuration.base_path, - id = p_path_id - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::PATCH, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - req_builder = req_builder.json(&p_body_patched_totp_device_request); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::TotpDevice`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::TotpDevice`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Viewset for totp authenticator devices -pub async fn authenticators_totp_retrieve( - configuration: &configuration::Configuration, - id: i32, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_id = id; - - let uri_str = format!( - "{}/authenticators/totp/{id}/", - configuration.base_path, - id = p_path_id - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::TotpDevice`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::TotpDevice`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Viewset for totp authenticator devices -pub async fn authenticators_totp_update( - configuration: &configuration::Configuration, - id: i32, - totp_device_request: models::TotpDeviceRequest, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_id = id; - let p_body_totp_device_request = totp_device_request; - - let uri_str = format!( - "{}/authenticators/totp/{id}/", - configuration.base_path, - id = p_path_id - ); - let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - req_builder = req_builder.json(&p_body_totp_device_request); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::TotpDevice`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::TotpDevice`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Get a list of all objects that use this object -pub async fn authenticators_totp_used_by_list( - configuration: &configuration::Configuration, - id: i32, -) -> Result, Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_id = id; - - let uri_str = format!( - "{}/authenticators/totp/{id}/used_by/", - configuration.base_path, - id = p_path_id - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `Vec<models::UsedBy>`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `Vec<models::UsedBy>`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Viewset for WebAuthn authenticator devices -pub async fn authenticators_webauthn_destroy( - configuration: &configuration::Configuration, - id: i32, -) -> Result<(), Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_id = id; - - let uri_str = format!( - "{}/authenticators/webauthn/{id}/", - configuration.base_path, - id = p_path_id - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::DELETE, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - - if !status.is_client_error() && !status.is_server_error() { - Ok(()) - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Viewset for WebAuthn authenticator devices -pub async fn authenticators_webauthn_list( - configuration: &configuration::Configuration, - name: Option<&str>, - ordering: Option<&str>, - page: Option, - page_size: Option, - search: Option<&str>, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_query_name = name; - let p_query_ordering = ordering; - let p_query_page = page; - let p_query_page_size = page_size; - let p_query_search = search; - - let uri_str = format!("{}/authenticators/webauthn/", configuration.base_path); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref param_value) = p_query_name { - req_builder = req_builder.query(&[("name", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_ordering { - req_builder = req_builder.query(&[("ordering", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_page { - req_builder = req_builder.query(&[("page", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_page_size { - req_builder = req_builder.query(&[("page_size", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_search { - req_builder = req_builder.query(&[("search", ¶m_value.to_string())]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::PaginatedWebAuthnDeviceList`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::PaginatedWebAuthnDeviceList`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Viewset for WebAuthn authenticator devices -pub async fn authenticators_webauthn_partial_update( - configuration: &configuration::Configuration, - id: i32, - patched_web_authn_device_request: Option, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_id = id; - let p_body_patched_web_authn_device_request = patched_web_authn_device_request; - - let uri_str = format!( - "{}/authenticators/webauthn/{id}/", - configuration.base_path, - id = p_path_id - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::PATCH, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - req_builder = req_builder.json(&p_body_patched_web_authn_device_request); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::WebAuthnDevice`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::WebAuthnDevice`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Viewset for WebAuthn authenticator devices -pub async fn authenticators_webauthn_retrieve( - configuration: &configuration::Configuration, - id: i32, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_id = id; - - let uri_str = format!( - "{}/authenticators/webauthn/{id}/", - configuration.base_path, - id = p_path_id - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::WebAuthnDevice`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::WebAuthnDevice`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Viewset for WebAuthn authenticator devices -pub async fn authenticators_webauthn_update( - configuration: &configuration::Configuration, - id: i32, - web_authn_device_request: models::WebAuthnDeviceRequest, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_id = id; - let p_body_web_authn_device_request = web_authn_device_request; - - let uri_str = format!( - "{}/authenticators/webauthn/{id}/", - configuration.base_path, - id = p_path_id - ); - let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - req_builder = req_builder.json(&p_body_web_authn_device_request); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::WebAuthnDevice`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::WebAuthnDevice`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Get a list of all objects that use this object -pub async fn authenticators_webauthn_used_by_list( - configuration: &configuration::Configuration, - id: i32, -) -> Result, Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_id = id; - - let uri_str = format!( - "{}/authenticators/webauthn/{id}/used_by/", - configuration.base_path, - id = p_path_id - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `Vec<models::UsedBy>`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `Vec<models::UsedBy>`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} diff --git a/packages/client-rust/src/apis/core_api.rs b/packages/client-rust/src/apis/core_api.rs index 15884aafb3..bc545d5ec9 100644 --- a/packages/client-rust/src/apis/core_api.rs +++ b/packages/client-rust/src/apis/core_api.rs @@ -12,213 +12,6 @@ use serde::{Deserialize, Serialize, de::Error as _}; use super::{ContentType, Error, configuration}; use crate::{apis::ResponseContent, models}; -/// struct for typed errors of method [`core_application_entitlements_create`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum CoreApplicationEntitlementsCreateError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`core_application_entitlements_destroy`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum CoreApplicationEntitlementsDestroyError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`core_application_entitlements_list`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum CoreApplicationEntitlementsListError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`core_application_entitlements_partial_update`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum CoreApplicationEntitlementsPartialUpdateError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`core_application_entitlements_retrieve`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum CoreApplicationEntitlementsRetrieveError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`core_application_entitlements_update`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum CoreApplicationEntitlementsUpdateError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`core_application_entitlements_used_by_list`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum CoreApplicationEntitlementsUsedByListError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`core_applications_check_access_retrieve`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum CoreApplicationsCheckAccessRetrieveError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`core_applications_create`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum CoreApplicationsCreateError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`core_applications_destroy`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum CoreApplicationsDestroyError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`core_applications_list`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum CoreApplicationsListError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`core_applications_partial_update`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum CoreApplicationsPartialUpdateError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`core_applications_retrieve`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum CoreApplicationsRetrieveError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`core_applications_update`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum CoreApplicationsUpdateError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`core_applications_used_by_list`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum CoreApplicationsUsedByListError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`core_authenticated_sessions_bulk_delete_destroy`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum CoreAuthenticatedSessionsBulkDeleteDestroyError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`core_authenticated_sessions_destroy`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum CoreAuthenticatedSessionsDestroyError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`core_authenticated_sessions_list`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum CoreAuthenticatedSessionsListError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`core_authenticated_sessions_retrieve`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum CoreAuthenticatedSessionsRetrieveError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`core_authenticated_sessions_used_by_list`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum CoreAuthenticatedSessionsUsedByListError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`core_brands_create`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum CoreBrandsCreateError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`core_brands_current_retrieve`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum CoreBrandsCurrentRetrieveError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`core_brands_destroy`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum CoreBrandsDestroyError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - /// struct for typed errors of method [`core_brands_list`] #[derive(Debug, Clone, Serialize, Deserialize)] #[serde(untagged)] @@ -228,70 +21,6 @@ pub enum CoreBrandsListError { UnknownValue(serde_json::Value), } -/// struct for typed errors of method [`core_brands_partial_update`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum CoreBrandsPartialUpdateError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`core_brands_retrieve`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum CoreBrandsRetrieveError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`core_brands_update`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum CoreBrandsUpdateError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`core_brands_used_by_list`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum CoreBrandsUsedByListError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`core_groups_add_user_create`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum CoreGroupsAddUserCreateError { - Status404(), - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`core_groups_create`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum CoreGroupsCreateError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`core_groups_destroy`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum CoreGroupsDestroyError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - /// struct for typed errors of method [`core_groups_list`] #[derive(Debug, Clone, Serialize, Deserialize)] #[serde(untagged)] @@ -301,225 +30,6 @@ pub enum CoreGroupsListError { UnknownValue(serde_json::Value), } -/// struct for typed errors of method [`core_groups_partial_update`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum CoreGroupsPartialUpdateError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`core_groups_remove_user_create`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum CoreGroupsRemoveUserCreateError { - Status404(), - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`core_groups_retrieve`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum CoreGroupsRetrieveError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`core_groups_update`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum CoreGroupsUpdateError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`core_groups_used_by_list`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum CoreGroupsUsedByListError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`core_tokens_create`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum CoreTokensCreateError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`core_tokens_destroy`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum CoreTokensDestroyError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`core_tokens_list`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum CoreTokensListError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`core_tokens_partial_update`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum CoreTokensPartialUpdateError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`core_tokens_retrieve`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum CoreTokensRetrieveError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`core_tokens_set_key_create`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum CoreTokensSetKeyCreateError { - Status400(), - Status404(), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`core_tokens_update`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum CoreTokensUpdateError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`core_tokens_used_by_list`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum CoreTokensUsedByListError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`core_tokens_view_key_retrieve`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum CoreTokensViewKeyRetrieveError { - Status404(), - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`core_transactional_applications_update`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum CoreTransactionalApplicationsUpdateError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`core_user_consent_destroy`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum CoreUserConsentDestroyError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`core_user_consent_list`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum CoreUserConsentListError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`core_user_consent_retrieve`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum CoreUserConsentRetrieveError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`core_user_consent_used_by_list`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum CoreUserConsentUsedByListError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`core_users_create`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum CoreUsersCreateError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`core_users_destroy`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum CoreUsersDestroyError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`core_users_export_create`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum CoreUsersExportCreateError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`core_users_impersonate_create`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum CoreUsersImpersonateCreateError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`core_users_impersonate_end_retrieve`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum CoreUsersImpersonateEndRetrieveError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - /// struct for typed errors of method [`core_users_list`] #[derive(Debug, Clone, Serialize, Deserialize)] #[serde(untagged)] @@ -538,42 +48,6 @@ pub enum CoreUsersMeRetrieveError { UnknownValue(serde_json::Value), } -/// struct for typed errors of method [`core_users_partial_update`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum CoreUsersPartialUpdateError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`core_users_paths_retrieve`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum CoreUsersPathsRetrieveError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`core_users_recovery_create`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum CoreUsersRecoveryCreateError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`core_users_recovery_email_create`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum CoreUsersRecoveryEmailCreateError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - /// struct for typed errors of method [`core_users_retrieve`] #[derive(Debug, Clone, Serialize, Deserialize)] #[serde(untagged)] @@ -583,1530 +57,6 @@ pub enum CoreUsersRetrieveError { UnknownValue(serde_json::Value), } -/// struct for typed errors of method [`core_users_service_account_create`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum CoreUsersServiceAccountCreateError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`core_users_set_password_create`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum CoreUsersSetPasswordCreateError { - Status400(), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`core_users_update`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum CoreUsersUpdateError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`core_users_used_by_list`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum CoreUsersUsedByListError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// ApplicationEntitlement Viewset -pub async fn core_application_entitlements_create( - configuration: &configuration::Configuration, - application_entitlement_request: models::ApplicationEntitlementRequest, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_body_application_entitlement_request = application_entitlement_request; - - let uri_str = format!("{}/core/application_entitlements/", configuration.base_path); - let mut req_builder = configuration - .client - .request(reqwest::Method::POST, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - req_builder = req_builder.json(&p_body_application_entitlement_request); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::ApplicationEntitlement`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::ApplicationEntitlement`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// ApplicationEntitlement Viewset -pub async fn core_application_entitlements_destroy( - configuration: &configuration::Configuration, - pbm_uuid: &str, -) -> Result<(), Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_pbm_uuid = pbm_uuid; - - let uri_str = format!( - "{}/core/application_entitlements/{pbm_uuid}/", - configuration.base_path, - pbm_uuid = crate::apis::urlencode(p_path_pbm_uuid) - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::DELETE, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - - if !status.is_client_error() && !status.is_server_error() { - Ok(()) - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// ApplicationEntitlement Viewset -pub async fn core_application_entitlements_list( - configuration: &configuration::Configuration, - app: Option<&str>, - name: Option<&str>, - ordering: Option<&str>, - page: Option, - page_size: Option, - pbm_uuid: Option<&str>, - search: Option<&str>, -) -> Result> -{ - // add a prefix to parameters to efficiently prevent name collisions - let p_query_app = app; - let p_query_name = name; - let p_query_ordering = ordering; - let p_query_page = page; - let p_query_page_size = page_size; - let p_query_pbm_uuid = pbm_uuid; - let p_query_search = search; - - let uri_str = format!("{}/core/application_entitlements/", configuration.base_path); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref param_value) = p_query_app { - req_builder = req_builder.query(&[("app", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_name { - req_builder = req_builder.query(&[("name", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_ordering { - req_builder = req_builder.query(&[("ordering", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_page { - req_builder = req_builder.query(&[("page", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_page_size { - req_builder = req_builder.query(&[("page_size", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_pbm_uuid { - req_builder = req_builder.query(&[("pbm_uuid", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_search { - req_builder = req_builder.query(&[("search", ¶m_value.to_string())]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::PaginatedApplicationEntitlementList`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::PaginatedApplicationEntitlementList`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// ApplicationEntitlement Viewset -pub async fn core_application_entitlements_partial_update( - configuration: &configuration::Configuration, - pbm_uuid: &str, - patched_application_entitlement_request: Option, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_pbm_uuid = pbm_uuid; - let p_body_patched_application_entitlement_request = patched_application_entitlement_request; - - let uri_str = format!( - "{}/core/application_entitlements/{pbm_uuid}/", - configuration.base_path, - pbm_uuid = crate::apis::urlencode(p_path_pbm_uuid) - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::PATCH, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - req_builder = req_builder.json(&p_body_patched_application_entitlement_request); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::ApplicationEntitlement`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::ApplicationEntitlement`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// ApplicationEntitlement Viewset -pub async fn core_application_entitlements_retrieve( - configuration: &configuration::Configuration, - pbm_uuid: &str, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_pbm_uuid = pbm_uuid; - - let uri_str = format!( - "{}/core/application_entitlements/{pbm_uuid}/", - configuration.base_path, - pbm_uuid = crate::apis::urlencode(p_path_pbm_uuid) - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::ApplicationEntitlement`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::ApplicationEntitlement`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// ApplicationEntitlement Viewset -pub async fn core_application_entitlements_update( - configuration: &configuration::Configuration, - pbm_uuid: &str, - application_entitlement_request: models::ApplicationEntitlementRequest, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_pbm_uuid = pbm_uuid; - let p_body_application_entitlement_request = application_entitlement_request; - - let uri_str = format!( - "{}/core/application_entitlements/{pbm_uuid}/", - configuration.base_path, - pbm_uuid = crate::apis::urlencode(p_path_pbm_uuid) - ); - let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - req_builder = req_builder.json(&p_body_application_entitlement_request); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::ApplicationEntitlement`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::ApplicationEntitlement`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Get a list of all objects that use this object -pub async fn core_application_entitlements_used_by_list( - configuration: &configuration::Configuration, - pbm_uuid: &str, -) -> Result, Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_pbm_uuid = pbm_uuid; - - let uri_str = format!( - "{}/core/application_entitlements/{pbm_uuid}/used_by/", - configuration.base_path, - pbm_uuid = crate::apis::urlencode(p_path_pbm_uuid) - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `Vec<models::UsedBy>`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `Vec<models::UsedBy>`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Check access to a single application by slug -pub async fn core_applications_check_access_retrieve( - configuration: &configuration::Configuration, - slug: &str, - for_user: Option, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_slug = slug; - let p_query_for_user = for_user; - - let uri_str = format!( - "{}/core/applications/{slug}/check_access/", - configuration.base_path, - slug = crate::apis::urlencode(p_path_slug) - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref param_value) = p_query_for_user { - req_builder = req_builder.query(&[("for_user", ¶m_value.to_string())]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::PolicyTestResult`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::PolicyTestResult`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Application Viewset -pub async fn core_applications_create( - configuration: &configuration::Configuration, - application_request: models::ApplicationRequest, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_body_application_request = application_request; - - let uri_str = format!("{}/core/applications/", configuration.base_path); - let mut req_builder = configuration - .client - .request(reqwest::Method::POST, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - req_builder = req_builder.json(&p_body_application_request); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::Application`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::Application`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Application Viewset -pub async fn core_applications_destroy( - configuration: &configuration::Configuration, - slug: &str, -) -> Result<(), Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_slug = slug; - - let uri_str = format!( - "{}/core/applications/{slug}/", - configuration.base_path, - slug = crate::apis::urlencode(p_path_slug) - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::DELETE, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - - if !status.is_client_error() && !status.is_server_error() { - Ok(()) - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Custom list method that checks Policy based access instead of guardian -pub async fn core_applications_list( - configuration: &configuration::Configuration, - for_user: Option, - group: Option<&str>, - meta_description: Option<&str>, - meta_launch_url: Option<&str>, - meta_publisher: Option<&str>, - name: Option<&str>, - only_with_launch_url: Option, - ordering: Option<&str>, - page: Option, - page_size: Option, - search: Option<&str>, - slug: Option<&str>, - superuser_full_list: Option, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_query_for_user = for_user; - let p_query_group = group; - let p_query_meta_description = meta_description; - let p_query_meta_launch_url = meta_launch_url; - let p_query_meta_publisher = meta_publisher; - let p_query_name = name; - let p_query_only_with_launch_url = only_with_launch_url; - let p_query_ordering = ordering; - let p_query_page = page; - let p_query_page_size = page_size; - let p_query_search = search; - let p_query_slug = slug; - let p_query_superuser_full_list = superuser_full_list; - - let uri_str = format!("{}/core/applications/", configuration.base_path); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref param_value) = p_query_for_user { - req_builder = req_builder.query(&[("for_user", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_group { - req_builder = req_builder.query(&[("group", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_meta_description { - req_builder = req_builder.query(&[("meta_description", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_meta_launch_url { - req_builder = req_builder.query(&[("meta_launch_url", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_meta_publisher { - req_builder = req_builder.query(&[("meta_publisher", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_name { - req_builder = req_builder.query(&[("name", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_only_with_launch_url { - req_builder = req_builder.query(&[("only_with_launch_url", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_ordering { - req_builder = req_builder.query(&[("ordering", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_page { - req_builder = req_builder.query(&[("page", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_page_size { - req_builder = req_builder.query(&[("page_size", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_search { - req_builder = req_builder.query(&[("search", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_slug { - req_builder = req_builder.query(&[("slug", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_superuser_full_list { - req_builder = req_builder.query(&[("superuser_full_list", ¶m_value.to_string())]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::PaginatedApplicationList`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::PaginatedApplicationList`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Application Viewset -pub async fn core_applications_partial_update( - configuration: &configuration::Configuration, - slug: &str, - patched_application_request: Option, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_slug = slug; - let p_body_patched_application_request = patched_application_request; - - let uri_str = format!( - "{}/core/applications/{slug}/", - configuration.base_path, - slug = crate::apis::urlencode(p_path_slug) - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::PATCH, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - req_builder = req_builder.json(&p_body_patched_application_request); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::Application`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::Application`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Application Viewset -pub async fn core_applications_retrieve( - configuration: &configuration::Configuration, - slug: &str, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_slug = slug; - - let uri_str = format!( - "{}/core/applications/{slug}/", - configuration.base_path, - slug = crate::apis::urlencode(p_path_slug) - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::Application`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::Application`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Application Viewset -pub async fn core_applications_update( - configuration: &configuration::Configuration, - slug: &str, - application_request: models::ApplicationRequest, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_slug = slug; - let p_body_application_request = application_request; - - let uri_str = format!( - "{}/core/applications/{slug}/", - configuration.base_path, - slug = crate::apis::urlencode(p_path_slug) - ); - let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - req_builder = req_builder.json(&p_body_application_request); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::Application`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::Application`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Get a list of all objects that use this object -pub async fn core_applications_used_by_list( - configuration: &configuration::Configuration, - slug: &str, -) -> Result, Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_slug = slug; - - let uri_str = format!( - "{}/core/applications/{slug}/used_by/", - configuration.base_path, - slug = crate::apis::urlencode(p_path_slug) - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `Vec<models::UsedBy>`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `Vec<models::UsedBy>`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Bulk revoke all sessions for multiple users -pub async fn core_authenticated_sessions_bulk_delete_destroy( - configuration: &configuration::Configuration, - user_pks: Vec, -) -> Result> -{ - // add a prefix to parameters to efficiently prevent name collisions - let p_query_user_pks = user_pks; - - let uri_str = format!( - "{}/core/authenticated_sessions/bulk_delete/", - configuration.base_path - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::DELETE, &uri_str); - - req_builder = match "multi" { - "multi" => req_builder.query( - &p_query_user_pks - .into_iter() - .map(|p| ("user_pks".to_owned(), p.to_string())) - .collect::>(), - ), - _ => req_builder.query(&[( - "user_pks", - &p_query_user_pks - .into_iter() - .map(|p| p.to_string()) - .collect::>() - .join(",") - .to_string(), - )]), - }; - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::BulkDeleteSessionResponse`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::BulkDeleteSessionResponse`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// AuthenticatedSession Viewset -pub async fn core_authenticated_sessions_destroy( - configuration: &configuration::Configuration, - uuid: &str, -) -> Result<(), Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_uuid = uuid; - - let uri_str = format!( - "{}/core/authenticated_sessions/{uuid}/", - configuration.base_path, - uuid = crate::apis::urlencode(p_path_uuid) - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::DELETE, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - - if !status.is_client_error() && !status.is_server_error() { - Ok(()) - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// AuthenticatedSession Viewset -pub async fn core_authenticated_sessions_list( - configuration: &configuration::Configuration, - ordering: Option<&str>, - page: Option, - page_size: Option, - search: Option<&str>, - session__last_ip: Option<&str>, - session__last_user_agent: Option<&str>, - user__username: Option<&str>, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_query_ordering = ordering; - let p_query_page = page; - let p_query_page_size = page_size; - let p_query_search = search; - let p_query_session__last_ip = session__last_ip; - let p_query_session__last_user_agent = session__last_user_agent; - let p_query_user__username = user__username; - - let uri_str = format!("{}/core/authenticated_sessions/", configuration.base_path); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref param_value) = p_query_ordering { - req_builder = req_builder.query(&[("ordering", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_page { - req_builder = req_builder.query(&[("page", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_page_size { - req_builder = req_builder.query(&[("page_size", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_search { - req_builder = req_builder.query(&[("search", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_session__last_ip { - req_builder = req_builder.query(&[("session__last_ip", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_session__last_user_agent { - req_builder = req_builder.query(&[("session__last_user_agent", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_user__username { - req_builder = req_builder.query(&[("user__username", ¶m_value.to_string())]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::PaginatedAuthenticatedSessionList`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::PaginatedAuthenticatedSessionList`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// AuthenticatedSession Viewset -pub async fn core_authenticated_sessions_retrieve( - configuration: &configuration::Configuration, - uuid: &str, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_uuid = uuid; - - let uri_str = format!( - "{}/core/authenticated_sessions/{uuid}/", - configuration.base_path, - uuid = crate::apis::urlencode(p_path_uuid) - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::AuthenticatedSession`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::AuthenticatedSession`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Get a list of all objects that use this object -pub async fn core_authenticated_sessions_used_by_list( - configuration: &configuration::Configuration, - uuid: &str, -) -> Result, Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_uuid = uuid; - - let uri_str = format!( - "{}/core/authenticated_sessions/{uuid}/used_by/", - configuration.base_path, - uuid = crate::apis::urlencode(p_path_uuid) - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `Vec<models::UsedBy>`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `Vec<models::UsedBy>`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Brand Viewset -pub async fn core_brands_create( - configuration: &configuration::Configuration, - brand_request: models::BrandRequest, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_body_brand_request = brand_request; - - let uri_str = format!("{}/core/brands/", configuration.base_path); - let mut req_builder = configuration - .client - .request(reqwest::Method::POST, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - req_builder = req_builder.json(&p_body_brand_request); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::Brand`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::Brand`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Get current brand -pub async fn core_brands_current_retrieve( - configuration: &configuration::Configuration, -) -> Result> { - let uri_str = format!("{}/core/brands/current/", configuration.base_path); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::CurrentBrand`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::CurrentBrand`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Brand Viewset -pub async fn core_brands_destroy( - configuration: &configuration::Configuration, - brand_uuid: &str, -) -> Result<(), Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_brand_uuid = brand_uuid; - - let uri_str = format!( - "{}/core/brands/{brand_uuid}/", - configuration.base_path, - brand_uuid = crate::apis::urlencode(p_path_brand_uuid) - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::DELETE, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - - if !status.is_client_error() && !status.is_server_error() { - Ok(()) - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - /// Brand Viewset pub async fn core_brands_list( configuration: &configuration::Configuration, @@ -2231,9 +181,6 @@ pub async fn core_brands_list( if let Some(ref user_agent) = configuration.user_agent { req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; let req = req_builder.build()?; let resp = configuration.client.execute(req).await?; @@ -2274,405 +221,6 @@ pub async fn core_brands_list( } } -/// Brand Viewset -pub async fn core_brands_partial_update( - configuration: &configuration::Configuration, - brand_uuid: &str, - patched_brand_request: Option, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_brand_uuid = brand_uuid; - let p_body_patched_brand_request = patched_brand_request; - - let uri_str = format!( - "{}/core/brands/{brand_uuid}/", - configuration.base_path, - brand_uuid = crate::apis::urlencode(p_path_brand_uuid) - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::PATCH, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - req_builder = req_builder.json(&p_body_patched_brand_request); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::Brand`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::Brand`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Brand Viewset -pub async fn core_brands_retrieve( - configuration: &configuration::Configuration, - brand_uuid: &str, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_brand_uuid = brand_uuid; - - let uri_str = format!( - "{}/core/brands/{brand_uuid}/", - configuration.base_path, - brand_uuid = crate::apis::urlencode(p_path_brand_uuid) - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::Brand`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::Brand`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Brand Viewset -pub async fn core_brands_update( - configuration: &configuration::Configuration, - brand_uuid: &str, - brand_request: models::BrandRequest, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_brand_uuid = brand_uuid; - let p_body_brand_request = brand_request; - - let uri_str = format!( - "{}/core/brands/{brand_uuid}/", - configuration.base_path, - brand_uuid = crate::apis::urlencode(p_path_brand_uuid) - ); - let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - req_builder = req_builder.json(&p_body_brand_request); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::Brand`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::Brand`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Get a list of all objects that use this object -pub async fn core_brands_used_by_list( - configuration: &configuration::Configuration, - brand_uuid: &str, -) -> Result, Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_brand_uuid = brand_uuid; - - let uri_str = format!( - "{}/core/brands/{brand_uuid}/used_by/", - configuration.base_path, - brand_uuid = crate::apis::urlencode(p_path_brand_uuid) - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `Vec<models::UsedBy>`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `Vec<models::UsedBy>`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Add user to group -pub async fn core_groups_add_user_create( - configuration: &configuration::Configuration, - group_uuid: &str, - user_account_request: models::UserAccountRequest, -) -> Result<(), Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_group_uuid = group_uuid; - let p_body_user_account_request = user_account_request; - - let uri_str = format!( - "{}/core/groups/{group_uuid}/add_user/", - configuration.base_path, - group_uuid = crate::apis::urlencode(p_path_group_uuid) - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::POST, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - req_builder = req_builder.json(&p_body_user_account_request); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - - if !status.is_client_error() && !status.is_server_error() { - Ok(()) - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Group Viewset -pub async fn core_groups_create( - configuration: &configuration::Configuration, - group_request: models::GroupRequest, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_body_group_request = group_request; - - let uri_str = format!("{}/core/groups/", configuration.base_path); - let mut req_builder = configuration - .client - .request(reqwest::Method::POST, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - req_builder = req_builder.json(&p_body_group_request); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::Group`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::Group`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Group Viewset -pub async fn core_groups_destroy( - configuration: &configuration::Configuration, - group_uuid: &str, -) -> Result<(), Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_group_uuid = group_uuid; - - let uri_str = format!( - "{}/core/groups/{group_uuid}/", - configuration.base_path, - group_uuid = crate::apis::urlencode(p_path_group_uuid) - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::DELETE, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - - if !status.is_client_error() && !status.is_server_error() { - Ok(()) - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - /// Group Viewset pub async fn core_groups_list( configuration: &configuration::Configuration, @@ -2782,9 +330,6 @@ pub async fn core_groups_list( if let Some(ref user_agent) = configuration.user_agent { req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; let req = req_builder.build()?; let resp = configuration.client.execute(req).await?; @@ -2825,1655 +370,6 @@ pub async fn core_groups_list( } } -/// Group Viewset -pub async fn core_groups_partial_update( - configuration: &configuration::Configuration, - group_uuid: &str, - patched_group_request: Option, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_group_uuid = group_uuid; - let p_body_patched_group_request = patched_group_request; - - let uri_str = format!( - "{}/core/groups/{group_uuid}/", - configuration.base_path, - group_uuid = crate::apis::urlencode(p_path_group_uuid) - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::PATCH, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - req_builder = req_builder.json(&p_body_patched_group_request); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::Group`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::Group`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Remove user from group -pub async fn core_groups_remove_user_create( - configuration: &configuration::Configuration, - group_uuid: &str, - user_account_request: models::UserAccountRequest, -) -> Result<(), Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_group_uuid = group_uuid; - let p_body_user_account_request = user_account_request; - - let uri_str = format!( - "{}/core/groups/{group_uuid}/remove_user/", - configuration.base_path, - group_uuid = crate::apis::urlencode(p_path_group_uuid) - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::POST, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - req_builder = req_builder.json(&p_body_user_account_request); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - - if !status.is_client_error() && !status.is_server_error() { - Ok(()) - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Group Viewset -pub async fn core_groups_retrieve( - configuration: &configuration::Configuration, - group_uuid: &str, - include_children: Option, - include_inherited_roles: Option, - include_parents: Option, - include_users: Option, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_group_uuid = group_uuid; - let p_query_include_children = include_children; - let p_query_include_inherited_roles = include_inherited_roles; - let p_query_include_parents = include_parents; - let p_query_include_users = include_users; - - let uri_str = format!( - "{}/core/groups/{group_uuid}/", - configuration.base_path, - group_uuid = crate::apis::urlencode(p_path_group_uuid) - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref param_value) = p_query_include_children { - req_builder = req_builder.query(&[("include_children", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_include_inherited_roles { - req_builder = req_builder.query(&[("include_inherited_roles", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_include_parents { - req_builder = req_builder.query(&[("include_parents", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_include_users { - req_builder = req_builder.query(&[("include_users", ¶m_value.to_string())]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::Group`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::Group`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Group Viewset -pub async fn core_groups_update( - configuration: &configuration::Configuration, - group_uuid: &str, - group_request: models::GroupRequest, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_group_uuid = group_uuid; - let p_body_group_request = group_request; - - let uri_str = format!( - "{}/core/groups/{group_uuid}/", - configuration.base_path, - group_uuid = crate::apis::urlencode(p_path_group_uuid) - ); - let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - req_builder = req_builder.json(&p_body_group_request); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::Group`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::Group`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Get a list of all objects that use this object -pub async fn core_groups_used_by_list( - configuration: &configuration::Configuration, - group_uuid: &str, -) -> Result, Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_group_uuid = group_uuid; - - let uri_str = format!( - "{}/core/groups/{group_uuid}/used_by/", - configuration.base_path, - group_uuid = crate::apis::urlencode(p_path_group_uuid) - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `Vec<models::UsedBy>`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `Vec<models::UsedBy>`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Token Viewset -pub async fn core_tokens_create( - configuration: &configuration::Configuration, - token_request: models::TokenRequest, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_body_token_request = token_request; - - let uri_str = format!("{}/core/tokens/", configuration.base_path); - let mut req_builder = configuration - .client - .request(reqwest::Method::POST, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - req_builder = req_builder.json(&p_body_token_request); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::Token`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::Token`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Token Viewset -pub async fn core_tokens_destroy( - configuration: &configuration::Configuration, - identifier: &str, -) -> Result<(), Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_identifier = identifier; - - let uri_str = format!( - "{}/core/tokens/{identifier}/", - configuration.base_path, - identifier = crate::apis::urlencode(p_path_identifier) - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::DELETE, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - - if !status.is_client_error() && !status.is_server_error() { - Ok(()) - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Token Viewset -pub async fn core_tokens_list( - configuration: &configuration::Configuration, - description: Option<&str>, - expires: Option, - expiring: Option, - identifier: Option<&str>, - intent: Option, - managed: Option<&str>, - ordering: Option<&str>, - page: Option, - page_size: Option, - search: Option<&str>, - user__username: Option<&str>, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_query_description = description; - let p_query_expires = expires; - let p_query_expiring = expiring; - let p_query_identifier = identifier; - let p_query_intent = intent; - let p_query_managed = managed; - let p_query_ordering = ordering; - let p_query_page = page; - let p_query_page_size = page_size; - let p_query_search = search; - let p_query_user__username = user__username; - - let uri_str = format!("{}/core/tokens/", configuration.base_path); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref param_value) = p_query_description { - req_builder = req_builder.query(&[("description", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_expires { - req_builder = req_builder.query(&[("expires", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_expiring { - req_builder = req_builder.query(&[("expiring", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_identifier { - req_builder = req_builder.query(&[("identifier", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_intent { - req_builder = req_builder.query(&[("intent", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_managed { - req_builder = req_builder.query(&[("managed", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_ordering { - req_builder = req_builder.query(&[("ordering", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_page { - req_builder = req_builder.query(&[("page", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_page_size { - req_builder = req_builder.query(&[("page_size", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_search { - req_builder = req_builder.query(&[("search", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_user__username { - req_builder = req_builder.query(&[("user__username", ¶m_value.to_string())]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::PaginatedTokenList`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::PaginatedTokenList`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Token Viewset -pub async fn core_tokens_partial_update( - configuration: &configuration::Configuration, - identifier: &str, - patched_token_request: Option, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_identifier = identifier; - let p_body_patched_token_request = patched_token_request; - - let uri_str = format!( - "{}/core/tokens/{identifier}/", - configuration.base_path, - identifier = crate::apis::urlencode(p_path_identifier) - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::PATCH, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - req_builder = req_builder.json(&p_body_patched_token_request); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::Token`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::Token`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Token Viewset -pub async fn core_tokens_retrieve( - configuration: &configuration::Configuration, - identifier: &str, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_identifier = identifier; - - let uri_str = format!( - "{}/core/tokens/{identifier}/", - configuration.base_path, - identifier = crate::apis::urlencode(p_path_identifier) - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::Token`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::Token`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Set token key. Action is logged as event. `authentik_core.set_token_key` permission is required. -pub async fn core_tokens_set_key_create( - configuration: &configuration::Configuration, - identifier: &str, - token_set_key_request: models::TokenSetKeyRequest, -) -> Result<(), Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_identifier = identifier; - let p_body_token_set_key_request = token_set_key_request; - - let uri_str = format!( - "{}/core/tokens/{identifier}/set_key/", - configuration.base_path, - identifier = crate::apis::urlencode(p_path_identifier) - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::POST, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - req_builder = req_builder.json(&p_body_token_set_key_request); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - - if !status.is_client_error() && !status.is_server_error() { - Ok(()) - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Token Viewset -pub async fn core_tokens_update( - configuration: &configuration::Configuration, - identifier: &str, - token_request: models::TokenRequest, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_identifier = identifier; - let p_body_token_request = token_request; - - let uri_str = format!( - "{}/core/tokens/{identifier}/", - configuration.base_path, - identifier = crate::apis::urlencode(p_path_identifier) - ); - let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - req_builder = req_builder.json(&p_body_token_request); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::Token`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::Token`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Get a list of all objects that use this object -pub async fn core_tokens_used_by_list( - configuration: &configuration::Configuration, - identifier: &str, -) -> Result, Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_identifier = identifier; - - let uri_str = format!( - "{}/core/tokens/{identifier}/used_by/", - configuration.base_path, - identifier = crate::apis::urlencode(p_path_identifier) - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `Vec<models::UsedBy>`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `Vec<models::UsedBy>`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Return token key and log access -pub async fn core_tokens_view_key_retrieve( - configuration: &configuration::Configuration, - identifier: &str, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_identifier = identifier; - - let uri_str = format!( - "{}/core/tokens/{identifier}/view_key/", - configuration.base_path, - identifier = crate::apis::urlencode(p_path_identifier) - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::TokenView`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::TokenView`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Convert data into a blueprint, validate it and apply it -pub async fn core_transactional_applications_update( - configuration: &configuration::Configuration, - transaction_application_request: models::TransactionApplicationRequest, -) -> Result> -{ - // add a prefix to parameters to efficiently prevent name collisions - let p_body_transaction_application_request = transaction_application_request; - - let uri_str = format!( - "{}/core/transactional/applications/", - configuration.base_path - ); - let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - req_builder = req_builder.json(&p_body_transaction_application_request); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::TransactionApplicationResponse`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::TransactionApplicationResponse`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// UserConsent Viewset -pub async fn core_user_consent_destroy( - configuration: &configuration::Configuration, - id: i32, -) -> Result<(), Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_id = id; - - let uri_str = format!( - "{}/core/user_consent/{id}/", - configuration.base_path, - id = p_path_id - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::DELETE, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - - if !status.is_client_error() && !status.is_server_error() { - Ok(()) - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// UserConsent Viewset -pub async fn core_user_consent_list( - configuration: &configuration::Configuration, - application: Option<&str>, - ordering: Option<&str>, - page: Option, - page_size: Option, - search: Option<&str>, - user: Option, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_query_application = application; - let p_query_ordering = ordering; - let p_query_page = page; - let p_query_page_size = page_size; - let p_query_search = search; - let p_query_user = user; - - let uri_str = format!("{}/core/user_consent/", configuration.base_path); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref param_value) = p_query_application { - req_builder = req_builder.query(&[("application", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_ordering { - req_builder = req_builder.query(&[("ordering", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_page { - req_builder = req_builder.query(&[("page", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_page_size { - req_builder = req_builder.query(&[("page_size", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_search { - req_builder = req_builder.query(&[("search", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_user { - req_builder = req_builder.query(&[("user", ¶m_value.to_string())]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::PaginatedUserConsentList`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::PaginatedUserConsentList`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// UserConsent Viewset -pub async fn core_user_consent_retrieve( - configuration: &configuration::Configuration, - id: i32, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_id = id; - - let uri_str = format!( - "{}/core/user_consent/{id}/", - configuration.base_path, - id = p_path_id - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::UserConsent`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::UserConsent`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Get a list of all objects that use this object -pub async fn core_user_consent_used_by_list( - configuration: &configuration::Configuration, - id: i32, -) -> Result, Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_id = id; - - let uri_str = format!( - "{}/core/user_consent/{id}/used_by/", - configuration.base_path, - id = p_path_id - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `Vec<models::UsedBy>`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `Vec<models::UsedBy>`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// User Viewset -pub async fn core_users_create( - configuration: &configuration::Configuration, - user_request: models::UserRequest, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_body_user_request = user_request; - - let uri_str = format!("{}/core/users/", configuration.base_path); - let mut req_builder = configuration - .client - .request(reqwest::Method::POST, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - req_builder = req_builder.json(&p_body_user_request); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::User`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::User`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// User Viewset -pub async fn core_users_destroy( - configuration: &configuration::Configuration, - id: i32, -) -> Result<(), Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_id = id; - - let uri_str = format!( - "{}/core/users/{id}/", - configuration.base_path, - id = p_path_id - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::DELETE, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - - if !status.is_client_error() && !status.is_server_error() { - Ok(()) - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// 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 -pub async fn core_users_export_create( - configuration: &configuration::Configuration, - attributes: Option<&str>, - date_joined: Option, - date_joined__gt: Option, - date_joined__lt: Option, - email: Option<&str>, - groups_by_name: Option>, - groups_by_pk: Option>, - is_active: Option, - is_superuser: Option, - last_login: Option, - last_login__gt: Option, - last_login__isnull: Option, - last_login__lt: Option, - last_updated: Option, - last_updated__gt: Option, - last_updated__lt: Option, - name: Option<&str>, - ordering: Option<&str>, - path: Option<&str>, - path_startswith: Option<&str>, - roles_by_name: Option>, - roles_by_pk: Option>, - search: Option<&str>, - r#type: Option>, - username: Option<&str>, - uuid: Option<&str>, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_query_attributes = attributes; - let p_query_date_joined = date_joined; - let p_query_date_joined__gt = date_joined__gt; - let p_query_date_joined__lt = date_joined__lt; - let p_query_email = email; - let p_query_groups_by_name = groups_by_name; - let p_query_groups_by_pk = groups_by_pk; - let p_query_is_active = is_active; - let p_query_is_superuser = is_superuser; - let p_query_last_login = last_login; - let p_query_last_login__gt = last_login__gt; - let p_query_last_login__isnull = last_login__isnull; - let p_query_last_login__lt = last_login__lt; - let p_query_last_updated = last_updated; - let p_query_last_updated__gt = last_updated__gt; - let p_query_last_updated__lt = last_updated__lt; - let p_query_name = name; - let p_query_ordering = ordering; - let p_query_path = path; - let p_query_path_startswith = path_startswith; - let p_query_roles_by_name = roles_by_name; - let p_query_roles_by_pk = roles_by_pk; - let p_query_search = search; - let p_query_type = r#type; - let p_query_username = username; - let p_query_uuid = uuid; - - let uri_str = format!("{}/core/users/export/", configuration.base_path); - let mut req_builder = configuration - .client - .request(reqwest::Method::POST, &uri_str); - - if let Some(ref param_value) = p_query_attributes { - req_builder = req_builder.query(&[("attributes", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_date_joined { - req_builder = req_builder.query(&[("date_joined", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_date_joined__gt { - req_builder = req_builder.query(&[("date_joined__gt", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_date_joined__lt { - req_builder = req_builder.query(&[("date_joined__lt", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_email { - req_builder = req_builder.query(&[("email", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_groups_by_name { - req_builder = match "multi" { - "multi" => req_builder.query( - ¶m_value - .into_iter() - .map(|p| ("groups_by_name".to_owned(), p.to_string())) - .collect::>(), - ), - _ => req_builder.query(&[( - "groups_by_name", - ¶m_value - .into_iter() - .map(|p| p.to_string()) - .collect::>() - .join(",") - .to_string(), - )]), - }; - } - if let Some(ref param_value) = p_query_groups_by_pk { - req_builder = match "multi" { - "multi" => req_builder.query( - ¶m_value - .into_iter() - .map(|p| ("groups_by_pk".to_owned(), p.to_string())) - .collect::>(), - ), - _ => req_builder.query(&[( - "groups_by_pk", - ¶m_value - .into_iter() - .map(|p| p.to_string()) - .collect::>() - .join(",") - .to_string(), - )]), - }; - } - if let Some(ref param_value) = p_query_is_active { - req_builder = req_builder.query(&[("is_active", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_is_superuser { - req_builder = req_builder.query(&[("is_superuser", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_last_login { - req_builder = req_builder.query(&[("last_login", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_last_login__gt { - req_builder = req_builder.query(&[("last_login__gt", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_last_login__isnull { - req_builder = req_builder.query(&[("last_login__isnull", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_last_login__lt { - req_builder = req_builder.query(&[("last_login__lt", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_last_updated { - req_builder = req_builder.query(&[("last_updated", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_last_updated__gt { - req_builder = req_builder.query(&[("last_updated__gt", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_last_updated__lt { - req_builder = req_builder.query(&[("last_updated__lt", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_name { - req_builder = req_builder.query(&[("name", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_ordering { - req_builder = req_builder.query(&[("ordering", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_path { - req_builder = req_builder.query(&[("path", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_path_startswith { - req_builder = req_builder.query(&[("path_startswith", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_roles_by_name { - req_builder = match "multi" { - "multi" => req_builder.query( - ¶m_value - .into_iter() - .map(|p| ("roles_by_name".to_owned(), p.to_string())) - .collect::>(), - ), - _ => req_builder.query(&[( - "roles_by_name", - ¶m_value - .into_iter() - .map(|p| p.to_string()) - .collect::>() - .join(",") - .to_string(), - )]), - }; - } - if let Some(ref param_value) = p_query_roles_by_pk { - req_builder = match "multi" { - "multi" => req_builder.query( - ¶m_value - .into_iter() - .map(|p| ("roles_by_pk".to_owned(), p.to_string())) - .collect::>(), - ), - _ => req_builder.query(&[( - "roles_by_pk", - ¶m_value - .into_iter() - .map(|p| p.to_string()) - .collect::>() - .join(",") - .to_string(), - )]), - }; - } - if let Some(ref param_value) = p_query_search { - req_builder = req_builder.query(&[("search", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_type { - req_builder = match "multi" { - "multi" => req_builder.query( - ¶m_value - .into_iter() - .map(|p| ("type".to_owned(), p.to_string())) - .collect::>(), - ), - _ => req_builder.query(&[( - "type", - ¶m_value - .into_iter() - .map(|p| p.to_string()) - .collect::>() - .join(",") - .to_string(), - )]), - }; - } - if let Some(ref param_value) = p_query_username { - req_builder = req_builder.query(&[("username", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_uuid { - req_builder = req_builder.query(&[("uuid", ¶m_value.to_string())]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::DataExport`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::DataExport`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Impersonate a user -pub async fn core_users_impersonate_create( - configuration: &configuration::Configuration, - id: i32, - impersonation_request: models::ImpersonationRequest, -) -> Result<(), Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_id = id; - let p_body_impersonation_request = impersonation_request; - - let uri_str = format!( - "{}/core/users/{id}/impersonate/", - configuration.base_path, - id = p_path_id - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::POST, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - req_builder = req_builder.json(&p_body_impersonation_request); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - - if !status.is_client_error() && !status.is_server_error() { - Ok(()) - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// End Impersonation a user -pub async fn core_users_impersonate_end_retrieve( - configuration: &configuration::Configuration, -) -> Result<(), Error> { - let uri_str = format!("{}/core/users/impersonate_end/", configuration.base_path); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - - if !status.is_client_error() && !status.is_server_error() { - Ok(()) - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - /// User Viewset pub async fn core_users_list( configuration: &configuration::Configuration, @@ -4716,9 +612,6 @@ pub async fn core_users_list( if let Some(ref user_agent) = configuration.user_agent { req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; let req = req_builder.build()?; let resp = configuration.client.execute(req).await?; @@ -4769,9 +662,6 @@ pub async fn core_users_me_retrieve( if let Some(ref user_agent) = configuration.user_agent { req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; let req = req_builder.build()?; let resp = configuration.client.execute(req).await?; @@ -4812,243 +702,6 @@ pub async fn core_users_me_retrieve( } } -/// User Viewset -pub async fn core_users_partial_update( - configuration: &configuration::Configuration, - id: i32, - patched_user_request: Option, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_id = id; - let p_body_patched_user_request = patched_user_request; - - let uri_str = format!( - "{}/core/users/{id}/", - configuration.base_path, - id = p_path_id - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::PATCH, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - req_builder = req_builder.json(&p_body_patched_user_request); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::User`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::User`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Get all user paths -pub async fn core_users_paths_retrieve( - configuration: &configuration::Configuration, - search: Option<&str>, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_query_search = search; - - let uri_str = format!("{}/core/users/paths/", configuration.base_path); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref param_value) = p_query_search { - req_builder = req_builder.query(&[("search", ¶m_value.to_string())]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::UserPath`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::UserPath`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Create a temporary link that a user can use to recover their account -pub async fn core_users_recovery_create( - configuration: &configuration::Configuration, - id: i32, - user_recovery_link_request: Option, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_id = id; - let p_body_user_recovery_link_request = user_recovery_link_request; - - let uri_str = format!( - "{}/core/users/{id}/recovery/", - configuration.base_path, - id = p_path_id - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::POST, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - req_builder = req_builder.json(&p_body_user_recovery_link_request); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::Link`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::Link`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Send an email with a temporary link that a user can use to recover their account -pub async fn core_users_recovery_email_create( - configuration: &configuration::Configuration, - id: i32, - user_recovery_email_request: models::UserRecoveryEmailRequest, -) -> Result<(), Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_id = id; - let p_body_user_recovery_email_request = user_recovery_email_request; - - let uri_str = format!( - "{}/core/users/{id}/recovery_email/", - configuration.base_path, - id = p_path_id - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::POST, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - req_builder = req_builder.json(&p_body_user_recovery_email_request); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - - if !status.is_client_error() && !status.is_server_error() { - Ok(()) - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - /// User Viewset pub async fn core_users_retrieve( configuration: &configuration::Configuration, @@ -5067,9 +720,6 @@ pub async fn core_users_retrieve( if let Some(ref user_agent) = configuration.user_agent { req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; let req = req_builder.build()?; let resp = configuration.client.execute(req).await?; @@ -5109,234 +759,3 @@ pub async fn core_users_retrieve( })) } } - -/// Create a new user account that is marked as a service account -pub async fn core_users_service_account_create( - configuration: &configuration::Configuration, - user_service_account_request: models::UserServiceAccountRequest, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_body_user_service_account_request = user_service_account_request; - - let uri_str = format!("{}/core/users/service_account/", configuration.base_path); - let mut req_builder = configuration - .client - .request(reqwest::Method::POST, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - req_builder = req_builder.json(&p_body_user_service_account_request); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::UserServiceAccountResponse`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::UserServiceAccountResponse`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Set password for user -pub async fn core_users_set_password_create( - configuration: &configuration::Configuration, - id: i32, - user_password_set_request: models::UserPasswordSetRequest, -) -> Result<(), Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_id = id; - let p_body_user_password_set_request = user_password_set_request; - - let uri_str = format!( - "{}/core/users/{id}/set_password/", - configuration.base_path, - id = p_path_id - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::POST, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - req_builder = req_builder.json(&p_body_user_password_set_request); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - - if !status.is_client_error() && !status.is_server_error() { - Ok(()) - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// User Viewset -pub async fn core_users_update( - configuration: &configuration::Configuration, - id: i32, - user_request: models::UserRequest, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_id = id; - let p_body_user_request = user_request; - - let uri_str = format!( - "{}/core/users/{id}/", - configuration.base_path, - id = p_path_id - ); - let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - req_builder = req_builder.json(&p_body_user_request); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::User`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::User`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Get a list of all objects that use this object -pub async fn core_users_used_by_list( - configuration: &configuration::Configuration, - id: i32, -) -> Result, Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_id = id; - - let uri_str = format!( - "{}/core/users/{id}/used_by/", - configuration.base_path, - id = p_path_id - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `Vec<models::UsedBy>`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `Vec<models::UsedBy>`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} diff --git a/packages/client-rust/src/apis/crypto_api.rs b/packages/client-rust/src/apis/crypto_api.rs index 98772410e7..90a807e3ca 100644 --- a/packages/client-rust/src/apis/crypto_api.rs +++ b/packages/client-rust/src/apis/crypto_api.rs @@ -12,51 +12,6 @@ use serde::{Deserialize, Serialize, de::Error as _}; use super::{ContentType, Error, configuration}; use crate::{apis::ResponseContent, models}; -/// struct for typed errors of method [`crypto_certificatekeypairs_create`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum CryptoCertificatekeypairsCreateError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`crypto_certificatekeypairs_destroy`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum CryptoCertificatekeypairsDestroyError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`crypto_certificatekeypairs_generate_create`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum CryptoCertificatekeypairsGenerateCreateError { - Status400(), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`crypto_certificatekeypairs_list`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum CryptoCertificatekeypairsListError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`crypto_certificatekeypairs_partial_update`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum CryptoCertificatekeypairsPartialUpdateError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - /// struct for typed errors of method [`crypto_certificatekeypairs_retrieve`] #[derive(Debug, Clone, Serialize, Deserialize)] #[serde(untagged)] @@ -66,24 +21,6 @@ pub enum CryptoCertificatekeypairsRetrieveError { UnknownValue(serde_json::Value), } -/// struct for typed errors of method [`crypto_certificatekeypairs_update`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum CryptoCertificatekeypairsUpdateError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`crypto_certificatekeypairs_used_by_list`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum CryptoCertificatekeypairsUsedByListError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - /// struct for typed errors of method [`crypto_certificatekeypairs_view_certificate_retrieve`] #[derive(Debug, Clone, Serialize, Deserialize)] #[serde(untagged)] @@ -102,353 +39,6 @@ pub enum CryptoCertificatekeypairsViewPrivateKeyRetrieveError { UnknownValue(serde_json::Value), } -/// CertificateKeyPair Viewset -pub async fn crypto_certificatekeypairs_create( - configuration: &configuration::Configuration, - certificate_key_pair_request: models::CertificateKeyPairRequest, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_body_certificate_key_pair_request = certificate_key_pair_request; - - let uri_str = format!("{}/crypto/certificatekeypairs/", configuration.base_path); - let mut req_builder = configuration - .client - .request(reqwest::Method::POST, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - req_builder = req_builder.json(&p_body_certificate_key_pair_request); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::CertificateKeyPair`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::CertificateKeyPair`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// CertificateKeyPair Viewset -pub async fn crypto_certificatekeypairs_destroy( - configuration: &configuration::Configuration, - kp_uuid: &str, -) -> Result<(), Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_kp_uuid = kp_uuid; - - let uri_str = format!( - "{}/crypto/certificatekeypairs/{kp_uuid}/", - configuration.base_path, - kp_uuid = crate::apis::urlencode(p_path_kp_uuid) - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::DELETE, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - - if !status.is_client_error() && !status.is_server_error() { - Ok(()) - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Generate a new, self-signed certificate-key pair -pub async fn crypto_certificatekeypairs_generate_create( - configuration: &configuration::Configuration, - certificate_generation_request: models::CertificateGenerationRequest, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_body_certificate_generation_request = certificate_generation_request; - - let uri_str = format!( - "{}/crypto/certificatekeypairs/generate/", - configuration.base_path - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::POST, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - req_builder = req_builder.json(&p_body_certificate_generation_request); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::CertificateKeyPair`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::CertificateKeyPair`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// CertificateKeyPair Viewset -pub async fn crypto_certificatekeypairs_list( - configuration: &configuration::Configuration, - has_key: Option, - key_type: Option>, - managed: Option<&str>, - name: Option<&str>, - ordering: Option<&str>, - page: Option, - page_size: Option, - search: Option<&str>, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_query_has_key = has_key; - let p_query_key_type = key_type; - let p_query_managed = managed; - let p_query_name = name; - let p_query_ordering = ordering; - let p_query_page = page; - let p_query_page_size = page_size; - let p_query_search = search; - - let uri_str = format!("{}/crypto/certificatekeypairs/", configuration.base_path); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref param_value) = p_query_has_key { - req_builder = req_builder.query(&[("has_key", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_key_type { - req_builder = match "multi" { - "multi" => req_builder.query( - ¶m_value - .into_iter() - .map(|p| ("key_type".to_owned(), p.to_string())) - .collect::>(), - ), - _ => req_builder.query(&[( - "key_type", - ¶m_value - .into_iter() - .map(|p| p.to_string()) - .collect::>() - .join(",") - .to_string(), - )]), - }; - } - if let Some(ref param_value) = p_query_managed { - req_builder = req_builder.query(&[("managed", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_name { - req_builder = req_builder.query(&[("name", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_ordering { - req_builder = req_builder.query(&[("ordering", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_page { - req_builder = req_builder.query(&[("page", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_page_size { - req_builder = req_builder.query(&[("page_size", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_search { - req_builder = req_builder.query(&[("search", ¶m_value.to_string())]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::PaginatedCertificateKeyPairList`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::PaginatedCertificateKeyPairList`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// CertificateKeyPair Viewset -pub async fn crypto_certificatekeypairs_partial_update( - configuration: &configuration::Configuration, - kp_uuid: &str, - patched_certificate_key_pair_request: Option, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_kp_uuid = kp_uuid; - let p_body_patched_certificate_key_pair_request = patched_certificate_key_pair_request; - - let uri_str = format!( - "{}/crypto/certificatekeypairs/{kp_uuid}/", - configuration.base_path, - kp_uuid = crate::apis::urlencode(p_path_kp_uuid) - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::PATCH, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - req_builder = req_builder.json(&p_body_patched_certificate_key_pair_request); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::CertificateKeyPair`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::CertificateKeyPair`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - /// CertificateKeyPair Viewset pub async fn crypto_certificatekeypairs_retrieve( configuration: &configuration::Configuration, @@ -467,9 +57,6 @@ pub async fn crypto_certificatekeypairs_retrieve( if let Some(ref user_agent) = configuration.user_agent { req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; let req = req_builder.build()?; let resp = configuration.client.execute(req).await?; @@ -511,133 +98,6 @@ pub async fn crypto_certificatekeypairs_retrieve( } } -/// CertificateKeyPair Viewset -pub async fn crypto_certificatekeypairs_update( - configuration: &configuration::Configuration, - kp_uuid: &str, - certificate_key_pair_request: models::CertificateKeyPairRequest, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_kp_uuid = kp_uuid; - let p_body_certificate_key_pair_request = certificate_key_pair_request; - - let uri_str = format!( - "{}/crypto/certificatekeypairs/{kp_uuid}/", - configuration.base_path, - kp_uuid = crate::apis::urlencode(p_path_kp_uuid) - ); - let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - req_builder = req_builder.json(&p_body_certificate_key_pair_request); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::CertificateKeyPair`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::CertificateKeyPair`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Get a list of all objects that use this object -pub async fn crypto_certificatekeypairs_used_by_list( - configuration: &configuration::Configuration, - kp_uuid: &str, -) -> Result, Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_kp_uuid = kp_uuid; - - let uri_str = format!( - "{}/crypto/certificatekeypairs/{kp_uuid}/used_by/", - configuration.base_path, - kp_uuid = crate::apis::urlencode(p_path_kp_uuid) - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `Vec<models::UsedBy>`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `Vec<models::UsedBy>`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - /// Return certificate-key pairs certificate and log access pub async fn crypto_certificatekeypairs_view_certificate_retrieve( configuration: &configuration::Configuration, @@ -661,9 +121,6 @@ pub async fn crypto_certificatekeypairs_view_certificate_retrieve( if let Some(ref user_agent) = configuration.user_agent { req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; let req = req_builder.build()?; let resp = configuration.client.execute(req).await?; @@ -728,9 +185,6 @@ pub async fn crypto_certificatekeypairs_view_private_key_retrieve( if let Some(ref user_agent) = configuration.user_agent { req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; let req = req_builder.build()?; let resp = configuration.client.execute(req).await?; diff --git a/packages/client-rust/src/apis/endpoints_api.rs b/packages/client-rust/src/apis/endpoints_api.rs deleted file mode 100644 index 0f8836b0ac..0000000000 --- a/packages/client-rust/src/apis/endpoints_api.rs +++ /dev/null @@ -1,4561 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use reqwest; -use serde::{Deserialize, Serialize, de::Error as _}; - -use super::{ContentType, Error, configuration}; -use crate::{apis::ResponseContent, models}; - -/// struct for typed errors of method [`endpoints_agents_connectors_agent_config_retrieve`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum EndpointsAgentsConnectorsAgentConfigRetrieveError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`endpoints_agents_connectors_auth_fed_create`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum EndpointsAgentsConnectorsAuthFedCreateError { - Status404(), - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`endpoints_agents_connectors_auth_ia_create`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum EndpointsAgentsConnectorsAuthIaCreateError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`endpoints_agents_connectors_check_in_create`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum EndpointsAgentsConnectorsCheckInCreateError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`endpoints_agents_connectors_create`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum EndpointsAgentsConnectorsCreateError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`endpoints_agents_connectors_destroy`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum EndpointsAgentsConnectorsDestroyError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`endpoints_agents_connectors_enroll_create`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum EndpointsAgentsConnectorsEnrollCreateError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`endpoints_agents_connectors_list`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum EndpointsAgentsConnectorsListError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`endpoints_agents_connectors_mdm_config_create`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum EndpointsAgentsConnectorsMdmConfigCreateError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`endpoints_agents_connectors_partial_update`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum EndpointsAgentsConnectorsPartialUpdateError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`endpoints_agents_connectors_retrieve`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum EndpointsAgentsConnectorsRetrieveError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`endpoints_agents_connectors_update`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum EndpointsAgentsConnectorsUpdateError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`endpoints_agents_connectors_used_by_list`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum EndpointsAgentsConnectorsUsedByListError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`endpoints_agents_enrollment_tokens_create`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum EndpointsAgentsEnrollmentTokensCreateError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`endpoints_agents_enrollment_tokens_destroy`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum EndpointsAgentsEnrollmentTokensDestroyError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`endpoints_agents_enrollment_tokens_list`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum EndpointsAgentsEnrollmentTokensListError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`endpoints_agents_enrollment_tokens_partial_update`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum EndpointsAgentsEnrollmentTokensPartialUpdateError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`endpoints_agents_enrollment_tokens_retrieve`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum EndpointsAgentsEnrollmentTokensRetrieveError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`endpoints_agents_enrollment_tokens_update`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum EndpointsAgentsEnrollmentTokensUpdateError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`endpoints_agents_enrollment_tokens_used_by_list`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum EndpointsAgentsEnrollmentTokensUsedByListError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`endpoints_agents_enrollment_tokens_view_key_retrieve`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum EndpointsAgentsEnrollmentTokensViewKeyRetrieveError { - Status404(), - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`endpoints_agents_psso_register_device_create`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum EndpointsAgentsPssoRegisterDeviceCreateError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`endpoints_agents_psso_register_user_create`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum EndpointsAgentsPssoRegisterUserCreateError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`endpoints_connectors_destroy`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum EndpointsConnectorsDestroyError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`endpoints_connectors_list`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum EndpointsConnectorsListError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`endpoints_connectors_retrieve`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum EndpointsConnectorsRetrieveError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`endpoints_connectors_types_list`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum EndpointsConnectorsTypesListError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`endpoints_connectors_used_by_list`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum EndpointsConnectorsUsedByListError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`endpoints_device_access_groups_create`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum EndpointsDeviceAccessGroupsCreateError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`endpoints_device_access_groups_destroy`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum EndpointsDeviceAccessGroupsDestroyError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`endpoints_device_access_groups_list`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum EndpointsDeviceAccessGroupsListError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`endpoints_device_access_groups_partial_update`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum EndpointsDeviceAccessGroupsPartialUpdateError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`endpoints_device_access_groups_retrieve`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum EndpointsDeviceAccessGroupsRetrieveError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`endpoints_device_access_groups_update`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum EndpointsDeviceAccessGroupsUpdateError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`endpoints_device_access_groups_used_by_list`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum EndpointsDeviceAccessGroupsUsedByListError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`endpoints_device_bindings_create`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum EndpointsDeviceBindingsCreateError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`endpoints_device_bindings_destroy`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum EndpointsDeviceBindingsDestroyError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`endpoints_device_bindings_list`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum EndpointsDeviceBindingsListError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`endpoints_device_bindings_partial_update`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum EndpointsDeviceBindingsPartialUpdateError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`endpoints_device_bindings_retrieve`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum EndpointsDeviceBindingsRetrieveError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`endpoints_device_bindings_update`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum EndpointsDeviceBindingsUpdateError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`endpoints_device_bindings_used_by_list`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum EndpointsDeviceBindingsUsedByListError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`endpoints_devices_destroy`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum EndpointsDevicesDestroyError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`endpoints_devices_list`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum EndpointsDevicesListError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`endpoints_devices_partial_update`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum EndpointsDevicesPartialUpdateError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`endpoints_devices_retrieve`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum EndpointsDevicesRetrieveError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`endpoints_devices_summary_retrieve`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum EndpointsDevicesSummaryRetrieveError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`endpoints_devices_update`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum EndpointsDevicesUpdateError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`endpoints_devices_used_by_list`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum EndpointsDevicesUsedByListError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`endpoints_fleet_connectors_create`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum EndpointsFleetConnectorsCreateError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`endpoints_fleet_connectors_destroy`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum EndpointsFleetConnectorsDestroyError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`endpoints_fleet_connectors_list`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum EndpointsFleetConnectorsListError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`endpoints_fleet_connectors_partial_update`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum EndpointsFleetConnectorsPartialUpdateError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`endpoints_fleet_connectors_retrieve`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum EndpointsFleetConnectorsRetrieveError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`endpoints_fleet_connectors_update`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum EndpointsFleetConnectorsUpdateError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`endpoints_fleet_connectors_used_by_list`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum EndpointsFleetConnectorsUsedByListError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`endpoints_google_chrome_connectors_create`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum EndpointsGoogleChromeConnectorsCreateError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`endpoints_google_chrome_connectors_destroy`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum EndpointsGoogleChromeConnectorsDestroyError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`endpoints_google_chrome_connectors_list`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum EndpointsGoogleChromeConnectorsListError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`endpoints_google_chrome_connectors_partial_update`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum EndpointsGoogleChromeConnectorsPartialUpdateError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`endpoints_google_chrome_connectors_retrieve`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum EndpointsGoogleChromeConnectorsRetrieveError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`endpoints_google_chrome_connectors_update`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum EndpointsGoogleChromeConnectorsUpdateError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`endpoints_google_chrome_connectors_used_by_list`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum EndpointsGoogleChromeConnectorsUsedByListError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// Mixin to add a used_by endpoint to return a list of all objects using this object -pub async fn endpoints_agents_connectors_agent_config_retrieve( - configuration: &configuration::Configuration, -) -> Result> { - let uri_str = format!( - "{}/endpoints/agents/connectors/agent_config/", - configuration.base_path - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::AgentConfig`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::AgentConfig`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Mixin to add a used_by endpoint to return a list of all objects using this object -pub async fn endpoints_agents_connectors_auth_fed_create( - configuration: &configuration::Configuration, - device: &str, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_query_device = device; - - let uri_str = format!( - "{}/endpoints/agents/connectors/auth_fed/", - configuration.base_path - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::POST, &uri_str); - - req_builder = req_builder.query(&[("device", &p_query_device.to_string())]); - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::AgentTokenResponse`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::AgentTokenResponse`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Mixin to add a used_by endpoint to return a list of all objects using this object -pub async fn endpoints_agents_connectors_auth_ia_create( - configuration: &configuration::Configuration, -) -> Result> -{ - let uri_str = format!( - "{}/endpoints/agents/connectors/auth_ia/", - configuration.base_path - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::POST, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::AgentAuthenticationResponse`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::AgentAuthenticationResponse`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Mixin to add a used_by endpoint to return a list of all objects using this object -pub async fn endpoints_agents_connectors_check_in_create( - configuration: &configuration::Configuration, - device_facts_request: Option, -) -> Result<(), Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_body_device_facts_request = device_facts_request; - - let uri_str = format!( - "{}/endpoints/agents/connectors/check_in/", - configuration.base_path - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::POST, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - req_builder = req_builder.json(&p_body_device_facts_request); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - - if !status.is_client_error() && !status.is_server_error() { - Ok(()) - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Mixin to add a used_by endpoint to return a list of all objects using this object -pub async fn endpoints_agents_connectors_create( - configuration: &configuration::Configuration, - agent_connector_request: models::AgentConnectorRequest, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_body_agent_connector_request = agent_connector_request; - - let uri_str = format!("{}/endpoints/agents/connectors/", configuration.base_path); - let mut req_builder = configuration - .client - .request(reqwest::Method::POST, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - req_builder = req_builder.json(&p_body_agent_connector_request); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::AgentConnector`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::AgentConnector`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Mixin to add a used_by endpoint to return a list of all objects using this object -pub async fn endpoints_agents_connectors_destroy( - configuration: &configuration::Configuration, - connector_uuid: &str, -) -> Result<(), Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_connector_uuid = connector_uuid; - - let uri_str = format!( - "{}/endpoints/agents/connectors/{connector_uuid}/", - configuration.base_path, - connector_uuid = crate::apis::urlencode(p_path_connector_uuid) - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::DELETE, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - - if !status.is_client_error() && !status.is_server_error() { - Ok(()) - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Mixin to add a used_by endpoint to return a list of all objects using this object -pub async fn endpoints_agents_connectors_enroll_create( - configuration: &configuration::Configuration, - enroll_request: models::EnrollRequest, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_body_enroll_request = enroll_request; - - let uri_str = format!( - "{}/endpoints/agents/connectors/enroll/", - configuration.base_path - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::POST, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - req_builder = req_builder.json(&p_body_enroll_request); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::AgentTokenResponse`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::AgentTokenResponse`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Mixin to add a used_by endpoint to return a list of all objects using this object -pub async fn endpoints_agents_connectors_list( - configuration: &configuration::Configuration, - enabled: Option, - name: Option<&str>, - ordering: Option<&str>, - page: Option, - page_size: Option, - search: Option<&str>, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_query_enabled = enabled; - let p_query_name = name; - let p_query_ordering = ordering; - let p_query_page = page; - let p_query_page_size = page_size; - let p_query_search = search; - - let uri_str = format!("{}/endpoints/agents/connectors/", configuration.base_path); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref param_value) = p_query_enabled { - req_builder = req_builder.query(&[("enabled", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_name { - req_builder = req_builder.query(&[("name", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_ordering { - req_builder = req_builder.query(&[("ordering", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_page { - req_builder = req_builder.query(&[("page", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_page_size { - req_builder = req_builder.query(&[("page_size", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_search { - req_builder = req_builder.query(&[("search", ¶m_value.to_string())]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::PaginatedAgentConnectorList`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::PaginatedAgentConnectorList`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Generate configuration for MDM systems to deploy authentik Agent -pub async fn endpoints_agents_connectors_mdm_config_create( - configuration: &configuration::Configuration, - connector_uuid: &str, - mdm_config_request: models::MdmConfigRequest, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_connector_uuid = connector_uuid; - let p_body_mdm_config_request = mdm_config_request; - - let uri_str = format!( - "{}/endpoints/agents/connectors/{connector_uuid}/mdm_config/", - configuration.base_path, - connector_uuid = crate::apis::urlencode(p_path_connector_uuid) - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::POST, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - req_builder = req_builder.json(&p_body_mdm_config_request); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::MdmConfigResponse`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::MdmConfigResponse`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Mixin to add a used_by endpoint to return a list of all objects using this object -pub async fn endpoints_agents_connectors_partial_update( - configuration: &configuration::Configuration, - connector_uuid: &str, - patched_agent_connector_request: Option, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_connector_uuid = connector_uuid; - let p_body_patched_agent_connector_request = patched_agent_connector_request; - - let uri_str = format!( - "{}/endpoints/agents/connectors/{connector_uuid}/", - configuration.base_path, - connector_uuid = crate::apis::urlencode(p_path_connector_uuid) - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::PATCH, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - req_builder = req_builder.json(&p_body_patched_agent_connector_request); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::AgentConnector`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::AgentConnector`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Mixin to add a used_by endpoint to return a list of all objects using this object -pub async fn endpoints_agents_connectors_retrieve( - configuration: &configuration::Configuration, - connector_uuid: &str, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_connector_uuid = connector_uuid; - - let uri_str = format!( - "{}/endpoints/agents/connectors/{connector_uuid}/", - configuration.base_path, - connector_uuid = crate::apis::urlencode(p_path_connector_uuid) - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::AgentConnector`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::AgentConnector`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Mixin to add a used_by endpoint to return a list of all objects using this object -pub async fn endpoints_agents_connectors_update( - configuration: &configuration::Configuration, - connector_uuid: &str, - agent_connector_request: models::AgentConnectorRequest, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_connector_uuid = connector_uuid; - let p_body_agent_connector_request = agent_connector_request; - - let uri_str = format!( - "{}/endpoints/agents/connectors/{connector_uuid}/", - configuration.base_path, - connector_uuid = crate::apis::urlencode(p_path_connector_uuid) - ); - let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - req_builder = req_builder.json(&p_body_agent_connector_request); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::AgentConnector`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::AgentConnector`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Get a list of all objects that use this object -pub async fn endpoints_agents_connectors_used_by_list( - configuration: &configuration::Configuration, - connector_uuid: &str, -) -> Result, Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_connector_uuid = connector_uuid; - - let uri_str = format!( - "{}/endpoints/agents/connectors/{connector_uuid}/used_by/", - configuration.base_path, - connector_uuid = crate::apis::urlencode(p_path_connector_uuid) - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `Vec<models::UsedBy>`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `Vec<models::UsedBy>`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Mixin to add a used_by endpoint to return a list of all objects using this object -pub async fn endpoints_agents_enrollment_tokens_create( - configuration: &configuration::Configuration, - enrollment_token_request: models::EnrollmentTokenRequest, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_body_enrollment_token_request = enrollment_token_request; - - let uri_str = format!( - "{}/endpoints/agents/enrollment_tokens/", - configuration.base_path - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::POST, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - req_builder = req_builder.json(&p_body_enrollment_token_request); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::EnrollmentToken`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::EnrollmentToken`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Mixin to add a used_by endpoint to return a list of all objects using this object -pub async fn endpoints_agents_enrollment_tokens_destroy( - configuration: &configuration::Configuration, - token_uuid: &str, -) -> Result<(), Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_token_uuid = token_uuid; - - let uri_str = format!( - "{}/endpoints/agents/enrollment_tokens/{token_uuid}/", - configuration.base_path, - token_uuid = crate::apis::urlencode(p_path_token_uuid) - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::DELETE, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - - if !status.is_client_error() && !status.is_server_error() { - Ok(()) - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Mixin to add a used_by endpoint to return a list of all objects using this object -pub async fn endpoints_agents_enrollment_tokens_list( - configuration: &configuration::Configuration, - connector: Option<&str>, - ordering: Option<&str>, - page: Option, - page_size: Option, - search: Option<&str>, - token_uuid: Option<&str>, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_query_connector = connector; - let p_query_ordering = ordering; - let p_query_page = page; - let p_query_page_size = page_size; - let p_query_search = search; - let p_query_token_uuid = token_uuid; - - let uri_str = format!( - "{}/endpoints/agents/enrollment_tokens/", - configuration.base_path - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref param_value) = p_query_connector { - req_builder = req_builder.query(&[("connector", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_ordering { - req_builder = req_builder.query(&[("ordering", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_page { - req_builder = req_builder.query(&[("page", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_page_size { - req_builder = req_builder.query(&[("page_size", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_search { - req_builder = req_builder.query(&[("search", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_token_uuid { - req_builder = req_builder.query(&[("token_uuid", ¶m_value.to_string())]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::PaginatedEnrollmentTokenList`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::PaginatedEnrollmentTokenList`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Mixin to add a used_by endpoint to return a list of all objects using this object -pub async fn endpoints_agents_enrollment_tokens_partial_update( - configuration: &configuration::Configuration, - token_uuid: &str, - patched_enrollment_token_request: Option, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_token_uuid = token_uuid; - let p_body_patched_enrollment_token_request = patched_enrollment_token_request; - - let uri_str = format!( - "{}/endpoints/agents/enrollment_tokens/{token_uuid}/", - configuration.base_path, - token_uuid = crate::apis::urlencode(p_path_token_uuid) - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::PATCH, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - req_builder = req_builder.json(&p_body_patched_enrollment_token_request); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::EnrollmentToken`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::EnrollmentToken`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Mixin to add a used_by endpoint to return a list of all objects using this object -pub async fn endpoints_agents_enrollment_tokens_retrieve( - configuration: &configuration::Configuration, - token_uuid: &str, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_token_uuid = token_uuid; - - let uri_str = format!( - "{}/endpoints/agents/enrollment_tokens/{token_uuid}/", - configuration.base_path, - token_uuid = crate::apis::urlencode(p_path_token_uuid) - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::EnrollmentToken`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::EnrollmentToken`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Mixin to add a used_by endpoint to return a list of all objects using this object -pub async fn endpoints_agents_enrollment_tokens_update( - configuration: &configuration::Configuration, - token_uuid: &str, - enrollment_token_request: models::EnrollmentTokenRequest, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_token_uuid = token_uuid; - let p_body_enrollment_token_request = enrollment_token_request; - - let uri_str = format!( - "{}/endpoints/agents/enrollment_tokens/{token_uuid}/", - configuration.base_path, - token_uuid = crate::apis::urlencode(p_path_token_uuid) - ); - let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - req_builder = req_builder.json(&p_body_enrollment_token_request); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::EnrollmentToken`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::EnrollmentToken`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Get a list of all objects that use this object -pub async fn endpoints_agents_enrollment_tokens_used_by_list( - configuration: &configuration::Configuration, - token_uuid: &str, -) -> Result, Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_token_uuid = token_uuid; - - let uri_str = format!( - "{}/endpoints/agents/enrollment_tokens/{token_uuid}/used_by/", - configuration.base_path, - token_uuid = crate::apis::urlencode(p_path_token_uuid) - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `Vec<models::UsedBy>`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `Vec<models::UsedBy>`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Return token key and log access -pub async fn endpoints_agents_enrollment_tokens_view_key_retrieve( - configuration: &configuration::Configuration, - token_uuid: &str, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_token_uuid = token_uuid; - - let uri_str = format!( - "{}/endpoints/agents/enrollment_tokens/{token_uuid}/view_key/", - configuration.base_path, - token_uuid = crate::apis::urlencode(p_path_token_uuid) - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::TokenView`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::TokenView`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -pub async fn endpoints_agents_psso_register_device_create( - configuration: &configuration::Configuration, - agent_psso_device_registration_request: models::AgentPssoDeviceRegistrationRequest, -) -> Result< - models::AgentPssoDeviceRegistrationResponse, - Error, -> { - // add a prefix to parameters to efficiently prevent name collisions - let p_body_agent_psso_device_registration_request = agent_psso_device_registration_request; - - let uri_str = format!( - "{}/endpoints/agents/psso/register/device/", - configuration.base_path - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::POST, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - req_builder = req_builder.json(&p_body_agent_psso_device_registration_request); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::AgentPssoDeviceRegistrationResponse`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::AgentPssoDeviceRegistrationResponse`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -pub async fn endpoints_agents_psso_register_user_create( - configuration: &configuration::Configuration, - agent_psso_user_registration_request: models::AgentPssoUserRegistrationRequest, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_body_agent_psso_user_registration_request = agent_psso_user_registration_request; - - let uri_str = format!( - "{}/endpoints/agents/psso/register/user/", - configuration.base_path - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::POST, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - req_builder = req_builder.json(&p_body_agent_psso_user_registration_request); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::UserSelf`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::UserSelf`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Connector Viewset -pub async fn endpoints_connectors_destroy( - configuration: &configuration::Configuration, - connector_uuid: &str, -) -> Result<(), Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_connector_uuid = connector_uuid; - - let uri_str = format!( - "{}/endpoints/connectors/{connector_uuid}/", - configuration.base_path, - connector_uuid = crate::apis::urlencode(p_path_connector_uuid) - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::DELETE, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - - if !status.is_client_error() && !status.is_server_error() { - Ok(()) - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Connector Viewset -pub async fn endpoints_connectors_list( - configuration: &configuration::Configuration, - ordering: Option<&str>, - page: Option, - page_size: Option, - search: Option<&str>, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_query_ordering = ordering; - let p_query_page = page; - let p_query_page_size = page_size; - let p_query_search = search; - - let uri_str = format!("{}/endpoints/connectors/", configuration.base_path); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref param_value) = p_query_ordering { - req_builder = req_builder.query(&[("ordering", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_page { - req_builder = req_builder.query(&[("page", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_page_size { - req_builder = req_builder.query(&[("page_size", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_search { - req_builder = req_builder.query(&[("search", ¶m_value.to_string())]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::PaginatedConnectorList`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::PaginatedConnectorList`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Connector Viewset -pub async fn endpoints_connectors_retrieve( - configuration: &configuration::Configuration, - connector_uuid: &str, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_connector_uuid = connector_uuid; - - let uri_str = format!( - "{}/endpoints/connectors/{connector_uuid}/", - configuration.base_path, - connector_uuid = crate::apis::urlencode(p_path_connector_uuid) - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::Connector`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::Connector`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Get all creatable types -pub async fn endpoints_connectors_types_list( - configuration: &configuration::Configuration, -) -> Result, Error> { - let uri_str = format!("{}/endpoints/connectors/types/", configuration.base_path); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `Vec<models::TypeCreate>`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `Vec<models::TypeCreate>`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Get a list of all objects that use this object -pub async fn endpoints_connectors_used_by_list( - configuration: &configuration::Configuration, - connector_uuid: &str, -) -> Result, Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_connector_uuid = connector_uuid; - - let uri_str = format!( - "{}/endpoints/connectors/{connector_uuid}/used_by/", - configuration.base_path, - connector_uuid = crate::apis::urlencode(p_path_connector_uuid) - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `Vec<models::UsedBy>`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `Vec<models::UsedBy>`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// DeviceAccessGroup Viewset -pub async fn endpoints_device_access_groups_create( - configuration: &configuration::Configuration, - device_access_group_request: models::DeviceAccessGroupRequest, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_body_device_access_group_request = device_access_group_request; - - let uri_str = format!( - "{}/endpoints/device_access_groups/", - configuration.base_path - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::POST, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - req_builder = req_builder.json(&p_body_device_access_group_request); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::DeviceAccessGroup`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::DeviceAccessGroup`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// DeviceAccessGroup Viewset -pub async fn endpoints_device_access_groups_destroy( - configuration: &configuration::Configuration, - pbm_uuid: &str, -) -> Result<(), Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_pbm_uuid = pbm_uuid; - - let uri_str = format!( - "{}/endpoints/device_access_groups/{pbm_uuid}/", - configuration.base_path, - pbm_uuid = crate::apis::urlencode(p_path_pbm_uuid) - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::DELETE, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - - if !status.is_client_error() && !status.is_server_error() { - Ok(()) - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// DeviceAccessGroup Viewset -pub async fn endpoints_device_access_groups_list( - configuration: &configuration::Configuration, - name: Option<&str>, - ordering: Option<&str>, - page: Option, - page_size: Option, - pbm_uuid: Option<&str>, - search: Option<&str>, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_query_name = name; - let p_query_ordering = ordering; - let p_query_page = page; - let p_query_page_size = page_size; - let p_query_pbm_uuid = pbm_uuid; - let p_query_search = search; - - let uri_str = format!( - "{}/endpoints/device_access_groups/", - configuration.base_path - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref param_value) = p_query_name { - req_builder = req_builder.query(&[("name", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_ordering { - req_builder = req_builder.query(&[("ordering", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_page { - req_builder = req_builder.query(&[("page", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_page_size { - req_builder = req_builder.query(&[("page_size", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_pbm_uuid { - req_builder = req_builder.query(&[("pbm_uuid", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_search { - req_builder = req_builder.query(&[("search", ¶m_value.to_string())]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::PaginatedDeviceAccessGroupList`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::PaginatedDeviceAccessGroupList`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// DeviceAccessGroup Viewset -pub async fn endpoints_device_access_groups_partial_update( - configuration: &configuration::Configuration, - pbm_uuid: &str, - patched_device_access_group_request: Option, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_pbm_uuid = pbm_uuid; - let p_body_patched_device_access_group_request = patched_device_access_group_request; - - let uri_str = format!( - "{}/endpoints/device_access_groups/{pbm_uuid}/", - configuration.base_path, - pbm_uuid = crate::apis::urlencode(p_path_pbm_uuid) - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::PATCH, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - req_builder = req_builder.json(&p_body_patched_device_access_group_request); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::DeviceAccessGroup`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::DeviceAccessGroup`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// DeviceAccessGroup Viewset -pub async fn endpoints_device_access_groups_retrieve( - configuration: &configuration::Configuration, - pbm_uuid: &str, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_pbm_uuid = pbm_uuid; - - let uri_str = format!( - "{}/endpoints/device_access_groups/{pbm_uuid}/", - configuration.base_path, - pbm_uuid = crate::apis::urlencode(p_path_pbm_uuid) - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::DeviceAccessGroup`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::DeviceAccessGroup`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// DeviceAccessGroup Viewset -pub async fn endpoints_device_access_groups_update( - configuration: &configuration::Configuration, - pbm_uuid: &str, - device_access_group_request: models::DeviceAccessGroupRequest, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_pbm_uuid = pbm_uuid; - let p_body_device_access_group_request = device_access_group_request; - - let uri_str = format!( - "{}/endpoints/device_access_groups/{pbm_uuid}/", - configuration.base_path, - pbm_uuid = crate::apis::urlencode(p_path_pbm_uuid) - ); - let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - req_builder = req_builder.json(&p_body_device_access_group_request); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::DeviceAccessGroup`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::DeviceAccessGroup`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Get a list of all objects that use this object -pub async fn endpoints_device_access_groups_used_by_list( - configuration: &configuration::Configuration, - pbm_uuid: &str, -) -> Result, Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_pbm_uuid = pbm_uuid; - - let uri_str = format!( - "{}/endpoints/device_access_groups/{pbm_uuid}/used_by/", - configuration.base_path, - pbm_uuid = crate::apis::urlencode(p_path_pbm_uuid) - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `Vec<models::UsedBy>`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `Vec<models::UsedBy>`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// PolicyBinding Viewset -pub async fn endpoints_device_bindings_create( - configuration: &configuration::Configuration, - device_user_binding_request: models::DeviceUserBindingRequest, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_body_device_user_binding_request = device_user_binding_request; - - let uri_str = format!("{}/endpoints/device_bindings/", configuration.base_path); - let mut req_builder = configuration - .client - .request(reqwest::Method::POST, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - req_builder = req_builder.json(&p_body_device_user_binding_request); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::DeviceUserBinding`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::DeviceUserBinding`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// PolicyBinding Viewset -pub async fn endpoints_device_bindings_destroy( - configuration: &configuration::Configuration, - policy_binding_uuid: &str, -) -> Result<(), Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_policy_binding_uuid = policy_binding_uuid; - - let uri_str = format!( - "{}/endpoints/device_bindings/{policy_binding_uuid}/", - configuration.base_path, - policy_binding_uuid = crate::apis::urlencode(p_path_policy_binding_uuid) - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::DELETE, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - - if !status.is_client_error() && !status.is_server_error() { - Ok(()) - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// PolicyBinding Viewset -pub async fn endpoints_device_bindings_list( - configuration: &configuration::Configuration, - enabled: Option, - order: Option, - ordering: Option<&str>, - page: Option, - page_size: Option, - policy: Option<&str>, - policy__isnull: Option, - search: Option<&str>, - target: Option<&str>, - target_in: Option>, - timeout: Option, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_query_enabled = enabled; - let p_query_order = order; - let p_query_ordering = ordering; - let p_query_page = page; - let p_query_page_size = page_size; - let p_query_policy = policy; - let p_query_policy__isnull = policy__isnull; - let p_query_search = search; - let p_query_target = target; - let p_query_target_in = target_in; - let p_query_timeout = timeout; - - let uri_str = format!("{}/endpoints/device_bindings/", configuration.base_path); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref param_value) = p_query_enabled { - req_builder = req_builder.query(&[("enabled", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_order { - req_builder = req_builder.query(&[("order", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_ordering { - req_builder = req_builder.query(&[("ordering", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_page { - req_builder = req_builder.query(&[("page", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_page_size { - req_builder = req_builder.query(&[("page_size", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_policy { - req_builder = req_builder.query(&[("policy", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_policy__isnull { - req_builder = req_builder.query(&[("policy__isnull", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_search { - req_builder = req_builder.query(&[("search", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_target { - req_builder = req_builder.query(&[("target", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_target_in { - req_builder = match "multi" { - "multi" => req_builder.query( - ¶m_value - .into_iter() - .map(|p| ("target_in".to_owned(), p.to_string())) - .collect::>(), - ), - _ => req_builder.query(&[( - "target_in", - ¶m_value - .into_iter() - .map(|p| p.to_string()) - .collect::>() - .join(",") - .to_string(), - )]), - }; - } - if let Some(ref param_value) = p_query_timeout { - req_builder = req_builder.query(&[("timeout", ¶m_value.to_string())]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::PaginatedDeviceUserBindingList`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::PaginatedDeviceUserBindingList`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// PolicyBinding Viewset -pub async fn endpoints_device_bindings_partial_update( - configuration: &configuration::Configuration, - policy_binding_uuid: &str, - patched_device_user_binding_request: Option, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_policy_binding_uuid = policy_binding_uuid; - let p_body_patched_device_user_binding_request = patched_device_user_binding_request; - - let uri_str = format!( - "{}/endpoints/device_bindings/{policy_binding_uuid}/", - configuration.base_path, - policy_binding_uuid = crate::apis::urlencode(p_path_policy_binding_uuid) - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::PATCH, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - req_builder = req_builder.json(&p_body_patched_device_user_binding_request); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::DeviceUserBinding`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::DeviceUserBinding`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// PolicyBinding Viewset -pub async fn endpoints_device_bindings_retrieve( - configuration: &configuration::Configuration, - policy_binding_uuid: &str, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_policy_binding_uuid = policy_binding_uuid; - - let uri_str = format!( - "{}/endpoints/device_bindings/{policy_binding_uuid}/", - configuration.base_path, - policy_binding_uuid = crate::apis::urlencode(p_path_policy_binding_uuid) - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::DeviceUserBinding`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::DeviceUserBinding`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// PolicyBinding Viewset -pub async fn endpoints_device_bindings_update( - configuration: &configuration::Configuration, - policy_binding_uuid: &str, - device_user_binding_request: models::DeviceUserBindingRequest, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_policy_binding_uuid = policy_binding_uuid; - let p_body_device_user_binding_request = device_user_binding_request; - - let uri_str = format!( - "{}/endpoints/device_bindings/{policy_binding_uuid}/", - configuration.base_path, - policy_binding_uuid = crate::apis::urlencode(p_path_policy_binding_uuid) - ); - let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - req_builder = req_builder.json(&p_body_device_user_binding_request); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::DeviceUserBinding`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::DeviceUserBinding`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Get a list of all objects that use this object -pub async fn endpoints_device_bindings_used_by_list( - configuration: &configuration::Configuration, - policy_binding_uuid: &str, -) -> Result, Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_policy_binding_uuid = policy_binding_uuid; - - let uri_str = format!( - "{}/endpoints/device_bindings/{policy_binding_uuid}/used_by/", - configuration.base_path, - policy_binding_uuid = crate::apis::urlencode(p_path_policy_binding_uuid) - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `Vec<models::UsedBy>`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `Vec<models::UsedBy>`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Mixin to add a used_by endpoint to return a list of all objects using this object -pub async fn endpoints_devices_destroy( - configuration: &configuration::Configuration, - device_uuid: &str, -) -> Result<(), Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_device_uuid = device_uuid; - - let uri_str = format!( - "{}/endpoints/devices/{device_uuid}/", - configuration.base_path, - device_uuid = crate::apis::urlencode(p_path_device_uuid) - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::DELETE, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - - if !status.is_client_error() && !status.is_server_error() { - Ok(()) - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Mixin to add a used_by endpoint to return a list of all objects using this object -pub async fn endpoints_devices_list( - configuration: &configuration::Configuration, - identifier: Option<&str>, - name: Option<&str>, - ordering: Option<&str>, - page: Option, - page_size: Option, - search: Option<&str>, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_query_identifier = identifier; - let p_query_name = name; - let p_query_ordering = ordering; - let p_query_page = page; - let p_query_page_size = page_size; - let p_query_search = search; - - let uri_str = format!("{}/endpoints/devices/", configuration.base_path); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref param_value) = p_query_identifier { - req_builder = req_builder.query(&[("identifier", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_name { - req_builder = req_builder.query(&[("name", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_ordering { - req_builder = req_builder.query(&[("ordering", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_page { - req_builder = req_builder.query(&[("page", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_page_size { - req_builder = req_builder.query(&[("page_size", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_search { - req_builder = req_builder.query(&[("search", ¶m_value.to_string())]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::PaginatedEndpointDeviceList`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::PaginatedEndpointDeviceList`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Mixin to add a used_by endpoint to return a list of all objects using this object -pub async fn endpoints_devices_partial_update( - configuration: &configuration::Configuration, - device_uuid: &str, - patched_endpoint_device_request: Option, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_device_uuid = device_uuid; - let p_body_patched_endpoint_device_request = patched_endpoint_device_request; - - let uri_str = format!( - "{}/endpoints/devices/{device_uuid}/", - configuration.base_path, - device_uuid = crate::apis::urlencode(p_path_device_uuid) - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::PATCH, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - req_builder = req_builder.json(&p_body_patched_endpoint_device_request); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::EndpointDevice`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::EndpointDevice`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Mixin to add a used_by endpoint to return a list of all objects using this object -pub async fn endpoints_devices_retrieve( - configuration: &configuration::Configuration, - device_uuid: &str, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_device_uuid = device_uuid; - - let uri_str = format!( - "{}/endpoints/devices/{device_uuid}/", - configuration.base_path, - device_uuid = crate::apis::urlencode(p_path_device_uuid) - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::EndpointDeviceDetails`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::EndpointDeviceDetails`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Mixin to add a used_by endpoint to return a list of all objects using this object -pub async fn endpoints_devices_summary_retrieve( - configuration: &configuration::Configuration, -) -> Result> { - let uri_str = format!("{}/endpoints/devices/summary/", configuration.base_path); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::DeviceSummary`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::DeviceSummary`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Mixin to add a used_by endpoint to return a list of all objects using this object -pub async fn endpoints_devices_update( - configuration: &configuration::Configuration, - device_uuid: &str, - endpoint_device_request: models::EndpointDeviceRequest, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_device_uuid = device_uuid; - let p_body_endpoint_device_request = endpoint_device_request; - - let uri_str = format!( - "{}/endpoints/devices/{device_uuid}/", - configuration.base_path, - device_uuid = crate::apis::urlencode(p_path_device_uuid) - ); - let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - req_builder = req_builder.json(&p_body_endpoint_device_request); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::EndpointDevice`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::EndpointDevice`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Get a list of all objects that use this object -pub async fn endpoints_devices_used_by_list( - configuration: &configuration::Configuration, - device_uuid: &str, -) -> Result, Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_device_uuid = device_uuid; - - let uri_str = format!( - "{}/endpoints/devices/{device_uuid}/used_by/", - configuration.base_path, - device_uuid = crate::apis::urlencode(p_path_device_uuid) - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `Vec<models::UsedBy>`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `Vec<models::UsedBy>`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// FleetConnector Viewset -pub async fn endpoints_fleet_connectors_create( - configuration: &configuration::Configuration, - fleet_connector_request: models::FleetConnectorRequest, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_body_fleet_connector_request = fleet_connector_request; - - let uri_str = format!("{}/endpoints/fleet/connectors/", configuration.base_path); - let mut req_builder = configuration - .client - .request(reqwest::Method::POST, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - req_builder = req_builder.json(&p_body_fleet_connector_request); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::FleetConnector`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::FleetConnector`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// FleetConnector Viewset -pub async fn endpoints_fleet_connectors_destroy( - configuration: &configuration::Configuration, - connector_uuid: &str, -) -> Result<(), Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_connector_uuid = connector_uuid; - - let uri_str = format!( - "{}/endpoints/fleet/connectors/{connector_uuid}/", - configuration.base_path, - connector_uuid = crate::apis::urlencode(p_path_connector_uuid) - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::DELETE, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - - if !status.is_client_error() && !status.is_server_error() { - Ok(()) - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// FleetConnector Viewset -pub async fn endpoints_fleet_connectors_list( - configuration: &configuration::Configuration, - name: Option<&str>, - ordering: Option<&str>, - page: Option, - page_size: Option, - search: Option<&str>, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_query_name = name; - let p_query_ordering = ordering; - let p_query_page = page; - let p_query_page_size = page_size; - let p_query_search = search; - - let uri_str = format!("{}/endpoints/fleet/connectors/", configuration.base_path); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref param_value) = p_query_name { - req_builder = req_builder.query(&[("name", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_ordering { - req_builder = req_builder.query(&[("ordering", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_page { - req_builder = req_builder.query(&[("page", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_page_size { - req_builder = req_builder.query(&[("page_size", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_search { - req_builder = req_builder.query(&[("search", ¶m_value.to_string())]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::PaginatedFleetConnectorList`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::PaginatedFleetConnectorList`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// FleetConnector Viewset -pub async fn endpoints_fleet_connectors_partial_update( - configuration: &configuration::Configuration, - connector_uuid: &str, - patched_fleet_connector_request: Option, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_connector_uuid = connector_uuid; - let p_body_patched_fleet_connector_request = patched_fleet_connector_request; - - let uri_str = format!( - "{}/endpoints/fleet/connectors/{connector_uuid}/", - configuration.base_path, - connector_uuid = crate::apis::urlencode(p_path_connector_uuid) - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::PATCH, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - req_builder = req_builder.json(&p_body_patched_fleet_connector_request); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::FleetConnector`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::FleetConnector`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// FleetConnector Viewset -pub async fn endpoints_fleet_connectors_retrieve( - configuration: &configuration::Configuration, - connector_uuid: &str, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_connector_uuid = connector_uuid; - - let uri_str = format!( - "{}/endpoints/fleet/connectors/{connector_uuid}/", - configuration.base_path, - connector_uuid = crate::apis::urlencode(p_path_connector_uuid) - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::FleetConnector`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::FleetConnector`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// FleetConnector Viewset -pub async fn endpoints_fleet_connectors_update( - configuration: &configuration::Configuration, - connector_uuid: &str, - fleet_connector_request: models::FleetConnectorRequest, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_connector_uuid = connector_uuid; - let p_body_fleet_connector_request = fleet_connector_request; - - let uri_str = format!( - "{}/endpoints/fleet/connectors/{connector_uuid}/", - configuration.base_path, - connector_uuid = crate::apis::urlencode(p_path_connector_uuid) - ); - let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - req_builder = req_builder.json(&p_body_fleet_connector_request); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::FleetConnector`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::FleetConnector`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Get a list of all objects that use this object -pub async fn endpoints_fleet_connectors_used_by_list( - configuration: &configuration::Configuration, - connector_uuid: &str, -) -> Result, Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_connector_uuid = connector_uuid; - - let uri_str = format!( - "{}/endpoints/fleet/connectors/{connector_uuid}/used_by/", - configuration.base_path, - connector_uuid = crate::apis::urlencode(p_path_connector_uuid) - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `Vec<models::UsedBy>`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `Vec<models::UsedBy>`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// GoogleChromeConnector Viewset -pub async fn endpoints_google_chrome_connectors_create( - configuration: &configuration::Configuration, - google_chrome_connector_request: models::GoogleChromeConnectorRequest, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_body_google_chrome_connector_request = google_chrome_connector_request; - - let uri_str = format!( - "{}/endpoints/google_chrome/connectors/", - configuration.base_path - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::POST, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - req_builder = req_builder.json(&p_body_google_chrome_connector_request); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::GoogleChromeConnector`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::GoogleChromeConnector`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// GoogleChromeConnector Viewset -pub async fn endpoints_google_chrome_connectors_destroy( - configuration: &configuration::Configuration, - connector_uuid: &str, -) -> Result<(), Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_connector_uuid = connector_uuid; - - let uri_str = format!( - "{}/endpoints/google_chrome/connectors/{connector_uuid}/", - configuration.base_path, - connector_uuid = crate::apis::urlencode(p_path_connector_uuid) - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::DELETE, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - - if !status.is_client_error() && !status.is_server_error() { - Ok(()) - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// GoogleChromeConnector Viewset -pub async fn endpoints_google_chrome_connectors_list( - configuration: &configuration::Configuration, - name: Option<&str>, - ordering: Option<&str>, - page: Option, - page_size: Option, - search: Option<&str>, -) -> Result< - models::PaginatedGoogleChromeConnectorList, - Error, -> { - // add a prefix to parameters to efficiently prevent name collisions - let p_query_name = name; - let p_query_ordering = ordering; - let p_query_page = page; - let p_query_page_size = page_size; - let p_query_search = search; - - let uri_str = format!( - "{}/endpoints/google_chrome/connectors/", - configuration.base_path - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref param_value) = p_query_name { - req_builder = req_builder.query(&[("name", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_ordering { - req_builder = req_builder.query(&[("ordering", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_page { - req_builder = req_builder.query(&[("page", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_page_size { - req_builder = req_builder.query(&[("page_size", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_search { - req_builder = req_builder.query(&[("search", ¶m_value.to_string())]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::PaginatedGoogleChromeConnectorList`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::PaginatedGoogleChromeConnectorList`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// GoogleChromeConnector Viewset -pub async fn endpoints_google_chrome_connectors_partial_update( - configuration: &configuration::Configuration, - connector_uuid: &str, - patched_google_chrome_connector_request: Option, -) -> Result> -{ - // add a prefix to parameters to efficiently prevent name collisions - let p_path_connector_uuid = connector_uuid; - let p_body_patched_google_chrome_connector_request = patched_google_chrome_connector_request; - - let uri_str = format!( - "{}/endpoints/google_chrome/connectors/{connector_uuid}/", - configuration.base_path, - connector_uuid = crate::apis::urlencode(p_path_connector_uuid) - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::PATCH, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - req_builder = req_builder.json(&p_body_patched_google_chrome_connector_request); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::GoogleChromeConnector`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::GoogleChromeConnector`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// GoogleChromeConnector Viewset -pub async fn endpoints_google_chrome_connectors_retrieve( - configuration: &configuration::Configuration, - connector_uuid: &str, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_connector_uuid = connector_uuid; - - let uri_str = format!( - "{}/endpoints/google_chrome/connectors/{connector_uuid}/", - configuration.base_path, - connector_uuid = crate::apis::urlencode(p_path_connector_uuid) - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::GoogleChromeConnector`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::GoogleChromeConnector`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// GoogleChromeConnector Viewset -pub async fn endpoints_google_chrome_connectors_update( - configuration: &configuration::Configuration, - connector_uuid: &str, - google_chrome_connector_request: models::GoogleChromeConnectorRequest, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_connector_uuid = connector_uuid; - let p_body_google_chrome_connector_request = google_chrome_connector_request; - - let uri_str = format!( - "{}/endpoints/google_chrome/connectors/{connector_uuid}/", - configuration.base_path, - connector_uuid = crate::apis::urlencode(p_path_connector_uuid) - ); - let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - req_builder = req_builder.json(&p_body_google_chrome_connector_request); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::GoogleChromeConnector`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::GoogleChromeConnector`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Get a list of all objects that use this object -pub async fn endpoints_google_chrome_connectors_used_by_list( - configuration: &configuration::Configuration, - connector_uuid: &str, -) -> Result, Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_connector_uuid = connector_uuid; - - let uri_str = format!( - "{}/endpoints/google_chrome/connectors/{connector_uuid}/used_by/", - configuration.base_path, - connector_uuid = crate::apis::urlencode(p_path_connector_uuid) - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `Vec<models::UsedBy>`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `Vec<models::UsedBy>`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} diff --git a/packages/client-rust/src/apis/enterprise_api.rs b/packages/client-rust/src/apis/enterprise_api.rs deleted file mode 100644 index d47a536153..0000000000 --- a/packages/client-rust/src/apis/enterprise_api.rs +++ /dev/null @@ -1,707 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use reqwest; -use serde::{Deserialize, Serialize, de::Error as _}; - -use super::{ContentType, Error, configuration}; -use crate::{apis::ResponseContent, models}; - -/// struct for typed errors of method [`enterprise_license_create`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum EnterpriseLicenseCreateError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`enterprise_license_destroy`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum EnterpriseLicenseDestroyError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`enterprise_license_forecast_retrieve`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum EnterpriseLicenseForecastRetrieveError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`enterprise_license_install_id_retrieve`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum EnterpriseLicenseInstallIdRetrieveError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`enterprise_license_list`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum EnterpriseLicenseListError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`enterprise_license_partial_update`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum EnterpriseLicensePartialUpdateError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`enterprise_license_retrieve`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum EnterpriseLicenseRetrieveError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`enterprise_license_summary_retrieve`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum EnterpriseLicenseSummaryRetrieveError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`enterprise_license_update`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum EnterpriseLicenseUpdateError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`enterprise_license_used_by_list`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum EnterpriseLicenseUsedByListError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// License Viewset -pub async fn enterprise_license_create( - configuration: &configuration::Configuration, - license_request: models::LicenseRequest, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_body_license_request = license_request; - - let uri_str = format!("{}/enterprise/license/", configuration.base_path); - let mut req_builder = configuration - .client - .request(reqwest::Method::POST, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - req_builder = req_builder.json(&p_body_license_request); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::License`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::License`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// License Viewset -pub async fn enterprise_license_destroy( - configuration: &configuration::Configuration, - license_uuid: &str, -) -> Result<(), Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_license_uuid = license_uuid; - - let uri_str = format!( - "{}/enterprise/license/{license_uuid}/", - configuration.base_path, - license_uuid = crate::apis::urlencode(p_path_license_uuid) - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::DELETE, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - - if !status.is_client_error() && !status.is_server_error() { - Ok(()) - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Forecast how many users will be required in a year -pub async fn enterprise_license_forecast_retrieve( - configuration: &configuration::Configuration, -) -> Result> { - let uri_str = format!("{}/enterprise/license/forecast/", configuration.base_path); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::LicenseForecast`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::LicenseForecast`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Get install_id -pub async fn enterprise_license_install_id_retrieve( - configuration: &configuration::Configuration, -) -> Result> { - let uri_str = format!("{}/enterprise/license/install_id/", configuration.base_path); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::InstallId`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::InstallId`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// License Viewset -pub async fn enterprise_license_list( - configuration: &configuration::Configuration, - name: Option<&str>, - ordering: Option<&str>, - page: Option, - page_size: Option, - search: Option<&str>, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_query_name = name; - let p_query_ordering = ordering; - let p_query_page = page; - let p_query_page_size = page_size; - let p_query_search = search; - - let uri_str = format!("{}/enterprise/license/", configuration.base_path); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref param_value) = p_query_name { - req_builder = req_builder.query(&[("name", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_ordering { - req_builder = req_builder.query(&[("ordering", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_page { - req_builder = req_builder.query(&[("page", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_page_size { - req_builder = req_builder.query(&[("page_size", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_search { - req_builder = req_builder.query(&[("search", ¶m_value.to_string())]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::PaginatedLicenseList`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::PaginatedLicenseList`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// License Viewset -pub async fn enterprise_license_partial_update( - configuration: &configuration::Configuration, - license_uuid: &str, - patched_license_request: Option, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_license_uuid = license_uuid; - let p_body_patched_license_request = patched_license_request; - - let uri_str = format!( - "{}/enterprise/license/{license_uuid}/", - configuration.base_path, - license_uuid = crate::apis::urlencode(p_path_license_uuid) - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::PATCH, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - req_builder = req_builder.json(&p_body_patched_license_request); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::License`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::License`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// License Viewset -pub async fn enterprise_license_retrieve( - configuration: &configuration::Configuration, - license_uuid: &str, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_license_uuid = license_uuid; - - let uri_str = format!( - "{}/enterprise/license/{license_uuid}/", - configuration.base_path, - license_uuid = crate::apis::urlencode(p_path_license_uuid) - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::License`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::License`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Get the total license status -pub async fn enterprise_license_summary_retrieve( - configuration: &configuration::Configuration, - cached: Option, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_query_cached = cached; - - let uri_str = format!("{}/enterprise/license/summary/", configuration.base_path); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref param_value) = p_query_cached { - req_builder = req_builder.query(&[("cached", ¶m_value.to_string())]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::LicenseSummary`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::LicenseSummary`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// License Viewset -pub async fn enterprise_license_update( - configuration: &configuration::Configuration, - license_uuid: &str, - license_request: models::LicenseRequest, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_license_uuid = license_uuid; - let p_body_license_request = license_request; - - let uri_str = format!( - "{}/enterprise/license/{license_uuid}/", - configuration.base_path, - license_uuid = crate::apis::urlencode(p_path_license_uuid) - ); - let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - req_builder = req_builder.json(&p_body_license_request); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::License`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::License`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Get a list of all objects that use this object -pub async fn enterprise_license_used_by_list( - configuration: &configuration::Configuration, - license_uuid: &str, -) -> Result, Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_license_uuid = license_uuid; - - let uri_str = format!( - "{}/enterprise/license/{license_uuid}/used_by/", - configuration.base_path, - license_uuid = crate::apis::urlencode(p_path_license_uuid) - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `Vec<models::UsedBy>`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `Vec<models::UsedBy>`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} diff --git a/packages/client-rust/src/apis/events_api.rs b/packages/client-rust/src/apis/events_api.rs index 81ed79afe5..ca8c9ec2c6 100644 --- a/packages/client-rust/src/apis/events_api.rs +++ b/packages/client-rust/src/apis/events_api.rs @@ -12,15 +12,6 @@ use serde::{Deserialize, Serialize, de::Error as _}; use super::{ContentType, Error, configuration}; use crate::{apis::ResponseContent, models}; -/// struct for typed errors of method [`events_events_actions_list`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum EventsEventsActionsListError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - /// struct for typed errors of method [`events_events_create`] #[derive(Debug, Clone, Serialize, Deserialize)] #[serde(untagged)] @@ -30,339 +21,6 @@ pub enum EventsEventsCreateError { UnknownValue(serde_json::Value), } -/// struct for typed errors of method [`events_events_destroy`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum EventsEventsDestroyError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`events_events_export_create`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum EventsEventsExportCreateError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`events_events_list`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum EventsEventsListError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`events_events_partial_update`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum EventsEventsPartialUpdateError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`events_events_retrieve`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum EventsEventsRetrieveError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`events_events_stats_retrieve`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum EventsEventsStatsRetrieveError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`events_events_top_per_user_list`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum EventsEventsTopPerUserListError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`events_events_update`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum EventsEventsUpdateError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`events_events_volume_list`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum EventsEventsVolumeListError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`events_notifications_destroy`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum EventsNotificationsDestroyError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`events_notifications_list`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum EventsNotificationsListError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`events_notifications_mark_all_seen_create`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum EventsNotificationsMarkAllSeenCreateError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`events_notifications_partial_update`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum EventsNotificationsPartialUpdateError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`events_notifications_retrieve`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum EventsNotificationsRetrieveError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`events_notifications_update`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum EventsNotificationsUpdateError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`events_notifications_used_by_list`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum EventsNotificationsUsedByListError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`events_rules_create`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum EventsRulesCreateError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`events_rules_destroy`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum EventsRulesDestroyError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`events_rules_list`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum EventsRulesListError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`events_rules_partial_update`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum EventsRulesPartialUpdateError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`events_rules_retrieve`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum EventsRulesRetrieveError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`events_rules_update`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum EventsRulesUpdateError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`events_rules_used_by_list`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum EventsRulesUsedByListError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`events_transports_create`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum EventsTransportsCreateError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`events_transports_destroy`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum EventsTransportsDestroyError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`events_transports_list`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum EventsTransportsListError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`events_transports_partial_update`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum EventsTransportsPartialUpdateError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`events_transports_retrieve`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum EventsTransportsRetrieveError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`events_transports_test_create`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum EventsTransportsTestCreateError { - Status500(), - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`events_transports_update`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum EventsTransportsUpdateError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`events_transports_used_by_list`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum EventsTransportsUsedByListError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// Get all actions -pub async fn events_events_actions_list( - configuration: &configuration::Configuration, -) -> Result, Error> { - let uri_str = format!("{}/events/events/actions/", configuration.base_path); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `Vec<models::TypeCreate>`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `Vec<models::TypeCreate>`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - /// Event Read-Only Viewset pub async fn events_events_create( configuration: &configuration::Configuration, @@ -379,9 +37,6 @@ pub async fn events_events_create( if let Some(ref user_agent) = configuration.user_agent { req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; req_builder = req_builder.json(&p_body_event_request); let req = req_builder.build()?; @@ -422,2260 +77,3 @@ pub async fn events_events_create( })) } } - -/// Event Read-Only Viewset -pub async fn events_events_destroy( - configuration: &configuration::Configuration, - event_uuid: &str, -) -> Result<(), Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_event_uuid = event_uuid; - - let uri_str = format!( - "{}/events/events/{event_uuid}/", - configuration.base_path, - event_uuid = crate::apis::urlencode(p_path_event_uuid) - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::DELETE, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - - if !status.is_client_error() && !status.is_server_error() { - Ok(()) - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// 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 -pub async fn events_events_export_create( - configuration: &configuration::Configuration, - action: Option<&str>, - actions: Option>, - brand_name: Option<&str>, - client_ip: Option<&str>, - context_authorized_app: Option<&str>, - context_device: Option<&str>, - context_model_app: Option<&str>, - context_model_name: Option<&str>, - context_model_pk: Option<&str>, - ordering: Option<&str>, - search: Option<&str>, - username: Option<&str>, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_query_action = action; - let p_query_actions = actions; - let p_query_brand_name = brand_name; - let p_query_client_ip = client_ip; - let p_query_context_authorized_app = context_authorized_app; - let p_query_context_device = context_device; - let p_query_context_model_app = context_model_app; - let p_query_context_model_name = context_model_name; - let p_query_context_model_pk = context_model_pk; - let p_query_ordering = ordering; - let p_query_search = search; - let p_query_username = username; - - let uri_str = format!("{}/events/events/export/", configuration.base_path); - let mut req_builder = configuration - .client - .request(reqwest::Method::POST, &uri_str); - - if let Some(ref param_value) = p_query_action { - req_builder = req_builder.query(&[("action", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_actions { - req_builder = match "multi" { - "multi" => req_builder.query( - ¶m_value - .into_iter() - .map(|p| ("actions".to_owned(), p.to_string())) - .collect::>(), - ), - _ => req_builder.query(&[( - "actions", - ¶m_value - .into_iter() - .map(|p| p.to_string()) - .collect::>() - .join(",") - .to_string(), - )]), - }; - } - if let Some(ref param_value) = p_query_brand_name { - req_builder = req_builder.query(&[("brand_name", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_client_ip { - req_builder = req_builder.query(&[("client_ip", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_context_authorized_app { - req_builder = req_builder.query(&[("context_authorized_app", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_context_device { - req_builder = req_builder.query(&[("context_device", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_context_model_app { - req_builder = req_builder.query(&[("context_model_app", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_context_model_name { - req_builder = req_builder.query(&[("context_model_name", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_context_model_pk { - req_builder = req_builder.query(&[("context_model_pk", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_ordering { - req_builder = req_builder.query(&[("ordering", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_search { - req_builder = req_builder.query(&[("search", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_username { - req_builder = req_builder.query(&[("username", ¶m_value.to_string())]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::DataExport`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::DataExport`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Event Read-Only Viewset -pub async fn events_events_list( - configuration: &configuration::Configuration, - action: Option<&str>, - actions: Option>, - brand_name: Option<&str>, - client_ip: Option<&str>, - context_authorized_app: Option<&str>, - context_device: Option<&str>, - context_model_app: Option<&str>, - context_model_name: Option<&str>, - context_model_pk: Option<&str>, - ordering: Option<&str>, - page: Option, - page_size: Option, - search: Option<&str>, - username: Option<&str>, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_query_action = action; - let p_query_actions = actions; - let p_query_brand_name = brand_name; - let p_query_client_ip = client_ip; - let p_query_context_authorized_app = context_authorized_app; - let p_query_context_device = context_device; - let p_query_context_model_app = context_model_app; - let p_query_context_model_name = context_model_name; - let p_query_context_model_pk = context_model_pk; - let p_query_ordering = ordering; - let p_query_page = page; - let p_query_page_size = page_size; - let p_query_search = search; - let p_query_username = username; - - let uri_str = format!("{}/events/events/", configuration.base_path); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref param_value) = p_query_action { - req_builder = req_builder.query(&[("action", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_actions { - req_builder = match "multi" { - "multi" => req_builder.query( - ¶m_value - .into_iter() - .map(|p| ("actions".to_owned(), p.to_string())) - .collect::>(), - ), - _ => req_builder.query(&[( - "actions", - ¶m_value - .into_iter() - .map(|p| p.to_string()) - .collect::>() - .join(",") - .to_string(), - )]), - }; - } - if let Some(ref param_value) = p_query_brand_name { - req_builder = req_builder.query(&[("brand_name", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_client_ip { - req_builder = req_builder.query(&[("client_ip", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_context_authorized_app { - req_builder = req_builder.query(&[("context_authorized_app", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_context_device { - req_builder = req_builder.query(&[("context_device", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_context_model_app { - req_builder = req_builder.query(&[("context_model_app", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_context_model_name { - req_builder = req_builder.query(&[("context_model_name", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_context_model_pk { - req_builder = req_builder.query(&[("context_model_pk", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_ordering { - req_builder = req_builder.query(&[("ordering", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_page { - req_builder = req_builder.query(&[("page", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_page_size { - req_builder = req_builder.query(&[("page_size", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_search { - req_builder = req_builder.query(&[("search", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_username { - req_builder = req_builder.query(&[("username", ¶m_value.to_string())]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::PaginatedEventList`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::PaginatedEventList`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Event Read-Only Viewset -pub async fn events_events_partial_update( - configuration: &configuration::Configuration, - event_uuid: &str, - patched_event_request: Option, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_event_uuid = event_uuid; - let p_body_patched_event_request = patched_event_request; - - let uri_str = format!( - "{}/events/events/{event_uuid}/", - configuration.base_path, - event_uuid = crate::apis::urlencode(p_path_event_uuid) - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::PATCH, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - req_builder = req_builder.json(&p_body_patched_event_request); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::Event`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::Event`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Event Read-Only Viewset -pub async fn events_events_retrieve( - configuration: &configuration::Configuration, - event_uuid: &str, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_event_uuid = event_uuid; - - let uri_str = format!( - "{}/events/events/{event_uuid}/", - configuration.base_path, - event_uuid = crate::apis::urlencode(p_path_event_uuid) - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::Event`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::Event`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Get event stats for specified filters and count steps -pub async fn events_events_stats_retrieve( - configuration: &configuration::Configuration, - count_steps: Vec, - action: Option<&str>, - actions: Option>, - brand_name: Option<&str>, - client_ip: Option<&str>, - context_authorized_app: Option<&str>, - context_device: Option<&str>, - context_model_app: Option<&str>, - context_model_name: Option<&str>, - context_model_pk: Option<&str>, - ordering: Option<&str>, - search: Option<&str>, - username: Option<&str>, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_query_count_steps = count_steps; - let p_query_action = action; - let p_query_actions = actions; - let p_query_brand_name = brand_name; - let p_query_client_ip = client_ip; - let p_query_context_authorized_app = context_authorized_app; - let p_query_context_device = context_device; - let p_query_context_model_app = context_model_app; - let p_query_context_model_name = context_model_name; - let p_query_context_model_pk = context_model_pk; - let p_query_ordering = ordering; - let p_query_search = search; - let p_query_username = username; - - let uri_str = format!("{}/events/events/stats/", configuration.base_path); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref param_value) = p_query_action { - req_builder = req_builder.query(&[("action", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_actions { - req_builder = match "multi" { - "multi" => req_builder.query( - ¶m_value - .into_iter() - .map(|p| ("actions".to_owned(), p.to_string())) - .collect::>(), - ), - _ => req_builder.query(&[( - "actions", - ¶m_value - .into_iter() - .map(|p| p.to_string()) - .collect::>() - .join(",") - .to_string(), - )]), - }; - } - if let Some(ref param_value) = p_query_brand_name { - req_builder = req_builder.query(&[("brand_name", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_client_ip { - req_builder = req_builder.query(&[("client_ip", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_context_authorized_app { - req_builder = req_builder.query(&[("context_authorized_app", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_context_device { - req_builder = req_builder.query(&[("context_device", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_context_model_app { - req_builder = req_builder.query(&[("context_model_app", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_context_model_name { - req_builder = req_builder.query(&[("context_model_name", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_context_model_pk { - req_builder = req_builder.query(&[("context_model_pk", ¶m_value.to_string())]); - } - req_builder = match "multi" { - "multi" => req_builder.query( - &p_query_count_steps - .into_iter() - .map(|p| ("count_steps".to_owned(), p.to_string())) - .collect::>(), - ), - _ => req_builder.query(&[( - "count_steps", - &p_query_count_steps - .into_iter() - .map(|p| p.to_string()) - .collect::>() - .join(",") - .to_string(), - )]), - }; - if let Some(ref param_value) = p_query_ordering { - req_builder = req_builder.query(&[("ordering", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_search { - req_builder = req_builder.query(&[("search", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_username { - req_builder = req_builder.query(&[("username", ¶m_value.to_string())]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::EventStats`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::EventStats`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Get the top_n events grouped by user count -pub async fn events_events_top_per_user_list( - configuration: &configuration::Configuration, - action: Option<&str>, - top_n: Option, -) -> Result, Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_query_action = action; - let p_query_top_n = top_n; - - let uri_str = format!("{}/events/events/top_per_user/", configuration.base_path); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref param_value) = p_query_action { - req_builder = req_builder.query(&[("action", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_top_n { - req_builder = req_builder.query(&[("top_n", ¶m_value.to_string())]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `Vec<models::EventTopPerUser>`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `Vec<models::EventTopPerUser>`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Event Read-Only Viewset -pub async fn events_events_update( - configuration: &configuration::Configuration, - event_uuid: &str, - event_request: models::EventRequest, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_event_uuid = event_uuid; - let p_body_event_request = event_request; - - let uri_str = format!( - "{}/events/events/{event_uuid}/", - configuration.base_path, - event_uuid = crate::apis::urlencode(p_path_event_uuid) - ); - let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - req_builder = req_builder.json(&p_body_event_request); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::Event`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::Event`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Get event volume for specified filters and timeframe -pub async fn events_events_volume_list( - configuration: &configuration::Configuration, - action: Option<&str>, - actions: Option>, - brand_name: Option<&str>, - client_ip: Option<&str>, - context_authorized_app: Option<&str>, - context_device: Option<&str>, - context_model_app: Option<&str>, - context_model_name: Option<&str>, - context_model_pk: Option<&str>, - history_days: Option, - ordering: Option<&str>, - search: Option<&str>, - username: Option<&str>, -) -> Result, Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_query_action = action; - let p_query_actions = actions; - let p_query_brand_name = brand_name; - let p_query_client_ip = client_ip; - let p_query_context_authorized_app = context_authorized_app; - let p_query_context_device = context_device; - let p_query_context_model_app = context_model_app; - let p_query_context_model_name = context_model_name; - let p_query_context_model_pk = context_model_pk; - let p_query_history_days = history_days; - let p_query_ordering = ordering; - let p_query_search = search; - let p_query_username = username; - - let uri_str = format!("{}/events/events/volume/", configuration.base_path); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref param_value) = p_query_action { - req_builder = req_builder.query(&[("action", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_actions { - req_builder = match "multi" { - "multi" => req_builder.query( - ¶m_value - .into_iter() - .map(|p| ("actions".to_owned(), p.to_string())) - .collect::>(), - ), - _ => req_builder.query(&[( - "actions", - ¶m_value - .into_iter() - .map(|p| p.to_string()) - .collect::>() - .join(",") - .to_string(), - )]), - }; - } - if let Some(ref param_value) = p_query_brand_name { - req_builder = req_builder.query(&[("brand_name", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_client_ip { - req_builder = req_builder.query(&[("client_ip", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_context_authorized_app { - req_builder = req_builder.query(&[("context_authorized_app", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_context_device { - req_builder = req_builder.query(&[("context_device", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_context_model_app { - req_builder = req_builder.query(&[("context_model_app", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_context_model_name { - req_builder = req_builder.query(&[("context_model_name", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_context_model_pk { - req_builder = req_builder.query(&[("context_model_pk", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_history_days { - req_builder = req_builder.query(&[("history_days", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_ordering { - req_builder = req_builder.query(&[("ordering", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_search { - req_builder = req_builder.query(&[("search", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_username { - req_builder = req_builder.query(&[("username", ¶m_value.to_string())]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `Vec<models::EventVolume>`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `Vec<models::EventVolume>`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Notification Viewset -pub async fn events_notifications_destroy( - configuration: &configuration::Configuration, - uuid: &str, -) -> Result<(), Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_uuid = uuid; - - let uri_str = format!( - "{}/events/notifications/{uuid}/", - configuration.base_path, - uuid = crate::apis::urlencode(p_path_uuid) - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::DELETE, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - - if !status.is_client_error() && !status.is_server_error() { - Ok(()) - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Notification Viewset -pub async fn events_notifications_list( - configuration: &configuration::Configuration, - body: Option<&str>, - created: Option, - event: Option<&str>, - ordering: Option<&str>, - page: Option, - page_size: Option, - search: Option<&str>, - seen: Option, - severity: Option, - user: Option, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_query_body = body; - let p_query_created = created; - let p_query_event = event; - let p_query_ordering = ordering; - let p_query_page = page; - let p_query_page_size = page_size; - let p_query_search = search; - let p_query_seen = seen; - let p_query_severity = severity; - let p_query_user = user; - - let uri_str = format!("{}/events/notifications/", configuration.base_path); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref param_value) = p_query_body { - req_builder = req_builder.query(&[("body", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_created { - req_builder = req_builder.query(&[("created", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_event { - req_builder = req_builder.query(&[("event", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_ordering { - req_builder = req_builder.query(&[("ordering", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_page { - req_builder = req_builder.query(&[("page", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_page_size { - req_builder = req_builder.query(&[("page_size", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_search { - req_builder = req_builder.query(&[("search", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_seen { - req_builder = req_builder.query(&[("seen", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_severity { - req_builder = req_builder.query(&[("severity", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_user { - req_builder = req_builder.query(&[("user", ¶m_value.to_string())]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::PaginatedNotificationList`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::PaginatedNotificationList`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Mark all the user's notifications as seen -pub async fn events_notifications_mark_all_seen_create( - configuration: &configuration::Configuration, -) -> Result<(), Error> { - let uri_str = format!( - "{}/events/notifications/mark_all_seen/", - configuration.base_path - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::POST, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - - if !status.is_client_error() && !status.is_server_error() { - Ok(()) - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Notification Viewset -pub async fn events_notifications_partial_update( - configuration: &configuration::Configuration, - uuid: &str, - patched_notification_request: Option, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_uuid = uuid; - let p_body_patched_notification_request = patched_notification_request; - - let uri_str = format!( - "{}/events/notifications/{uuid}/", - configuration.base_path, - uuid = crate::apis::urlencode(p_path_uuid) - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::PATCH, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - req_builder = req_builder.json(&p_body_patched_notification_request); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::Notification`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::Notification`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Notification Viewset -pub async fn events_notifications_retrieve( - configuration: &configuration::Configuration, - uuid: &str, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_uuid = uuid; - - let uri_str = format!( - "{}/events/notifications/{uuid}/", - configuration.base_path, - uuid = crate::apis::urlencode(p_path_uuid) - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::Notification`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::Notification`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Notification Viewset -pub async fn events_notifications_update( - configuration: &configuration::Configuration, - uuid: &str, - notification_request: Option, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_uuid = uuid; - let p_body_notification_request = notification_request; - - let uri_str = format!( - "{}/events/notifications/{uuid}/", - configuration.base_path, - uuid = crate::apis::urlencode(p_path_uuid) - ); - let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - req_builder = req_builder.json(&p_body_notification_request); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::Notification`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::Notification`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Get a list of all objects that use this object -pub async fn events_notifications_used_by_list( - configuration: &configuration::Configuration, - uuid: &str, -) -> Result, Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_uuid = uuid; - - let uri_str = format!( - "{}/events/notifications/{uuid}/used_by/", - configuration.base_path, - uuid = crate::apis::urlencode(p_path_uuid) - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `Vec<models::UsedBy>`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `Vec<models::UsedBy>`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// NotificationRule Viewset -pub async fn events_rules_create( - configuration: &configuration::Configuration, - notification_rule_request: models::NotificationRuleRequest, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_body_notification_rule_request = notification_rule_request; - - let uri_str = format!("{}/events/rules/", configuration.base_path); - let mut req_builder = configuration - .client - .request(reqwest::Method::POST, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - req_builder = req_builder.json(&p_body_notification_rule_request); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::NotificationRule`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::NotificationRule`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// NotificationRule Viewset -pub async fn events_rules_destroy( - configuration: &configuration::Configuration, - pbm_uuid: &str, -) -> Result<(), Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_pbm_uuid = pbm_uuid; - - let uri_str = format!( - "{}/events/rules/{pbm_uuid}/", - configuration.base_path, - pbm_uuid = crate::apis::urlencode(p_path_pbm_uuid) - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::DELETE, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - - if !status.is_client_error() && !status.is_server_error() { - Ok(()) - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// NotificationRule Viewset -pub async fn events_rules_list( - configuration: &configuration::Configuration, - destination_group__name: Option<&str>, - name: Option<&str>, - ordering: Option<&str>, - page: Option, - page_size: Option, - search: Option<&str>, - severity: Option, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_query_destination_group__name = destination_group__name; - let p_query_name = name; - let p_query_ordering = ordering; - let p_query_page = page; - let p_query_page_size = page_size; - let p_query_search = search; - let p_query_severity = severity; - - let uri_str = format!("{}/events/rules/", configuration.base_path); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref param_value) = p_query_destination_group__name { - req_builder = req_builder.query(&[("destination_group__name", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_name { - req_builder = req_builder.query(&[("name", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_ordering { - req_builder = req_builder.query(&[("ordering", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_page { - req_builder = req_builder.query(&[("page", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_page_size { - req_builder = req_builder.query(&[("page_size", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_search { - req_builder = req_builder.query(&[("search", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_severity { - req_builder = req_builder.query(&[("severity", ¶m_value.to_string())]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::PaginatedNotificationRuleList`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::PaginatedNotificationRuleList`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// NotificationRule Viewset -pub async fn events_rules_partial_update( - configuration: &configuration::Configuration, - pbm_uuid: &str, - patched_notification_rule_request: Option, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_pbm_uuid = pbm_uuid; - let p_body_patched_notification_rule_request = patched_notification_rule_request; - - let uri_str = format!( - "{}/events/rules/{pbm_uuid}/", - configuration.base_path, - pbm_uuid = crate::apis::urlencode(p_path_pbm_uuid) - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::PATCH, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - req_builder = req_builder.json(&p_body_patched_notification_rule_request); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::NotificationRule`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::NotificationRule`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// NotificationRule Viewset -pub async fn events_rules_retrieve( - configuration: &configuration::Configuration, - pbm_uuid: &str, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_pbm_uuid = pbm_uuid; - - let uri_str = format!( - "{}/events/rules/{pbm_uuid}/", - configuration.base_path, - pbm_uuid = crate::apis::urlencode(p_path_pbm_uuid) - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::NotificationRule`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::NotificationRule`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// NotificationRule Viewset -pub async fn events_rules_update( - configuration: &configuration::Configuration, - pbm_uuid: &str, - notification_rule_request: models::NotificationRuleRequest, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_pbm_uuid = pbm_uuid; - let p_body_notification_rule_request = notification_rule_request; - - let uri_str = format!( - "{}/events/rules/{pbm_uuid}/", - configuration.base_path, - pbm_uuid = crate::apis::urlencode(p_path_pbm_uuid) - ); - let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - req_builder = req_builder.json(&p_body_notification_rule_request); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::NotificationRule`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::NotificationRule`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Get a list of all objects that use this object -pub async fn events_rules_used_by_list( - configuration: &configuration::Configuration, - pbm_uuid: &str, -) -> Result, Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_pbm_uuid = pbm_uuid; - - let uri_str = format!( - "{}/events/rules/{pbm_uuid}/used_by/", - configuration.base_path, - pbm_uuid = crate::apis::urlencode(p_path_pbm_uuid) - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `Vec<models::UsedBy>`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `Vec<models::UsedBy>`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// NotificationTransport Viewset -pub async fn events_transports_create( - configuration: &configuration::Configuration, - notification_transport_request: models::NotificationTransportRequest, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_body_notification_transport_request = notification_transport_request; - - let uri_str = format!("{}/events/transports/", configuration.base_path); - let mut req_builder = configuration - .client - .request(reqwest::Method::POST, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - req_builder = req_builder.json(&p_body_notification_transport_request); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::NotificationTransport`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::NotificationTransport`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// NotificationTransport Viewset -pub async fn events_transports_destroy( - configuration: &configuration::Configuration, - uuid: &str, -) -> Result<(), Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_uuid = uuid; - - let uri_str = format!( - "{}/events/transports/{uuid}/", - configuration.base_path, - uuid = crate::apis::urlencode(p_path_uuid) - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::DELETE, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - - if !status.is_client_error() && !status.is_server_error() { - Ok(()) - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// NotificationTransport Viewset -pub async fn events_transports_list( - configuration: &configuration::Configuration, - mode: Option, - name: Option<&str>, - ordering: Option<&str>, - page: Option, - page_size: Option, - search: Option<&str>, - send_once: Option, - webhook_url: Option<&str>, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_query_mode = mode; - let p_query_name = name; - let p_query_ordering = ordering; - let p_query_page = page; - let p_query_page_size = page_size; - let p_query_search = search; - let p_query_send_once = send_once; - let p_query_webhook_url = webhook_url; - - let uri_str = format!("{}/events/transports/", configuration.base_path); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref param_value) = p_query_mode { - req_builder = req_builder.query(&[("mode", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_name { - req_builder = req_builder.query(&[("name", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_ordering { - req_builder = req_builder.query(&[("ordering", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_page { - req_builder = req_builder.query(&[("page", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_page_size { - req_builder = req_builder.query(&[("page_size", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_search { - req_builder = req_builder.query(&[("search", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_send_once { - req_builder = req_builder.query(&[("send_once", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_webhook_url { - req_builder = req_builder.query(&[("webhook_url", ¶m_value.to_string())]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::PaginatedNotificationTransportList`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::PaginatedNotificationTransportList`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// NotificationTransport Viewset -pub async fn events_transports_partial_update( - configuration: &configuration::Configuration, - uuid: &str, - patched_notification_transport_request: Option, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_uuid = uuid; - let p_body_patched_notification_transport_request = patched_notification_transport_request; - - let uri_str = format!( - "{}/events/transports/{uuid}/", - configuration.base_path, - uuid = crate::apis::urlencode(p_path_uuid) - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::PATCH, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - req_builder = req_builder.json(&p_body_patched_notification_transport_request); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::NotificationTransport`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::NotificationTransport`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// NotificationTransport Viewset -pub async fn events_transports_retrieve( - configuration: &configuration::Configuration, - uuid: &str, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_uuid = uuid; - - let uri_str = format!( - "{}/events/transports/{uuid}/", - configuration.base_path, - uuid = crate::apis::urlencode(p_path_uuid) - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::NotificationTransport`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::NotificationTransport`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Send example notification using selected transport. Requires Modify permissions. -pub async fn events_transports_test_create( - configuration: &configuration::Configuration, - uuid: &str, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_uuid = uuid; - - let uri_str = format!( - "{}/events/transports/{uuid}/test/", - configuration.base_path, - uuid = crate::apis::urlencode(p_path_uuid) - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::POST, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::NotificationTransportTest`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::NotificationTransportTest`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// NotificationTransport Viewset -pub async fn events_transports_update( - configuration: &configuration::Configuration, - uuid: &str, - notification_transport_request: models::NotificationTransportRequest, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_uuid = uuid; - let p_body_notification_transport_request = notification_transport_request; - - let uri_str = format!( - "{}/events/transports/{uuid}/", - configuration.base_path, - uuid = crate::apis::urlencode(p_path_uuid) - ); - let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - req_builder = req_builder.json(&p_body_notification_transport_request); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::NotificationTransport`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::NotificationTransport`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Get a list of all objects that use this object -pub async fn events_transports_used_by_list( - configuration: &configuration::Configuration, - uuid: &str, -) -> Result, Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_uuid = uuid; - - let uri_str = format!( - "{}/events/transports/{uuid}/used_by/", - configuration.base_path, - uuid = crate::apis::urlencode(p_path_uuid) - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `Vec<models::UsedBy>`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `Vec<models::UsedBy>`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} diff --git a/packages/client-rust/src/apis/flows_api.rs b/packages/client-rust/src/apis/flows_api.rs index 64181f4be0..aada67d593 100644 --- a/packages/client-rust/src/apis/flows_api.rs +++ b/packages/client-rust/src/apis/flows_api.rs @@ -12,69 +12,6 @@ use serde::{Deserialize, Serialize, de::Error as _}; use super::{ContentType, Error, configuration}; use crate::{apis::ResponseContent, models}; -/// struct for typed errors of method [`flows_bindings_create`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum FlowsBindingsCreateError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`flows_bindings_destroy`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum FlowsBindingsDestroyError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`flows_bindings_list`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum FlowsBindingsListError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`flows_bindings_partial_update`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum FlowsBindingsPartialUpdateError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`flows_bindings_retrieve`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum FlowsBindingsRetrieveError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`flows_bindings_update`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum FlowsBindingsUpdateError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`flows_bindings_used_by_list`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum FlowsBindingsUsedByListError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - /// struct for typed errors of method [`flows_executor_get`] #[derive(Debug, Clone, Serialize, Deserialize)] #[serde(untagged)] @@ -93,618 +30,6 @@ pub enum FlowsExecutorSolveError { UnknownValue(serde_json::Value), } -/// struct for typed errors of method [`flows_inspector_get`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum FlowsInspectorGetError { - Status400(), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`flows_instances_cache_clear_create`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum FlowsInstancesCacheClearCreateError { - Status400(), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`flows_instances_cache_info_retrieve`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum FlowsInstancesCacheInfoRetrieveError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`flows_instances_create`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum FlowsInstancesCreateError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`flows_instances_destroy`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum FlowsInstancesDestroyError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`flows_instances_diagram_retrieve`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum FlowsInstancesDiagramRetrieveError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`flows_instances_execute_retrieve`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum FlowsInstancesExecuteRetrieveError { - Status400(), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`flows_instances_export_retrieve`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum FlowsInstancesExportRetrieveError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`flows_instances_list`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum FlowsInstancesListError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`flows_instances_partial_update`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum FlowsInstancesPartialUpdateError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`flows_instances_retrieve`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum FlowsInstancesRetrieveError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`flows_instances_update`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum FlowsInstancesUpdateError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`flows_instances_used_by_list`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum FlowsInstancesUsedByListError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// FlowStageBinding Viewset -pub async fn flows_bindings_create( - configuration: &configuration::Configuration, - flow_stage_binding_request: models::FlowStageBindingRequest, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_body_flow_stage_binding_request = flow_stage_binding_request; - - let uri_str = format!("{}/flows/bindings/", configuration.base_path); - let mut req_builder = configuration - .client - .request(reqwest::Method::POST, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - req_builder = req_builder.json(&p_body_flow_stage_binding_request); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::FlowStageBinding`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::FlowStageBinding`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// FlowStageBinding Viewset -pub async fn flows_bindings_destroy( - configuration: &configuration::Configuration, - fsb_uuid: &str, -) -> Result<(), Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_fsb_uuid = fsb_uuid; - - let uri_str = format!( - "{}/flows/bindings/{fsb_uuid}/", - configuration.base_path, - fsb_uuid = crate::apis::urlencode(p_path_fsb_uuid) - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::DELETE, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - - if !status.is_client_error() && !status.is_server_error() { - Ok(()) - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// FlowStageBinding Viewset -pub async fn flows_bindings_list( - configuration: &configuration::Configuration, - evaluate_on_plan: Option, - fsb_uuid: Option<&str>, - invalid_response_action: Option, - order: Option, - ordering: Option<&str>, - page: Option, - page_size: Option, - pbm_uuid: Option<&str>, - policies: Option>, - policy_engine_mode: Option, - re_evaluate_policies: Option, - search: Option<&str>, - stage: Option<&str>, - target: Option<&str>, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_query_evaluate_on_plan = evaluate_on_plan; - let p_query_fsb_uuid = fsb_uuid; - let p_query_invalid_response_action = invalid_response_action; - let p_query_order = order; - let p_query_ordering = ordering; - let p_query_page = page; - let p_query_page_size = page_size; - let p_query_pbm_uuid = pbm_uuid; - let p_query_policies = policies; - let p_query_policy_engine_mode = policy_engine_mode; - let p_query_re_evaluate_policies = re_evaluate_policies; - let p_query_search = search; - let p_query_stage = stage; - let p_query_target = target; - - let uri_str = format!("{}/flows/bindings/", configuration.base_path); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref param_value) = p_query_evaluate_on_plan { - req_builder = req_builder.query(&[("evaluate_on_plan", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_fsb_uuid { - req_builder = req_builder.query(&[("fsb_uuid", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_invalid_response_action { - req_builder = req_builder.query(&[("invalid_response_action", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_order { - req_builder = req_builder.query(&[("order", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_ordering { - req_builder = req_builder.query(&[("ordering", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_page { - req_builder = req_builder.query(&[("page", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_page_size { - req_builder = req_builder.query(&[("page_size", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_pbm_uuid { - req_builder = req_builder.query(&[("pbm_uuid", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_policies { - req_builder = match "multi" { - "multi" => req_builder.query( - ¶m_value - .into_iter() - .map(|p| ("policies".to_owned(), p.to_string())) - .collect::>(), - ), - _ => req_builder.query(&[( - "policies", - ¶m_value - .into_iter() - .map(|p| p.to_string()) - .collect::>() - .join(",") - .to_string(), - )]), - }; - } - if let Some(ref param_value) = p_query_policy_engine_mode { - req_builder = req_builder.query(&[("policy_engine_mode", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_re_evaluate_policies { - req_builder = req_builder.query(&[("re_evaluate_policies", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_search { - req_builder = req_builder.query(&[("search", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_stage { - req_builder = req_builder.query(&[("stage", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_target { - req_builder = req_builder.query(&[("target", ¶m_value.to_string())]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::PaginatedFlowStageBindingList`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::PaginatedFlowStageBindingList`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// FlowStageBinding Viewset -pub async fn flows_bindings_partial_update( - configuration: &configuration::Configuration, - fsb_uuid: &str, - patched_flow_stage_binding_request: Option, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_fsb_uuid = fsb_uuid; - let p_body_patched_flow_stage_binding_request = patched_flow_stage_binding_request; - - let uri_str = format!( - "{}/flows/bindings/{fsb_uuid}/", - configuration.base_path, - fsb_uuid = crate::apis::urlencode(p_path_fsb_uuid) - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::PATCH, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - req_builder = req_builder.json(&p_body_patched_flow_stage_binding_request); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::FlowStageBinding`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::FlowStageBinding`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// FlowStageBinding Viewset -pub async fn flows_bindings_retrieve( - configuration: &configuration::Configuration, - fsb_uuid: &str, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_fsb_uuid = fsb_uuid; - - let uri_str = format!( - "{}/flows/bindings/{fsb_uuid}/", - configuration.base_path, - fsb_uuid = crate::apis::urlencode(p_path_fsb_uuid) - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::FlowStageBinding`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::FlowStageBinding`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// FlowStageBinding Viewset -pub async fn flows_bindings_update( - configuration: &configuration::Configuration, - fsb_uuid: &str, - flow_stage_binding_request: models::FlowStageBindingRequest, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_fsb_uuid = fsb_uuid; - let p_body_flow_stage_binding_request = flow_stage_binding_request; - - let uri_str = format!( - "{}/flows/bindings/{fsb_uuid}/", - configuration.base_path, - fsb_uuid = crate::apis::urlencode(p_path_fsb_uuid) - ); - let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - req_builder = req_builder.json(&p_body_flow_stage_binding_request); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::FlowStageBinding`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::FlowStageBinding`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Get a list of all objects that use this object -pub async fn flows_bindings_used_by_list( - configuration: &configuration::Configuration, - fsb_uuid: &str, -) -> Result, Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_fsb_uuid = fsb_uuid; - - let uri_str = format!( - "{}/flows/bindings/{fsb_uuid}/used_by/", - configuration.base_path, - fsb_uuid = crate::apis::urlencode(p_path_fsb_uuid) - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `Vec<models::UsedBy>`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `Vec<models::UsedBy>`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - /// Get the next pending challenge from the currently active flow. pub async fn flows_executor_get( configuration: &configuration::Configuration, @@ -726,9 +51,6 @@ pub async fn flows_executor_get( if let Some(ref user_agent) = configuration.user_agent { req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; let req = req_builder.build()?; let resp = configuration.client.execute(req).await?; @@ -794,9 +116,6 @@ pub async fn flows_executor_solve( if let Some(ref user_agent) = configuration.user_agent { req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; req_builder = req_builder.json(&p_body_flow_challenge_response_request); let req = req_builder.build()?; @@ -837,771 +156,3 @@ pub async fn flows_executor_solve( })) } } - -/// Get current flow state and record it -pub async fn flows_inspector_get( - configuration: &configuration::Configuration, - flow_slug: &str, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_flow_slug = flow_slug; - - let uri_str = format!( - "{}/flows/inspector/{flow_slug}/", - configuration.base_path, - flow_slug = crate::apis::urlencode(p_path_flow_slug) - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::FlowInspection`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::FlowInspection`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Clear flow cache -pub async fn flows_instances_cache_clear_create( - configuration: &configuration::Configuration, -) -> Result<(), Error> { - let uri_str = format!("{}/flows/instances/cache_clear/", configuration.base_path); - let mut req_builder = configuration - .client - .request(reqwest::Method::POST, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - - if !status.is_client_error() && !status.is_server_error() { - Ok(()) - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Info about cached flows -pub async fn flows_instances_cache_info_retrieve( - configuration: &configuration::Configuration, -) -> Result> { - let uri_str = format!("{}/flows/instances/cache_info/", configuration.base_path); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::Cache`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::Cache`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Flow Viewset -pub async fn flows_instances_create( - configuration: &configuration::Configuration, - flow_request: models::FlowRequest, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_body_flow_request = flow_request; - - let uri_str = format!("{}/flows/instances/", configuration.base_path); - let mut req_builder = configuration - .client - .request(reqwest::Method::POST, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - req_builder = req_builder.json(&p_body_flow_request); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::Flow`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::Flow`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Flow Viewset -pub async fn flows_instances_destroy( - configuration: &configuration::Configuration, - slug: &str, -) -> Result<(), Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_slug = slug; - - let uri_str = format!( - "{}/flows/instances/{slug}/", - configuration.base_path, - slug = crate::apis::urlencode(p_path_slug) - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::DELETE, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - - if !status.is_client_error() && !status.is_server_error() { - Ok(()) - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Return diagram for flow with slug `slug`, in the format used by flowchart.js -pub async fn flows_instances_diagram_retrieve( - configuration: &configuration::Configuration, - slug: &str, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_slug = slug; - - let uri_str = format!( - "{}/flows/instances/{slug}/diagram/", - configuration.base_path, - slug = crate::apis::urlencode(p_path_slug) - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::FlowDiagram`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::FlowDiagram`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Execute flow for current user -pub async fn flows_instances_execute_retrieve( - configuration: &configuration::Configuration, - slug: &str, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_slug = slug; - - let uri_str = format!( - "{}/flows/instances/{slug}/execute/", - configuration.base_path, - slug = crate::apis::urlencode(p_path_slug) - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::Link`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::Link`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Export flow to .yaml file -pub async fn flows_instances_export_retrieve( - configuration: &configuration::Configuration, - slug: &str, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_slug = slug; - - let uri_str = format!( - "{}/flows/instances/{slug}/export/", - configuration.base_path, - slug = crate::apis::urlencode(p_path_slug) - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - - if !status.is_client_error() && !status.is_server_error() { - Ok(resp) - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Flow Viewset -pub async fn flows_instances_list( - configuration: &configuration::Configuration, - denied_action: Option, - designation: Option, - flow_uuid: Option<&str>, - name: Option<&str>, - ordering: Option<&str>, - page: Option, - page_size: Option, - search: Option<&str>, - slug: Option<&str>, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_query_denied_action = denied_action; - let p_query_designation = designation; - let p_query_flow_uuid = flow_uuid; - let p_query_name = name; - let p_query_ordering = ordering; - let p_query_page = page; - let p_query_page_size = page_size; - let p_query_search = search; - let p_query_slug = slug; - - let uri_str = format!("{}/flows/instances/", configuration.base_path); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref param_value) = p_query_denied_action { - req_builder = req_builder.query(&[("denied_action", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_designation { - req_builder = req_builder.query(&[("designation", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_flow_uuid { - req_builder = req_builder.query(&[("flow_uuid", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_name { - req_builder = req_builder.query(&[("name", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_ordering { - req_builder = req_builder.query(&[("ordering", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_page { - req_builder = req_builder.query(&[("page", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_page_size { - req_builder = req_builder.query(&[("page_size", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_search { - req_builder = req_builder.query(&[("search", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_slug { - req_builder = req_builder.query(&[("slug", ¶m_value.to_string())]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::PaginatedFlowList`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::PaginatedFlowList`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Flow Viewset -pub async fn flows_instances_partial_update( - configuration: &configuration::Configuration, - slug: &str, - patched_flow_request: Option, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_slug = slug; - let p_body_patched_flow_request = patched_flow_request; - - let uri_str = format!( - "{}/flows/instances/{slug}/", - configuration.base_path, - slug = crate::apis::urlencode(p_path_slug) - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::PATCH, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - req_builder = req_builder.json(&p_body_patched_flow_request); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::Flow`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::Flow`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Flow Viewset -pub async fn flows_instances_retrieve( - configuration: &configuration::Configuration, - slug: &str, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_slug = slug; - - let uri_str = format!( - "{}/flows/instances/{slug}/", - configuration.base_path, - slug = crate::apis::urlencode(p_path_slug) - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::Flow`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::Flow`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Flow Viewset -pub async fn flows_instances_update( - configuration: &configuration::Configuration, - slug: &str, - flow_request: models::FlowRequest, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_slug = slug; - let p_body_flow_request = flow_request; - - let uri_str = format!( - "{}/flows/instances/{slug}/", - configuration.base_path, - slug = crate::apis::urlencode(p_path_slug) - ); - let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - req_builder = req_builder.json(&p_body_flow_request); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::Flow`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::Flow`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Get a list of all objects that use this object -pub async fn flows_instances_used_by_list( - configuration: &configuration::Configuration, - slug: &str, -) -> Result, Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_slug = slug; - - let uri_str = format!( - "{}/flows/instances/{slug}/used_by/", - configuration.base_path, - slug = crate::apis::urlencode(p_path_slug) - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `Vec<models::UsedBy>`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `Vec<models::UsedBy>`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} diff --git a/packages/client-rust/src/apis/lifecycle_api.rs b/packages/client-rust/src/apis/lifecycle_api.rs deleted file mode 100644 index efbcfef996..0000000000 --- a/packages/client-rust/src/apis/lifecycle_api.rs +++ /dev/null @@ -1,735 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use reqwest; -use serde::{Deserialize, Serialize, de::Error as _}; - -use super::{ContentType, Error, configuration}; -use crate::{apis::ResponseContent, models}; - -/// struct for typed errors of method [`lifecycle_iterations_create`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum LifecycleIterationsCreateError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`lifecycle_iterations_latest_retrieve`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum LifecycleIterationsLatestRetrieveError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`lifecycle_iterations_list_open`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum LifecycleIterationsListOpenError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`lifecycle_reviews_create`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum LifecycleReviewsCreateError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`lifecycle_rules_create`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum LifecycleRulesCreateError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`lifecycle_rules_destroy`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum LifecycleRulesDestroyError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`lifecycle_rules_list`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum LifecycleRulesListError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`lifecycle_rules_partial_update`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum LifecycleRulesPartialUpdateError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`lifecycle_rules_retrieve`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum LifecycleRulesRetrieveError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`lifecycle_rules_update`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum LifecycleRulesUpdateError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// Mixin to validate that a valid enterprise license exists before allowing to save the object -pub async fn lifecycle_iterations_create( - configuration: &configuration::Configuration, - lifecycle_iteration_request: models::LifecycleIterationRequest, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_body_lifecycle_iteration_request = lifecycle_iteration_request; - - let uri_str = format!("{}/lifecycle/iterations/", configuration.base_path); - let mut req_builder = configuration - .client - .request(reqwest::Method::POST, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - req_builder = req_builder.json(&p_body_lifecycle_iteration_request); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::LifecycleIteration`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::LifecycleIteration`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Mixin to validate that a valid enterprise license exists before allowing to save the object -pub async fn lifecycle_iterations_latest_retrieve( - configuration: &configuration::Configuration, - content_type: &str, - object_id: &str, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_content_type = content_type; - let p_path_object_id = object_id; - - let uri_str = format!( - "{}/lifecycle/iterations/latest/{content_type}/{object_id}/", - configuration.base_path, - content_type = crate::apis::urlencode(p_path_content_type), - object_id = crate::apis::urlencode(p_path_object_id) - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::LifecycleIteration`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::LifecycleIteration`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Mixin to validate that a valid enterprise license exists before allowing to save the object -pub async fn lifecycle_iterations_list_open( - configuration: &configuration::Configuration, - ordering: Option<&str>, - page: Option, - page_size: Option, - search: Option<&str>, - user_is_reviewer: Option, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_query_ordering = ordering; - let p_query_page = page; - let p_query_page_size = page_size; - let p_query_search = search; - let p_query_user_is_reviewer = user_is_reviewer; - - let uri_str = format!("{}/lifecycle/iterations/open/", configuration.base_path); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref param_value) = p_query_ordering { - req_builder = req_builder.query(&[("ordering", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_page { - req_builder = req_builder.query(&[("page", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_page_size { - req_builder = req_builder.query(&[("page_size", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_search { - req_builder = req_builder.query(&[("search", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_user_is_reviewer { - req_builder = req_builder.query(&[("user_is_reviewer", ¶m_value.to_string())]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::PaginatedLifecycleIterationList`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::PaginatedLifecycleIterationList`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Mixin to validate that a valid enterprise license exists before allowing to save the object -pub async fn lifecycle_reviews_create( - configuration: &configuration::Configuration, - review_request: models::ReviewRequest, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_body_review_request = review_request; - - let uri_str = format!("{}/lifecycle/reviews/", configuration.base_path); - let mut req_builder = configuration - .client - .request(reqwest::Method::POST, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - req_builder = req_builder.json(&p_body_review_request); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::Review`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::Review`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -pub async fn lifecycle_rules_create( - configuration: &configuration::Configuration, - lifecycle_rule_request: models::LifecycleRuleRequest, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_body_lifecycle_rule_request = lifecycle_rule_request; - - let uri_str = format!("{}/lifecycle/rules/", configuration.base_path); - let mut req_builder = configuration - .client - .request(reqwest::Method::POST, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - req_builder = req_builder.json(&p_body_lifecycle_rule_request); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::LifecycleRule`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::LifecycleRule`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -pub async fn lifecycle_rules_destroy( - configuration: &configuration::Configuration, - id: &str, -) -> Result<(), Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_id = id; - - let uri_str = format!( - "{}/lifecycle/rules/{id}/", - configuration.base_path, - id = crate::apis::urlencode(p_path_id) - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::DELETE, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - - if !status.is_client_error() && !status.is_server_error() { - Ok(()) - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -pub async fn lifecycle_rules_list( - configuration: &configuration::Configuration, - content_type__model: Option<&str>, - ordering: Option<&str>, - page: Option, - page_size: Option, - search: Option<&str>, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_query_content_type__model = content_type__model; - let p_query_ordering = ordering; - let p_query_page = page; - let p_query_page_size = page_size; - let p_query_search = search; - - let uri_str = format!("{}/lifecycle/rules/", configuration.base_path); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref param_value) = p_query_content_type__model { - req_builder = req_builder.query(&[("content_type__model", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_ordering { - req_builder = req_builder.query(&[("ordering", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_page { - req_builder = req_builder.query(&[("page", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_page_size { - req_builder = req_builder.query(&[("page_size", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_search { - req_builder = req_builder.query(&[("search", ¶m_value.to_string())]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::PaginatedLifecycleRuleList`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::PaginatedLifecycleRuleList`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -pub async fn lifecycle_rules_partial_update( - configuration: &configuration::Configuration, - id: &str, - patched_lifecycle_rule_request: Option, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_id = id; - let p_body_patched_lifecycle_rule_request = patched_lifecycle_rule_request; - - let uri_str = format!( - "{}/lifecycle/rules/{id}/", - configuration.base_path, - id = crate::apis::urlencode(p_path_id) - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::PATCH, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - req_builder = req_builder.json(&p_body_patched_lifecycle_rule_request); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::LifecycleRule`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::LifecycleRule`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -pub async fn lifecycle_rules_retrieve( - configuration: &configuration::Configuration, - id: &str, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_id = id; - - let uri_str = format!( - "{}/lifecycle/rules/{id}/", - configuration.base_path, - id = crate::apis::urlencode(p_path_id) - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::LifecycleRule`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::LifecycleRule`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -pub async fn lifecycle_rules_update( - configuration: &configuration::Configuration, - id: &str, - lifecycle_rule_request: models::LifecycleRuleRequest, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_id = id; - let p_body_lifecycle_rule_request = lifecycle_rule_request; - - let uri_str = format!( - "{}/lifecycle/rules/{id}/", - configuration.base_path, - id = crate::apis::urlencode(p_path_id) - ); - let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - req_builder = req_builder.json(&p_body_lifecycle_rule_request); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::LifecycleRule`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::LifecycleRule`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} diff --git a/packages/client-rust/src/apis/managed_api.rs b/packages/client-rust/src/apis/managed_api.rs deleted file mode 100644 index 1f97ff18c0..0000000000 --- a/packages/client-rust/src/apis/managed_api.rs +++ /dev/null @@ -1,740 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use reqwest; -use serde::{Deserialize, Serialize, de::Error as _}; -use tokio::fs::File as TokioFile; -use tokio_util::codec::{BytesCodec, FramedRead}; - -use super::{ContentType, Error, configuration}; -use crate::{apis::ResponseContent, models}; - -/// struct for typed errors of method [`managed_blueprints_apply_create`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum ManagedBlueprintsApplyCreateError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`managed_blueprints_available_list`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum ManagedBlueprintsAvailableListError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`managed_blueprints_create`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum ManagedBlueprintsCreateError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`managed_blueprints_destroy`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum ManagedBlueprintsDestroyError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`managed_blueprints_import_create`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum ManagedBlueprintsImportCreateError { - Status400(models::BlueprintImportResult), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`managed_blueprints_list`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum ManagedBlueprintsListError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`managed_blueprints_partial_update`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum ManagedBlueprintsPartialUpdateError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`managed_blueprints_retrieve`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum ManagedBlueprintsRetrieveError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`managed_blueprints_update`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum ManagedBlueprintsUpdateError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`managed_blueprints_used_by_list`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum ManagedBlueprintsUsedByListError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// Apply a blueprint -pub async fn managed_blueprints_apply_create( - configuration: &configuration::Configuration, - instance_uuid: &str, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_instance_uuid = instance_uuid; - - let uri_str = format!( - "{}/managed/blueprints/{instance_uuid}/apply/", - configuration.base_path, - instance_uuid = crate::apis::urlencode(p_path_instance_uuid) - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::POST, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::BlueprintInstance`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::BlueprintInstance`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Get blueprints -pub async fn managed_blueprints_available_list( - configuration: &configuration::Configuration, -) -> Result, Error> { - let uri_str = format!("{}/managed/blueprints/available/", configuration.base_path); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `Vec<models::BlueprintFile>`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `Vec<models::BlueprintFile>`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Blueprint instances -pub async fn managed_blueprints_create( - configuration: &configuration::Configuration, - blueprint_instance_request: models::BlueprintInstanceRequest, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_body_blueprint_instance_request = blueprint_instance_request; - - let uri_str = format!("{}/managed/blueprints/", configuration.base_path); - let mut req_builder = configuration - .client - .request(reqwest::Method::POST, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - req_builder = req_builder.json(&p_body_blueprint_instance_request); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::BlueprintInstance`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::BlueprintInstance`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Blueprint instances -pub async fn managed_blueprints_destroy( - configuration: &configuration::Configuration, - instance_uuid: &str, -) -> Result<(), Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_instance_uuid = instance_uuid; - - let uri_str = format!( - "{}/managed/blueprints/{instance_uuid}/", - configuration.base_path, - instance_uuid = crate::apis::urlencode(p_path_instance_uuid) - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::DELETE, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - - if !status.is_client_error() && !status.is_server_error() { - Ok(()) - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Import blueprint from .yaml file and apply it once, without creating an instance -pub async fn managed_blueprints_import_create( - configuration: &configuration::Configuration, - file: Option, - path: Option<&str>, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_form_file = file; - let p_form_path = path; - - let uri_str = format!("{}/managed/blueprints/import/", configuration.base_path); - let mut req_builder = configuration - .client - .request(reqwest::Method::POST, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - let mut multipart_form = reqwest::multipart::Form::new(); - if let Some(ref param_value) = p_form_file { - let file = TokioFile::open(param_value).await?; - let stream = FramedRead::new(file, BytesCodec::new()); - let file_name = param_value - .file_name() - .map(|n| n.to_string_lossy().to_string()) - .unwrap_or_default(); - let file_part = reqwest::multipart::Part::stream(reqwest::Body::wrap_stream(stream)) - .file_name(file_name); - multipart_form = multipart_form.part("file", file_part); - } - if let Some(param_value) = p_form_path { - multipart_form = multipart_form.text("path", param_value.to_string()); - } - req_builder = req_builder.multipart(multipart_form); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::BlueprintImportResult`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::BlueprintImportResult`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Blueprint instances -pub async fn managed_blueprints_list( - configuration: &configuration::Configuration, - name: Option<&str>, - ordering: Option<&str>, - page: Option, - page_size: Option, - path: Option<&str>, - search: Option<&str>, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_query_name = name; - let p_query_ordering = ordering; - let p_query_page = page; - let p_query_page_size = page_size; - let p_query_path = path; - let p_query_search = search; - - let uri_str = format!("{}/managed/blueprints/", configuration.base_path); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref param_value) = p_query_name { - req_builder = req_builder.query(&[("name", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_ordering { - req_builder = req_builder.query(&[("ordering", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_page { - req_builder = req_builder.query(&[("page", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_page_size { - req_builder = req_builder.query(&[("page_size", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_path { - req_builder = req_builder.query(&[("path", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_search { - req_builder = req_builder.query(&[("search", ¶m_value.to_string())]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::PaginatedBlueprintInstanceList`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::PaginatedBlueprintInstanceList`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Blueprint instances -pub async fn managed_blueprints_partial_update( - configuration: &configuration::Configuration, - instance_uuid: &str, - patched_blueprint_instance_request: Option, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_instance_uuid = instance_uuid; - let p_body_patched_blueprint_instance_request = patched_blueprint_instance_request; - - let uri_str = format!( - "{}/managed/blueprints/{instance_uuid}/", - configuration.base_path, - instance_uuid = crate::apis::urlencode(p_path_instance_uuid) - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::PATCH, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - req_builder = req_builder.json(&p_body_patched_blueprint_instance_request); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::BlueprintInstance`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::BlueprintInstance`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Blueprint instances -pub async fn managed_blueprints_retrieve( - configuration: &configuration::Configuration, - instance_uuid: &str, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_instance_uuid = instance_uuid; - - let uri_str = format!( - "{}/managed/blueprints/{instance_uuid}/", - configuration.base_path, - instance_uuid = crate::apis::urlencode(p_path_instance_uuid) - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::BlueprintInstance`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::BlueprintInstance`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Blueprint instances -pub async fn managed_blueprints_update( - configuration: &configuration::Configuration, - instance_uuid: &str, - blueprint_instance_request: models::BlueprintInstanceRequest, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_instance_uuid = instance_uuid; - let p_body_blueprint_instance_request = blueprint_instance_request; - - let uri_str = format!( - "{}/managed/blueprints/{instance_uuid}/", - configuration.base_path, - instance_uuid = crate::apis::urlencode(p_path_instance_uuid) - ); - let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - req_builder = req_builder.json(&p_body_blueprint_instance_request); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::BlueprintInstance`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::BlueprintInstance`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Get a list of all objects that use this object -pub async fn managed_blueprints_used_by_list( - configuration: &configuration::Configuration, - instance_uuid: &str, -) -> Result, Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_instance_uuid = instance_uuid; - - let uri_str = format!( - "{}/managed/blueprints/{instance_uuid}/used_by/", - configuration.base_path, - instance_uuid = crate::apis::urlencode(p_path_instance_uuid) - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `Vec<models::UsedBy>`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `Vec<models::UsedBy>`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} diff --git a/packages/client-rust/src/apis/mod.rs b/packages/client-rust/src/apis/mod.rs index 69b6094918..ed22e46ddb 100644 --- a/packages/client-rust/src/apis/mod.rs +++ b/packages/client-rust/src/apis/mod.rs @@ -121,30 +121,11 @@ impl From<&str> for ContentType { } } -pub mod admin_api; -pub mod authenticators_api; pub mod core_api; pub mod crypto_api; -pub mod endpoints_api; -pub mod enterprise_api; pub mod events_api; pub mod flows_api; -pub mod lifecycle_api; -pub mod managed_api; -pub mod oauth2_api; pub mod outposts_api; -pub mod policies_api; -pub mod propertymappings_api; -pub mod providers_api; -pub mod rac_api; -pub mod rbac_api; -pub mod reports_api; pub mod root_api; -pub mod schema_api; -pub mod sources_api; -pub mod ssf_api; -pub mod stages_api; -pub mod tasks_api; -pub mod tenants_api; pub mod configuration; diff --git a/packages/client-rust/src/apis/oauth2_api.rs b/packages/client-rust/src/apis/oauth2_api.rs deleted file mode 100644 index 1c5f7220a6..0000000000 --- a/packages/client-rust/src/apis/oauth2_api.rs +++ /dev/null @@ -1,872 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use reqwest; -use serde::{Deserialize, Serialize, de::Error as _}; - -use super::{ContentType, Error, configuration}; -use crate::{apis::ResponseContent, models}; - -/// struct for typed errors of method [`oauth2_access_tokens_destroy`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum Oauth2AccessTokensDestroyError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`oauth2_access_tokens_list`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum Oauth2AccessTokensListError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`oauth2_access_tokens_retrieve`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum Oauth2AccessTokensRetrieveError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`oauth2_access_tokens_used_by_list`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum Oauth2AccessTokensUsedByListError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`oauth2_authorization_codes_destroy`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum Oauth2AuthorizationCodesDestroyError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`oauth2_authorization_codes_list`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum Oauth2AuthorizationCodesListError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`oauth2_authorization_codes_retrieve`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum Oauth2AuthorizationCodesRetrieveError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`oauth2_authorization_codes_used_by_list`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum Oauth2AuthorizationCodesUsedByListError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`oauth2_refresh_tokens_destroy`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum Oauth2RefreshTokensDestroyError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`oauth2_refresh_tokens_list`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum Oauth2RefreshTokensListError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`oauth2_refresh_tokens_retrieve`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum Oauth2RefreshTokensRetrieveError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`oauth2_refresh_tokens_used_by_list`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum Oauth2RefreshTokensUsedByListError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// AccessToken Viewset -pub async fn oauth2_access_tokens_destroy( - configuration: &configuration::Configuration, - id: i32, -) -> Result<(), Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_id = id; - - let uri_str = format!( - "{}/oauth2/access_tokens/{id}/", - configuration.base_path, - id = p_path_id - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::DELETE, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - - if !status.is_client_error() && !status.is_server_error() { - Ok(()) - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// AccessToken Viewset -pub async fn oauth2_access_tokens_list( - configuration: &configuration::Configuration, - ordering: Option<&str>, - page: Option, - page_size: Option, - provider: Option, - search: Option<&str>, - user: Option, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_query_ordering = ordering; - let p_query_page = page; - let p_query_page_size = page_size; - let p_query_provider = provider; - let p_query_search = search; - let p_query_user = user; - - let uri_str = format!("{}/oauth2/access_tokens/", configuration.base_path); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref param_value) = p_query_ordering { - req_builder = req_builder.query(&[("ordering", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_page { - req_builder = req_builder.query(&[("page", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_page_size { - req_builder = req_builder.query(&[("page_size", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_provider { - req_builder = req_builder.query(&[("provider", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_search { - req_builder = req_builder.query(&[("search", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_user { - req_builder = req_builder.query(&[("user", ¶m_value.to_string())]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::PaginatedTokenModelList`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::PaginatedTokenModelList`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// AccessToken Viewset -pub async fn oauth2_access_tokens_retrieve( - configuration: &configuration::Configuration, - id: i32, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_id = id; - - let uri_str = format!( - "{}/oauth2/access_tokens/{id}/", - configuration.base_path, - id = p_path_id - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::TokenModel`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::TokenModel`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Get a list of all objects that use this object -pub async fn oauth2_access_tokens_used_by_list( - configuration: &configuration::Configuration, - id: i32, -) -> Result, Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_id = id; - - let uri_str = format!( - "{}/oauth2/access_tokens/{id}/used_by/", - configuration.base_path, - id = p_path_id - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `Vec<models::UsedBy>`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `Vec<models::UsedBy>`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// AuthorizationCode Viewset -pub async fn oauth2_authorization_codes_destroy( - configuration: &configuration::Configuration, - id: i32, -) -> Result<(), Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_id = id; - - let uri_str = format!( - "{}/oauth2/authorization_codes/{id}/", - configuration.base_path, - id = p_path_id - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::DELETE, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - - if !status.is_client_error() && !status.is_server_error() { - Ok(()) - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// AuthorizationCode Viewset -pub async fn oauth2_authorization_codes_list( - configuration: &configuration::Configuration, - ordering: Option<&str>, - page: Option, - page_size: Option, - provider: Option, - search: Option<&str>, - user: Option, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_query_ordering = ordering; - let p_query_page = page; - let p_query_page_size = page_size; - let p_query_provider = provider; - let p_query_search = search; - let p_query_user = user; - - let uri_str = format!("{}/oauth2/authorization_codes/", configuration.base_path); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref param_value) = p_query_ordering { - req_builder = req_builder.query(&[("ordering", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_page { - req_builder = req_builder.query(&[("page", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_page_size { - req_builder = req_builder.query(&[("page_size", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_provider { - req_builder = req_builder.query(&[("provider", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_search { - req_builder = req_builder.query(&[("search", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_user { - req_builder = req_builder.query(&[("user", ¶m_value.to_string())]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::PaginatedExpiringBaseGrantModelList`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::PaginatedExpiringBaseGrantModelList`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// AuthorizationCode Viewset -pub async fn oauth2_authorization_codes_retrieve( - configuration: &configuration::Configuration, - id: i32, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_id = id; - - let uri_str = format!( - "{}/oauth2/authorization_codes/{id}/", - configuration.base_path, - id = p_path_id - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::ExpiringBaseGrantModel`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::ExpiringBaseGrantModel`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Get a list of all objects that use this object -pub async fn oauth2_authorization_codes_used_by_list( - configuration: &configuration::Configuration, - id: i32, -) -> Result, Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_id = id; - - let uri_str = format!( - "{}/oauth2/authorization_codes/{id}/used_by/", - configuration.base_path, - id = p_path_id - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `Vec<models::UsedBy>`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `Vec<models::UsedBy>`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// RefreshToken Viewset -pub async fn oauth2_refresh_tokens_destroy( - configuration: &configuration::Configuration, - id: i32, -) -> Result<(), Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_id = id; - - let uri_str = format!( - "{}/oauth2/refresh_tokens/{id}/", - configuration.base_path, - id = p_path_id - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::DELETE, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - - if !status.is_client_error() && !status.is_server_error() { - Ok(()) - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// RefreshToken Viewset -pub async fn oauth2_refresh_tokens_list( - configuration: &configuration::Configuration, - ordering: Option<&str>, - page: Option, - page_size: Option, - provider: Option, - search: Option<&str>, - user: Option, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_query_ordering = ordering; - let p_query_page = page; - let p_query_page_size = page_size; - let p_query_provider = provider; - let p_query_search = search; - let p_query_user = user; - - let uri_str = format!("{}/oauth2/refresh_tokens/", configuration.base_path); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref param_value) = p_query_ordering { - req_builder = req_builder.query(&[("ordering", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_page { - req_builder = req_builder.query(&[("page", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_page_size { - req_builder = req_builder.query(&[("page_size", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_provider { - req_builder = req_builder.query(&[("provider", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_search { - req_builder = req_builder.query(&[("search", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_user { - req_builder = req_builder.query(&[("user", ¶m_value.to_string())]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::PaginatedTokenModelList`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::PaginatedTokenModelList`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// RefreshToken Viewset -pub async fn oauth2_refresh_tokens_retrieve( - configuration: &configuration::Configuration, - id: i32, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_id = id; - - let uri_str = format!( - "{}/oauth2/refresh_tokens/{id}/", - configuration.base_path, - id = p_path_id - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::TokenModel`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::TokenModel`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Get a list of all objects that use this object -pub async fn oauth2_refresh_tokens_used_by_list( - configuration: &configuration::Configuration, - id: i32, -) -> Result, Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_id = id; - - let uri_str = format!( - "{}/oauth2/refresh_tokens/{id}/used_by/", - configuration.base_path, - id = p_path_id - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `Vec<models::UsedBy>`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `Vec<models::UsedBy>`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} diff --git a/packages/client-rust/src/apis/outposts_api.rs b/packages/client-rust/src/apis/outposts_api.rs index 7bb2611215..3d8aa429c9 100644 --- a/packages/client-rust/src/apis/outposts_api.rs +++ b/packages/client-rust/src/apis/outposts_api.rs @@ -12,42 +12,6 @@ use serde::{Deserialize, Serialize, de::Error as _}; use super::{ContentType, Error, configuration}; use crate::{apis::ResponseContent, models}; -/// struct for typed errors of method [`outposts_instances_create`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum OutpostsInstancesCreateError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`outposts_instances_default_settings_retrieve`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum OutpostsInstancesDefaultSettingsRetrieveError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`outposts_instances_destroy`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum OutpostsInstancesDestroyError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`outposts_instances_health_list`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum OutpostsInstancesHealthListError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - /// struct for typed errors of method [`outposts_instances_list`] #[derive(Debug, Clone, Serialize, Deserialize)] #[serde(untagged)] @@ -57,42 +21,6 @@ pub enum OutpostsInstancesListError { UnknownValue(serde_json::Value), } -/// struct for typed errors of method [`outposts_instances_partial_update`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum OutpostsInstancesPartialUpdateError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`outposts_instances_retrieve`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum OutpostsInstancesRetrieveError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`outposts_instances_update`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum OutpostsInstancesUpdateError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`outposts_instances_used_by_list`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum OutpostsInstancesUsedByListError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - /// struct for typed errors of method [`outposts_ldap_access_check`] #[derive(Debug, Clone, Serialize, Deserialize)] #[serde(untagged)] @@ -138,476 +66,6 @@ pub enum OutpostsRadiusListError { UnknownValue(serde_json::Value), } -/// struct for typed errors of method [`outposts_service_connections_all_destroy`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum OutpostsServiceConnectionsAllDestroyError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`outposts_service_connections_all_list`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum OutpostsServiceConnectionsAllListError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`outposts_service_connections_all_retrieve`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum OutpostsServiceConnectionsAllRetrieveError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`outposts_service_connections_all_state_retrieve`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum OutpostsServiceConnectionsAllStateRetrieveError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`outposts_service_connections_all_types_list`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum OutpostsServiceConnectionsAllTypesListError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`outposts_service_connections_all_used_by_list`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum OutpostsServiceConnectionsAllUsedByListError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`outposts_service_connections_docker_create`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum OutpostsServiceConnectionsDockerCreateError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`outposts_service_connections_docker_destroy`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum OutpostsServiceConnectionsDockerDestroyError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`outposts_service_connections_docker_list`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum OutpostsServiceConnectionsDockerListError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`outposts_service_connections_docker_partial_update`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum OutpostsServiceConnectionsDockerPartialUpdateError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`outposts_service_connections_docker_retrieve`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum OutpostsServiceConnectionsDockerRetrieveError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`outposts_service_connections_docker_update`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum OutpostsServiceConnectionsDockerUpdateError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`outposts_service_connections_docker_used_by_list`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum OutpostsServiceConnectionsDockerUsedByListError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`outposts_service_connections_kubernetes_create`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum OutpostsServiceConnectionsKubernetesCreateError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`outposts_service_connections_kubernetes_destroy`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum OutpostsServiceConnectionsKubernetesDestroyError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`outposts_service_connections_kubernetes_list`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum OutpostsServiceConnectionsKubernetesListError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`outposts_service_connections_kubernetes_partial_update`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum OutpostsServiceConnectionsKubernetesPartialUpdateError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`outposts_service_connections_kubernetes_retrieve`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum OutpostsServiceConnectionsKubernetesRetrieveError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`outposts_service_connections_kubernetes_update`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum OutpostsServiceConnectionsKubernetesUpdateError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`outposts_service_connections_kubernetes_used_by_list`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum OutpostsServiceConnectionsKubernetesUsedByListError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// Outpost Viewset -pub async fn outposts_instances_create( - configuration: &configuration::Configuration, - outpost_request: models::OutpostRequest, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_body_outpost_request = outpost_request; - - let uri_str = format!("{}/outposts/instances/", configuration.base_path); - let mut req_builder = configuration - .client - .request(reqwest::Method::POST, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - req_builder = req_builder.json(&p_body_outpost_request); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::Outpost`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::Outpost`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Global default outpost config -pub async fn outposts_instances_default_settings_retrieve( - configuration: &configuration::Configuration, -) -> Result> { - let uri_str = format!( - "{}/outposts/instances/default_settings/", - configuration.base_path - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::OutpostDefaultConfig`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::OutpostDefaultConfig`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Outpost Viewset -pub async fn outposts_instances_destroy( - configuration: &configuration::Configuration, - uuid: &str, -) -> Result<(), Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_uuid = uuid; - - let uri_str = format!( - "{}/outposts/instances/{uuid}/", - configuration.base_path, - uuid = crate::apis::urlencode(p_path_uuid) - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::DELETE, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - - if !status.is_client_error() && !status.is_server_error() { - Ok(()) - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Get outposts current health -pub async fn outposts_instances_health_list( - configuration: &configuration::Configuration, - uuid: &str, - managed__icontains: Option<&str>, - managed__iexact: Option<&str>, - name__icontains: Option<&str>, - name__iexact: Option<&str>, - ordering: Option<&str>, - providers__isnull: Option, - providers_by_pk: Option>, - search: Option<&str>, - service_connection__name__icontains: Option<&str>, - service_connection__name__iexact: Option<&str>, -) -> Result, Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_uuid = uuid; - let p_query_managed__icontains = managed__icontains; - let p_query_managed__iexact = managed__iexact; - let p_query_name__icontains = name__icontains; - let p_query_name__iexact = name__iexact; - let p_query_ordering = ordering; - let p_query_providers__isnull = providers__isnull; - let p_query_providers_by_pk = providers_by_pk; - let p_query_search = search; - let p_query_service_connection__name__icontains = service_connection__name__icontains; - let p_query_service_connection__name__iexact = service_connection__name__iexact; - - let uri_str = format!( - "{}/outposts/instances/{uuid}/health/", - configuration.base_path, - uuid = crate::apis::urlencode(p_path_uuid) - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref param_value) = p_query_managed__icontains { - req_builder = req_builder.query(&[("managed__icontains", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_managed__iexact { - req_builder = req_builder.query(&[("managed__iexact", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_name__icontains { - req_builder = req_builder.query(&[("name__icontains", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_name__iexact { - req_builder = req_builder.query(&[("name__iexact", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_ordering { - req_builder = req_builder.query(&[("ordering", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_providers__isnull { - req_builder = req_builder.query(&[("providers__isnull", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_providers_by_pk { - req_builder = match "multi" { - "multi" => req_builder.query( - ¶m_value - .into_iter() - .map(|p| ("providers_by_pk".to_owned(), p.to_string())) - .collect::>(), - ), - _ => req_builder.query(&[( - "providers_by_pk", - ¶m_value - .into_iter() - .map(|p| p.to_string()) - .collect::>() - .join(",") - .to_string(), - )]), - }; - } - if let Some(ref param_value) = p_query_search { - req_builder = req_builder.query(&[("search", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_service_connection__name__icontains { - req_builder = req_builder.query(&[( - "service_connection__name__icontains", - ¶m_value.to_string(), - )]); - } - if let Some(ref param_value) = p_query_service_connection__name__iexact { - req_builder = - req_builder.query(&[("service_connection__name__iexact", ¶m_value.to_string())]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `Vec<models::OutpostHealth>`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `Vec<models::OutpostHealth>`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - /// Outpost Viewset pub async fn outposts_instances_list( configuration: &configuration::Configuration, @@ -700,9 +158,6 @@ pub async fn outposts_instances_list( if let Some(ref user_agent) = configuration.user_agent { req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; let req = req_builder.build()?; let resp = configuration.client.execute(req).await?; @@ -743,259 +198,6 @@ pub async fn outposts_instances_list( } } -/// Outpost Viewset -pub async fn outposts_instances_partial_update( - configuration: &configuration::Configuration, - uuid: &str, - patched_outpost_request: Option, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_uuid = uuid; - let p_body_patched_outpost_request = patched_outpost_request; - - let uri_str = format!( - "{}/outposts/instances/{uuid}/", - configuration.base_path, - uuid = crate::apis::urlencode(p_path_uuid) - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::PATCH, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - req_builder = req_builder.json(&p_body_patched_outpost_request); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::Outpost`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::Outpost`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Outpost Viewset -pub async fn outposts_instances_retrieve( - configuration: &configuration::Configuration, - uuid: &str, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_uuid = uuid; - - let uri_str = format!( - "{}/outposts/instances/{uuid}/", - configuration.base_path, - uuid = crate::apis::urlencode(p_path_uuid) - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::Outpost`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::Outpost`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Outpost Viewset -pub async fn outposts_instances_update( - configuration: &configuration::Configuration, - uuid: &str, - outpost_request: models::OutpostRequest, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_uuid = uuid; - let p_body_outpost_request = outpost_request; - - let uri_str = format!( - "{}/outposts/instances/{uuid}/", - configuration.base_path, - uuid = crate::apis::urlencode(p_path_uuid) - ); - let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - req_builder = req_builder.json(&p_body_outpost_request); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::Outpost`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::Outpost`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Get a list of all objects that use this object -pub async fn outposts_instances_used_by_list( - configuration: &configuration::Configuration, - uuid: &str, -) -> Result, Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_uuid = uuid; - - let uri_str = format!( - "{}/outposts/instances/{uuid}/used_by/", - configuration.base_path, - uuid = crate::apis::urlencode(p_path_uuid) - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `Vec<models::UsedBy>`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `Vec<models::UsedBy>`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - /// Check access to a single application by slug pub async fn outposts_ldap_access_check( configuration: &configuration::Configuration, @@ -1019,9 +221,6 @@ pub async fn outposts_ldap_access_check( if let Some(ref user_agent) = configuration.user_agent { req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; let req = req_builder.build()?; let resp = configuration.client.execute(req).await?; @@ -1099,9 +298,6 @@ pub async fn outposts_ldap_list( if let Some(ref user_agent) = configuration.user_agent { req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; let req = req_builder.build()?; let resp = configuration.client.execute(req).await?; @@ -1179,9 +375,6 @@ pub async fn outposts_proxy_list( if let Some(ref user_agent) = configuration.user_agent { req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; let req = req_builder.build()?; let resp = configuration.client.execute(req).await?; @@ -1245,9 +438,6 @@ pub async fn outposts_radius_access_check( if let Some(ref user_agent) = configuration.user_agent { req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; let req = req_builder.build()?; let resp = configuration.client.execute(req).await?; @@ -1325,9 +515,6 @@ pub async fn outposts_radius_list( if let Some(ref user_agent) = configuration.user_agent { req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; let req = req_builder.build()?; let resp = configuration.client.execute(req).await?; @@ -1367,1320 +554,3 @@ pub async fn outposts_radius_list( })) } } - -/// ServiceConnection Viewset -pub async fn outposts_service_connections_all_destroy( - configuration: &configuration::Configuration, - uuid: &str, -) -> Result<(), Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_uuid = uuid; - - let uri_str = format!( - "{}/outposts/service_connections/all/{uuid}/", - configuration.base_path, - uuid = crate::apis::urlencode(p_path_uuid) - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::DELETE, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - - if !status.is_client_error() && !status.is_server_error() { - Ok(()) - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// ServiceConnection Viewset -pub async fn outposts_service_connections_all_list( - configuration: &configuration::Configuration, - name: Option<&str>, - ordering: Option<&str>, - page: Option, - page_size: Option, - search: Option<&str>, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_query_name = name; - let p_query_ordering = ordering; - let p_query_page = page; - let p_query_page_size = page_size; - let p_query_search = search; - - let uri_str = format!( - "{}/outposts/service_connections/all/", - configuration.base_path - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref param_value) = p_query_name { - req_builder = req_builder.query(&[("name", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_ordering { - req_builder = req_builder.query(&[("ordering", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_page { - req_builder = req_builder.query(&[("page", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_page_size { - req_builder = req_builder.query(&[("page_size", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_search { - req_builder = req_builder.query(&[("search", ¶m_value.to_string())]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::PaginatedServiceConnectionList`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::PaginatedServiceConnectionList`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// ServiceConnection Viewset -pub async fn outposts_service_connections_all_retrieve( - configuration: &configuration::Configuration, - uuid: &str, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_uuid = uuid; - - let uri_str = format!( - "{}/outposts/service_connections/all/{uuid}/", - configuration.base_path, - uuid = crate::apis::urlencode(p_path_uuid) - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::ServiceConnection`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::ServiceConnection`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Get the service connection's state -pub async fn outposts_service_connections_all_state_retrieve( - configuration: &configuration::Configuration, - uuid: &str, -) -> Result> -{ - // add a prefix to parameters to efficiently prevent name collisions - let p_path_uuid = uuid; - - let uri_str = format!( - "{}/outposts/service_connections/all/{uuid}/state/", - configuration.base_path, - uuid = crate::apis::urlencode(p_path_uuid) - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::ServiceConnectionState`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::ServiceConnectionState`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Get all creatable types -pub async fn outposts_service_connections_all_types_list( - configuration: &configuration::Configuration, -) -> Result, Error> { - let uri_str = format!( - "{}/outposts/service_connections/all/types/", - configuration.base_path - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `Vec<models::TypeCreate>`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `Vec<models::TypeCreate>`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Get a list of all objects that use this object -pub async fn outposts_service_connections_all_used_by_list( - configuration: &configuration::Configuration, - uuid: &str, -) -> Result, Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_uuid = uuid; - - let uri_str = format!( - "{}/outposts/service_connections/all/{uuid}/used_by/", - configuration.base_path, - uuid = crate::apis::urlencode(p_path_uuid) - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `Vec<models::UsedBy>`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `Vec<models::UsedBy>`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// DockerServiceConnection Viewset -pub async fn outposts_service_connections_docker_create( - configuration: &configuration::Configuration, - docker_service_connection_request: models::DockerServiceConnectionRequest, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_body_docker_service_connection_request = docker_service_connection_request; - - let uri_str = format!( - "{}/outposts/service_connections/docker/", - configuration.base_path - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::POST, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - req_builder = req_builder.json(&p_body_docker_service_connection_request); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::DockerServiceConnection`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::DockerServiceConnection`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// DockerServiceConnection Viewset -pub async fn outposts_service_connections_docker_destroy( - configuration: &configuration::Configuration, - uuid: &str, -) -> Result<(), Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_uuid = uuid; - - let uri_str = format!( - "{}/outposts/service_connections/docker/{uuid}/", - configuration.base_path, - uuid = crate::apis::urlencode(p_path_uuid) - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::DELETE, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - - if !status.is_client_error() && !status.is_server_error() { - Ok(()) - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// DockerServiceConnection Viewset -pub async fn outposts_service_connections_docker_list( - configuration: &configuration::Configuration, - local: Option, - name: Option<&str>, - ordering: Option<&str>, - page: Option, - page_size: Option, - search: Option<&str>, - tls_authentication: Option<&str>, - tls_verification: Option<&str>, - url: Option<&str>, -) -> Result< - models::PaginatedDockerServiceConnectionList, - Error, -> { - // add a prefix to parameters to efficiently prevent name collisions - let p_query_local = local; - let p_query_name = name; - let p_query_ordering = ordering; - let p_query_page = page; - let p_query_page_size = page_size; - let p_query_search = search; - let p_query_tls_authentication = tls_authentication; - let p_query_tls_verification = tls_verification; - let p_query_url = url; - - let uri_str = format!( - "{}/outposts/service_connections/docker/", - configuration.base_path - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref param_value) = p_query_local { - req_builder = req_builder.query(&[("local", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_name { - req_builder = req_builder.query(&[("name", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_ordering { - req_builder = req_builder.query(&[("ordering", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_page { - req_builder = req_builder.query(&[("page", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_page_size { - req_builder = req_builder.query(&[("page_size", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_search { - req_builder = req_builder.query(&[("search", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_tls_authentication { - req_builder = req_builder.query(&[("tls_authentication", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_tls_verification { - req_builder = req_builder.query(&[("tls_verification", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_url { - req_builder = req_builder.query(&[("url", ¶m_value.to_string())]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::PaginatedDockerServiceConnectionList`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::PaginatedDockerServiceConnectionList`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// DockerServiceConnection Viewset -pub async fn outposts_service_connections_docker_partial_update( - configuration: &configuration::Configuration, - uuid: &str, - patched_docker_service_connection_request: Option< - models::PatchedDockerServiceConnectionRequest, - >, -) -> Result< - models::DockerServiceConnection, - Error, -> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_uuid = uuid; - let p_body_patched_docker_service_connection_request = - patched_docker_service_connection_request; - - let uri_str = format!( - "{}/outposts/service_connections/docker/{uuid}/", - configuration.base_path, - uuid = crate::apis::urlencode(p_path_uuid) - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::PATCH, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - req_builder = req_builder.json(&p_body_patched_docker_service_connection_request); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::DockerServiceConnection`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::DockerServiceConnection`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// DockerServiceConnection Viewset -pub async fn outposts_service_connections_docker_retrieve( - configuration: &configuration::Configuration, - uuid: &str, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_uuid = uuid; - - let uri_str = format!( - "{}/outposts/service_connections/docker/{uuid}/", - configuration.base_path, - uuid = crate::apis::urlencode(p_path_uuid) - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::DockerServiceConnection`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::DockerServiceConnection`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// DockerServiceConnection Viewset -pub async fn outposts_service_connections_docker_update( - configuration: &configuration::Configuration, - uuid: &str, - docker_service_connection_request: models::DockerServiceConnectionRequest, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_uuid = uuid; - let p_body_docker_service_connection_request = docker_service_connection_request; - - let uri_str = format!( - "{}/outposts/service_connections/docker/{uuid}/", - configuration.base_path, - uuid = crate::apis::urlencode(p_path_uuid) - ); - let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - req_builder = req_builder.json(&p_body_docker_service_connection_request); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::DockerServiceConnection`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::DockerServiceConnection`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Get a list of all objects that use this object -pub async fn outposts_service_connections_docker_used_by_list( - configuration: &configuration::Configuration, - uuid: &str, -) -> Result, Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_uuid = uuid; - - let uri_str = format!( - "{}/outposts/service_connections/docker/{uuid}/used_by/", - configuration.base_path, - uuid = crate::apis::urlencode(p_path_uuid) - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `Vec<models::UsedBy>`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `Vec<models::UsedBy>`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// KubernetesServiceConnection Viewset -pub async fn outposts_service_connections_kubernetes_create( - configuration: &configuration::Configuration, - kubernetes_service_connection_request: models::KubernetesServiceConnectionRequest, -) -> Result< - models::KubernetesServiceConnection, - Error, -> { - // add a prefix to parameters to efficiently prevent name collisions - let p_body_kubernetes_service_connection_request = kubernetes_service_connection_request; - - let uri_str = format!( - "{}/outposts/service_connections/kubernetes/", - configuration.base_path - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::POST, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - req_builder = req_builder.json(&p_body_kubernetes_service_connection_request); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::KubernetesServiceConnection`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::KubernetesServiceConnection`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// KubernetesServiceConnection Viewset -pub async fn outposts_service_connections_kubernetes_destroy( - configuration: &configuration::Configuration, - uuid: &str, -) -> Result<(), Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_uuid = uuid; - - let uri_str = format!( - "{}/outposts/service_connections/kubernetes/{uuid}/", - configuration.base_path, - uuid = crate::apis::urlencode(p_path_uuid) - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::DELETE, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - - if !status.is_client_error() && !status.is_server_error() { - Ok(()) - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// KubernetesServiceConnection Viewset -pub async fn outposts_service_connections_kubernetes_list( - configuration: &configuration::Configuration, - local: Option, - name: Option<&str>, - ordering: Option<&str>, - page: Option, - page_size: Option, - search: Option<&str>, -) -> Result< - models::PaginatedKubernetesServiceConnectionList, - Error, -> { - // add a prefix to parameters to efficiently prevent name collisions - let p_query_local = local; - let p_query_name = name; - let p_query_ordering = ordering; - let p_query_page = page; - let p_query_page_size = page_size; - let p_query_search = search; - - let uri_str = format!( - "{}/outposts/service_connections/kubernetes/", - configuration.base_path - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref param_value) = p_query_local { - req_builder = req_builder.query(&[("local", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_name { - req_builder = req_builder.query(&[("name", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_ordering { - req_builder = req_builder.query(&[("ordering", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_page { - req_builder = req_builder.query(&[("page", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_page_size { - req_builder = req_builder.query(&[("page_size", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_search { - req_builder = req_builder.query(&[("search", ¶m_value.to_string())]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::PaginatedKubernetesServiceConnectionList`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::PaginatedKubernetesServiceConnectionList`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// KubernetesServiceConnection Viewset -pub async fn outposts_service_connections_kubernetes_partial_update( - configuration: &configuration::Configuration, - uuid: &str, - patched_kubernetes_service_connection_request: Option< - models::PatchedKubernetesServiceConnectionRequest, - >, -) -> Result< - models::KubernetesServiceConnection, - Error, -> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_uuid = uuid; - let p_body_patched_kubernetes_service_connection_request = - patched_kubernetes_service_connection_request; - - let uri_str = format!( - "{}/outposts/service_connections/kubernetes/{uuid}/", - configuration.base_path, - uuid = crate::apis::urlencode(p_path_uuid) - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::PATCH, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - req_builder = req_builder.json(&p_body_patched_kubernetes_service_connection_request); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::KubernetesServiceConnection`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::KubernetesServiceConnection`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// KubernetesServiceConnection Viewset -pub async fn outposts_service_connections_kubernetes_retrieve( - configuration: &configuration::Configuration, - uuid: &str, -) -> Result< - models::KubernetesServiceConnection, - Error, -> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_uuid = uuid; - - let uri_str = format!( - "{}/outposts/service_connections/kubernetes/{uuid}/", - configuration.base_path, - uuid = crate::apis::urlencode(p_path_uuid) - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::KubernetesServiceConnection`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::KubernetesServiceConnection`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// KubernetesServiceConnection Viewset -pub async fn outposts_service_connections_kubernetes_update( - configuration: &configuration::Configuration, - uuid: &str, - kubernetes_service_connection_request: models::KubernetesServiceConnectionRequest, -) -> Result< - models::KubernetesServiceConnection, - Error, -> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_uuid = uuid; - let p_body_kubernetes_service_connection_request = kubernetes_service_connection_request; - - let uri_str = format!( - "{}/outposts/service_connections/kubernetes/{uuid}/", - configuration.base_path, - uuid = crate::apis::urlencode(p_path_uuid) - ); - let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - req_builder = req_builder.json(&p_body_kubernetes_service_connection_request); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::KubernetesServiceConnection`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::KubernetesServiceConnection`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Get a list of all objects that use this object -pub async fn outposts_service_connections_kubernetes_used_by_list( - configuration: &configuration::Configuration, - uuid: &str, -) -> Result, Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_uuid = uuid; - - let uri_str = format!( - "{}/outposts/service_connections/kubernetes/{uuid}/used_by/", - configuration.base_path, - uuid = crate::apis::urlencode(p_path_uuid) - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `Vec<models::UsedBy>`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `Vec<models::UsedBy>`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} diff --git a/packages/client-rust/src/apis/policies_api.rs b/packages/client-rust/src/apis/policies_api.rs deleted file mode 100644 index ce0aab3dde..0000000000 --- a/packages/client-rust/src/apis/policies_api.rs +++ /dev/null @@ -1,5729 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use reqwest; -use serde::{Deserialize, Serialize, de::Error as _}; - -use super::{ContentType, Error, configuration}; -use crate::{apis::ResponseContent, models}; - -/// struct for typed errors of method [`policies_all_cache_clear_create`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum PoliciesAllCacheClearCreateError { - Status400(), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`policies_all_cache_info_retrieve`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum PoliciesAllCacheInfoRetrieveError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`policies_all_destroy`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum PoliciesAllDestroyError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`policies_all_list`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum PoliciesAllListError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`policies_all_retrieve`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum PoliciesAllRetrieveError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`policies_all_test_create`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum PoliciesAllTestCreateError { - Status400(), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`policies_all_types_list`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum PoliciesAllTypesListError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`policies_all_used_by_list`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum PoliciesAllUsedByListError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`policies_bindings_create`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum PoliciesBindingsCreateError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`policies_bindings_destroy`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum PoliciesBindingsDestroyError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`policies_bindings_list`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum PoliciesBindingsListError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`policies_bindings_partial_update`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum PoliciesBindingsPartialUpdateError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`policies_bindings_retrieve`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum PoliciesBindingsRetrieveError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`policies_bindings_update`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum PoliciesBindingsUpdateError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`policies_bindings_used_by_list`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum PoliciesBindingsUsedByListError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`policies_dummy_create`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum PoliciesDummyCreateError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`policies_dummy_destroy`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum PoliciesDummyDestroyError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`policies_dummy_list`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum PoliciesDummyListError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`policies_dummy_partial_update`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum PoliciesDummyPartialUpdateError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`policies_dummy_retrieve`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum PoliciesDummyRetrieveError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`policies_dummy_update`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum PoliciesDummyUpdateError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`policies_dummy_used_by_list`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum PoliciesDummyUsedByListError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`policies_event_matcher_create`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum PoliciesEventMatcherCreateError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`policies_event_matcher_destroy`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum PoliciesEventMatcherDestroyError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`policies_event_matcher_list`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum PoliciesEventMatcherListError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`policies_event_matcher_partial_update`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum PoliciesEventMatcherPartialUpdateError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`policies_event_matcher_retrieve`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum PoliciesEventMatcherRetrieveError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`policies_event_matcher_update`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum PoliciesEventMatcherUpdateError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`policies_event_matcher_used_by_list`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum PoliciesEventMatcherUsedByListError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`policies_expression_create`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum PoliciesExpressionCreateError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`policies_expression_destroy`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum PoliciesExpressionDestroyError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`policies_expression_list`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum PoliciesExpressionListError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`policies_expression_partial_update`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum PoliciesExpressionPartialUpdateError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`policies_expression_retrieve`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum PoliciesExpressionRetrieveError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`policies_expression_update`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum PoliciesExpressionUpdateError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`policies_expression_used_by_list`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum PoliciesExpressionUsedByListError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`policies_geoip_create`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum PoliciesGeoipCreateError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`policies_geoip_destroy`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum PoliciesGeoipDestroyError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`policies_geoip_iso3166_list`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum PoliciesGeoipIso3166ListError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`policies_geoip_list`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum PoliciesGeoipListError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`policies_geoip_partial_update`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum PoliciesGeoipPartialUpdateError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`policies_geoip_retrieve`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum PoliciesGeoipRetrieveError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`policies_geoip_update`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum PoliciesGeoipUpdateError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`policies_geoip_used_by_list`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum PoliciesGeoipUsedByListError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`policies_password_create`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum PoliciesPasswordCreateError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`policies_password_destroy`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum PoliciesPasswordDestroyError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`policies_password_expiry_create`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum PoliciesPasswordExpiryCreateError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`policies_password_expiry_destroy`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum PoliciesPasswordExpiryDestroyError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`policies_password_expiry_list`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum PoliciesPasswordExpiryListError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`policies_password_expiry_partial_update`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum PoliciesPasswordExpiryPartialUpdateError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`policies_password_expiry_retrieve`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum PoliciesPasswordExpiryRetrieveError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`policies_password_expiry_update`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum PoliciesPasswordExpiryUpdateError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`policies_password_expiry_used_by_list`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum PoliciesPasswordExpiryUsedByListError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`policies_password_list`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum PoliciesPasswordListError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`policies_password_partial_update`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum PoliciesPasswordPartialUpdateError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`policies_password_retrieve`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum PoliciesPasswordRetrieveError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`policies_password_update`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum PoliciesPasswordUpdateError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`policies_password_used_by_list`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum PoliciesPasswordUsedByListError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`policies_reputation_create`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum PoliciesReputationCreateError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`policies_reputation_destroy`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum PoliciesReputationDestroyError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`policies_reputation_list`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum PoliciesReputationListError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`policies_reputation_partial_update`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum PoliciesReputationPartialUpdateError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`policies_reputation_retrieve`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum PoliciesReputationRetrieveError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`policies_reputation_scores_destroy`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum PoliciesReputationScoresDestroyError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`policies_reputation_scores_list`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum PoliciesReputationScoresListError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`policies_reputation_scores_retrieve`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum PoliciesReputationScoresRetrieveError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`policies_reputation_scores_used_by_list`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum PoliciesReputationScoresUsedByListError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`policies_reputation_update`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum PoliciesReputationUpdateError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`policies_reputation_used_by_list`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum PoliciesReputationUsedByListError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`policies_unique_password_create`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum PoliciesUniquePasswordCreateError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`policies_unique_password_destroy`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum PoliciesUniquePasswordDestroyError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`policies_unique_password_list`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum PoliciesUniquePasswordListError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`policies_unique_password_partial_update`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum PoliciesUniquePasswordPartialUpdateError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`policies_unique_password_retrieve`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum PoliciesUniquePasswordRetrieveError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`policies_unique_password_update`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum PoliciesUniquePasswordUpdateError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`policies_unique_password_used_by_list`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum PoliciesUniquePasswordUsedByListError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// Clear policy cache -pub async fn policies_all_cache_clear_create( - configuration: &configuration::Configuration, -) -> Result<(), Error> { - let uri_str = format!("{}/policies/all/cache_clear/", configuration.base_path); - let mut req_builder = configuration - .client - .request(reqwest::Method::POST, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - - if !status.is_client_error() && !status.is_server_error() { - Ok(()) - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Info about cached policies -pub async fn policies_all_cache_info_retrieve( - configuration: &configuration::Configuration, -) -> Result> { - let uri_str = format!("{}/policies/all/cache_info/", configuration.base_path); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::Cache`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::Cache`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Policy Viewset -pub async fn policies_all_destroy( - configuration: &configuration::Configuration, - policy_uuid: &str, -) -> Result<(), Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_policy_uuid = policy_uuid; - - let uri_str = format!( - "{}/policies/all/{policy_uuid}/", - configuration.base_path, - policy_uuid = crate::apis::urlencode(p_path_policy_uuid) - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::DELETE, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - - if !status.is_client_error() && !status.is_server_error() { - Ok(()) - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Policy Viewset -pub async fn policies_all_list( - configuration: &configuration::Configuration, - bindings__isnull: Option, - ordering: Option<&str>, - page: Option, - page_size: Option, - promptstage__isnull: Option, - search: Option<&str>, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_query_bindings__isnull = bindings__isnull; - let p_query_ordering = ordering; - let p_query_page = page; - let p_query_page_size = page_size; - let p_query_promptstage__isnull = promptstage__isnull; - let p_query_search = search; - - let uri_str = format!("{}/policies/all/", configuration.base_path); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref param_value) = p_query_bindings__isnull { - req_builder = req_builder.query(&[("bindings__isnull", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_ordering { - req_builder = req_builder.query(&[("ordering", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_page { - req_builder = req_builder.query(&[("page", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_page_size { - req_builder = req_builder.query(&[("page_size", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_promptstage__isnull { - req_builder = req_builder.query(&[("promptstage__isnull", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_search { - req_builder = req_builder.query(&[("search", ¶m_value.to_string())]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::PaginatedPolicyList`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::PaginatedPolicyList`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Policy Viewset -pub async fn policies_all_retrieve( - configuration: &configuration::Configuration, - policy_uuid: &str, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_policy_uuid = policy_uuid; - - let uri_str = format!( - "{}/policies/all/{policy_uuid}/", - configuration.base_path, - policy_uuid = crate::apis::urlencode(p_path_policy_uuid) - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::Policy`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::Policy`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Test policy -pub async fn policies_all_test_create( - configuration: &configuration::Configuration, - policy_uuid: &str, - policy_test_request: models::PolicyTestRequest, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_policy_uuid = policy_uuid; - let p_body_policy_test_request = policy_test_request; - - let uri_str = format!( - "{}/policies/all/{policy_uuid}/test/", - configuration.base_path, - policy_uuid = crate::apis::urlencode(p_path_policy_uuid) - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::POST, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - req_builder = req_builder.json(&p_body_policy_test_request); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::PolicyTestResult`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::PolicyTestResult`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Get all creatable types -pub async fn policies_all_types_list( - configuration: &configuration::Configuration, -) -> Result, Error> { - let uri_str = format!("{}/policies/all/types/", configuration.base_path); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `Vec<models::TypeCreate>`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `Vec<models::TypeCreate>`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Get a list of all objects that use this object -pub async fn policies_all_used_by_list( - configuration: &configuration::Configuration, - policy_uuid: &str, -) -> Result, Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_policy_uuid = policy_uuid; - - let uri_str = format!( - "{}/policies/all/{policy_uuid}/used_by/", - configuration.base_path, - policy_uuid = crate::apis::urlencode(p_path_policy_uuid) - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `Vec<models::UsedBy>`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `Vec<models::UsedBy>`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// PolicyBinding Viewset -pub async fn policies_bindings_create( - configuration: &configuration::Configuration, - policy_binding_request: models::PolicyBindingRequest, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_body_policy_binding_request = policy_binding_request; - - let uri_str = format!("{}/policies/bindings/", configuration.base_path); - let mut req_builder = configuration - .client - .request(reqwest::Method::POST, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - req_builder = req_builder.json(&p_body_policy_binding_request); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::PolicyBinding`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::PolicyBinding`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// PolicyBinding Viewset -pub async fn policies_bindings_destroy( - configuration: &configuration::Configuration, - policy_binding_uuid: &str, -) -> Result<(), Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_policy_binding_uuid = policy_binding_uuid; - - let uri_str = format!( - "{}/policies/bindings/{policy_binding_uuid}/", - configuration.base_path, - policy_binding_uuid = crate::apis::urlencode(p_path_policy_binding_uuid) - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::DELETE, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - - if !status.is_client_error() && !status.is_server_error() { - Ok(()) - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// PolicyBinding Viewset -pub async fn policies_bindings_list( - configuration: &configuration::Configuration, - enabled: Option, - order: Option, - ordering: Option<&str>, - page: Option, - page_size: Option, - policy: Option<&str>, - policy__isnull: Option, - search: Option<&str>, - target: Option<&str>, - target_in: Option>, - timeout: Option, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_query_enabled = enabled; - let p_query_order = order; - let p_query_ordering = ordering; - let p_query_page = page; - let p_query_page_size = page_size; - let p_query_policy = policy; - let p_query_policy__isnull = policy__isnull; - let p_query_search = search; - let p_query_target = target; - let p_query_target_in = target_in; - let p_query_timeout = timeout; - - let uri_str = format!("{}/policies/bindings/", configuration.base_path); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref param_value) = p_query_enabled { - req_builder = req_builder.query(&[("enabled", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_order { - req_builder = req_builder.query(&[("order", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_ordering { - req_builder = req_builder.query(&[("ordering", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_page { - req_builder = req_builder.query(&[("page", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_page_size { - req_builder = req_builder.query(&[("page_size", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_policy { - req_builder = req_builder.query(&[("policy", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_policy__isnull { - req_builder = req_builder.query(&[("policy__isnull", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_search { - req_builder = req_builder.query(&[("search", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_target { - req_builder = req_builder.query(&[("target", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_target_in { - req_builder = match "multi" { - "multi" => req_builder.query( - ¶m_value - .into_iter() - .map(|p| ("target_in".to_owned(), p.to_string())) - .collect::>(), - ), - _ => req_builder.query(&[( - "target_in", - ¶m_value - .into_iter() - .map(|p| p.to_string()) - .collect::>() - .join(",") - .to_string(), - )]), - }; - } - if let Some(ref param_value) = p_query_timeout { - req_builder = req_builder.query(&[("timeout", ¶m_value.to_string())]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::PaginatedPolicyBindingList`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::PaginatedPolicyBindingList`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// PolicyBinding Viewset -pub async fn policies_bindings_partial_update( - configuration: &configuration::Configuration, - policy_binding_uuid: &str, - patched_policy_binding_request: Option, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_policy_binding_uuid = policy_binding_uuid; - let p_body_patched_policy_binding_request = patched_policy_binding_request; - - let uri_str = format!( - "{}/policies/bindings/{policy_binding_uuid}/", - configuration.base_path, - policy_binding_uuid = crate::apis::urlencode(p_path_policy_binding_uuid) - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::PATCH, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - req_builder = req_builder.json(&p_body_patched_policy_binding_request); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::PolicyBinding`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::PolicyBinding`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// PolicyBinding Viewset -pub async fn policies_bindings_retrieve( - configuration: &configuration::Configuration, - policy_binding_uuid: &str, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_policy_binding_uuid = policy_binding_uuid; - - let uri_str = format!( - "{}/policies/bindings/{policy_binding_uuid}/", - configuration.base_path, - policy_binding_uuid = crate::apis::urlencode(p_path_policy_binding_uuid) - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::PolicyBinding`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::PolicyBinding`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// PolicyBinding Viewset -pub async fn policies_bindings_update( - configuration: &configuration::Configuration, - policy_binding_uuid: &str, - policy_binding_request: models::PolicyBindingRequest, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_policy_binding_uuid = policy_binding_uuid; - let p_body_policy_binding_request = policy_binding_request; - - let uri_str = format!( - "{}/policies/bindings/{policy_binding_uuid}/", - configuration.base_path, - policy_binding_uuid = crate::apis::urlencode(p_path_policy_binding_uuid) - ); - let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - req_builder = req_builder.json(&p_body_policy_binding_request); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::PolicyBinding`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::PolicyBinding`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Get a list of all objects that use this object -pub async fn policies_bindings_used_by_list( - configuration: &configuration::Configuration, - policy_binding_uuid: &str, -) -> Result, Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_policy_binding_uuid = policy_binding_uuid; - - let uri_str = format!( - "{}/policies/bindings/{policy_binding_uuid}/used_by/", - configuration.base_path, - policy_binding_uuid = crate::apis::urlencode(p_path_policy_binding_uuid) - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `Vec<models::UsedBy>`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `Vec<models::UsedBy>`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Dummy Viewset -pub async fn policies_dummy_create( - configuration: &configuration::Configuration, - dummy_policy_request: models::DummyPolicyRequest, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_body_dummy_policy_request = dummy_policy_request; - - let uri_str = format!("{}/policies/dummy/", configuration.base_path); - let mut req_builder = configuration - .client - .request(reqwest::Method::POST, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - req_builder = req_builder.json(&p_body_dummy_policy_request); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::DummyPolicy`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::DummyPolicy`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Dummy Viewset -pub async fn policies_dummy_destroy( - configuration: &configuration::Configuration, - policy_uuid: &str, -) -> Result<(), Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_policy_uuid = policy_uuid; - - let uri_str = format!( - "{}/policies/dummy/{policy_uuid}/", - configuration.base_path, - policy_uuid = crate::apis::urlencode(p_path_policy_uuid) - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::DELETE, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - - if !status.is_client_error() && !status.is_server_error() { - Ok(()) - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Dummy Viewset -pub async fn policies_dummy_list( - configuration: &configuration::Configuration, - created: Option, - execution_logging: Option, - last_updated: Option, - name: Option<&str>, - ordering: Option<&str>, - page: Option, - page_size: Option, - policy_uuid: Option<&str>, - result: Option, - search: Option<&str>, - wait_max: Option, - wait_min: Option, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_query_created = created; - let p_query_execution_logging = execution_logging; - let p_query_last_updated = last_updated; - let p_query_name = name; - let p_query_ordering = ordering; - let p_query_page = page; - let p_query_page_size = page_size; - let p_query_policy_uuid = policy_uuid; - let p_query_result = result; - let p_query_search = search; - let p_query_wait_max = wait_max; - let p_query_wait_min = wait_min; - - let uri_str = format!("{}/policies/dummy/", configuration.base_path); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref param_value) = p_query_created { - req_builder = req_builder.query(&[("created", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_execution_logging { - req_builder = req_builder.query(&[("execution_logging", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_last_updated { - req_builder = req_builder.query(&[("last_updated", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_name { - req_builder = req_builder.query(&[("name", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_ordering { - req_builder = req_builder.query(&[("ordering", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_page { - req_builder = req_builder.query(&[("page", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_page_size { - req_builder = req_builder.query(&[("page_size", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_policy_uuid { - req_builder = req_builder.query(&[("policy_uuid", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_result { - req_builder = req_builder.query(&[("result", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_search { - req_builder = req_builder.query(&[("search", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_wait_max { - req_builder = req_builder.query(&[("wait_max", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_wait_min { - req_builder = req_builder.query(&[("wait_min", ¶m_value.to_string())]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::PaginatedDummyPolicyList`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::PaginatedDummyPolicyList`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Dummy Viewset -pub async fn policies_dummy_partial_update( - configuration: &configuration::Configuration, - policy_uuid: &str, - patched_dummy_policy_request: Option, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_policy_uuid = policy_uuid; - let p_body_patched_dummy_policy_request = patched_dummy_policy_request; - - let uri_str = format!( - "{}/policies/dummy/{policy_uuid}/", - configuration.base_path, - policy_uuid = crate::apis::urlencode(p_path_policy_uuid) - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::PATCH, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - req_builder = req_builder.json(&p_body_patched_dummy_policy_request); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::DummyPolicy`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::DummyPolicy`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Dummy Viewset -pub async fn policies_dummy_retrieve( - configuration: &configuration::Configuration, - policy_uuid: &str, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_policy_uuid = policy_uuid; - - let uri_str = format!( - "{}/policies/dummy/{policy_uuid}/", - configuration.base_path, - policy_uuid = crate::apis::urlencode(p_path_policy_uuid) - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::DummyPolicy`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::DummyPolicy`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Dummy Viewset -pub async fn policies_dummy_update( - configuration: &configuration::Configuration, - policy_uuid: &str, - dummy_policy_request: models::DummyPolicyRequest, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_policy_uuid = policy_uuid; - let p_body_dummy_policy_request = dummy_policy_request; - - let uri_str = format!( - "{}/policies/dummy/{policy_uuid}/", - configuration.base_path, - policy_uuid = crate::apis::urlencode(p_path_policy_uuid) - ); - let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - req_builder = req_builder.json(&p_body_dummy_policy_request); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::DummyPolicy`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::DummyPolicy`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Get a list of all objects that use this object -pub async fn policies_dummy_used_by_list( - configuration: &configuration::Configuration, - policy_uuid: &str, -) -> Result, Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_policy_uuid = policy_uuid; - - let uri_str = format!( - "{}/policies/dummy/{policy_uuid}/used_by/", - configuration.base_path, - policy_uuid = crate::apis::urlencode(p_path_policy_uuid) - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `Vec<models::UsedBy>`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `Vec<models::UsedBy>`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Event Matcher Policy Viewset -pub async fn policies_event_matcher_create( - configuration: &configuration::Configuration, - event_matcher_policy_request: models::EventMatcherPolicyRequest, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_body_event_matcher_policy_request = event_matcher_policy_request; - - let uri_str = format!("{}/policies/event_matcher/", configuration.base_path); - let mut req_builder = configuration - .client - .request(reqwest::Method::POST, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - req_builder = req_builder.json(&p_body_event_matcher_policy_request); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::EventMatcherPolicy`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::EventMatcherPolicy`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Event Matcher Policy Viewset -pub async fn policies_event_matcher_destroy( - configuration: &configuration::Configuration, - policy_uuid: &str, -) -> Result<(), Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_policy_uuid = policy_uuid; - - let uri_str = format!( - "{}/policies/event_matcher/{policy_uuid}/", - configuration.base_path, - policy_uuid = crate::apis::urlencode(p_path_policy_uuid) - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::DELETE, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - - if !status.is_client_error() && !status.is_server_error() { - Ok(()) - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Event Matcher Policy Viewset -pub async fn policies_event_matcher_list( - configuration: &configuration::Configuration, - action: Option, - app: Option<&str>, - client_ip: Option<&str>, - created: Option, - execution_logging: Option, - last_updated: Option, - model: Option<&str>, - name: Option<&str>, - ordering: Option<&str>, - page: Option, - page_size: Option, - policy_uuid: Option<&str>, - search: Option<&str>, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_query_action = action; - let p_query_app = app; - let p_query_client_ip = client_ip; - let p_query_created = created; - let p_query_execution_logging = execution_logging; - let p_query_last_updated = last_updated; - let p_query_model = model; - let p_query_name = name; - let p_query_ordering = ordering; - let p_query_page = page; - let p_query_page_size = page_size; - let p_query_policy_uuid = policy_uuid; - let p_query_search = search; - - let uri_str = format!("{}/policies/event_matcher/", configuration.base_path); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref param_value) = p_query_action { - req_builder = req_builder.query(&[("action", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_app { - req_builder = req_builder.query(&[("app", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_client_ip { - req_builder = req_builder.query(&[("client_ip", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_created { - req_builder = req_builder.query(&[("created", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_execution_logging { - req_builder = req_builder.query(&[("execution_logging", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_last_updated { - req_builder = req_builder.query(&[("last_updated", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_model { - req_builder = req_builder.query(&[("model", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_name { - req_builder = req_builder.query(&[("name", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_ordering { - req_builder = req_builder.query(&[("ordering", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_page { - req_builder = req_builder.query(&[("page", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_page_size { - req_builder = req_builder.query(&[("page_size", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_policy_uuid { - req_builder = req_builder.query(&[("policy_uuid", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_search { - req_builder = req_builder.query(&[("search", ¶m_value.to_string())]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::PaginatedEventMatcherPolicyList`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::PaginatedEventMatcherPolicyList`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Event Matcher Policy Viewset -pub async fn policies_event_matcher_partial_update( - configuration: &configuration::Configuration, - policy_uuid: &str, - patched_event_matcher_policy_request: Option, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_policy_uuid = policy_uuid; - let p_body_patched_event_matcher_policy_request = patched_event_matcher_policy_request; - - let uri_str = format!( - "{}/policies/event_matcher/{policy_uuid}/", - configuration.base_path, - policy_uuid = crate::apis::urlencode(p_path_policy_uuid) - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::PATCH, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - req_builder = req_builder.json(&p_body_patched_event_matcher_policy_request); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::EventMatcherPolicy`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::EventMatcherPolicy`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Event Matcher Policy Viewset -pub async fn policies_event_matcher_retrieve( - configuration: &configuration::Configuration, - policy_uuid: &str, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_policy_uuid = policy_uuid; - - let uri_str = format!( - "{}/policies/event_matcher/{policy_uuid}/", - configuration.base_path, - policy_uuid = crate::apis::urlencode(p_path_policy_uuid) - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::EventMatcherPolicy`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::EventMatcherPolicy`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Event Matcher Policy Viewset -pub async fn policies_event_matcher_update( - configuration: &configuration::Configuration, - policy_uuid: &str, - event_matcher_policy_request: models::EventMatcherPolicyRequest, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_policy_uuid = policy_uuid; - let p_body_event_matcher_policy_request = event_matcher_policy_request; - - let uri_str = format!( - "{}/policies/event_matcher/{policy_uuid}/", - configuration.base_path, - policy_uuid = crate::apis::urlencode(p_path_policy_uuid) - ); - let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - req_builder = req_builder.json(&p_body_event_matcher_policy_request); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::EventMatcherPolicy`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::EventMatcherPolicy`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Get a list of all objects that use this object -pub async fn policies_event_matcher_used_by_list( - configuration: &configuration::Configuration, - policy_uuid: &str, -) -> Result, Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_policy_uuid = policy_uuid; - - let uri_str = format!( - "{}/policies/event_matcher/{policy_uuid}/used_by/", - configuration.base_path, - policy_uuid = crate::apis::urlencode(p_path_policy_uuid) - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `Vec<models::UsedBy>`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `Vec<models::UsedBy>`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Source Viewset -pub async fn policies_expression_create( - configuration: &configuration::Configuration, - expression_policy_request: models::ExpressionPolicyRequest, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_body_expression_policy_request = expression_policy_request; - - let uri_str = format!("{}/policies/expression/", configuration.base_path); - let mut req_builder = configuration - .client - .request(reqwest::Method::POST, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - req_builder = req_builder.json(&p_body_expression_policy_request); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::ExpressionPolicy`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::ExpressionPolicy`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Source Viewset -pub async fn policies_expression_destroy( - configuration: &configuration::Configuration, - policy_uuid: &str, -) -> Result<(), Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_policy_uuid = policy_uuid; - - let uri_str = format!( - "{}/policies/expression/{policy_uuid}/", - configuration.base_path, - policy_uuid = crate::apis::urlencode(p_path_policy_uuid) - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::DELETE, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - - if !status.is_client_error() && !status.is_server_error() { - Ok(()) - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Source Viewset -pub async fn policies_expression_list( - configuration: &configuration::Configuration, - created: Option, - execution_logging: Option, - expression: Option<&str>, - last_updated: Option, - name: Option<&str>, - ordering: Option<&str>, - page: Option, - page_size: Option, - policy_uuid: Option<&str>, - search: Option<&str>, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_query_created = created; - let p_query_execution_logging = execution_logging; - let p_query_expression = expression; - let p_query_last_updated = last_updated; - let p_query_name = name; - let p_query_ordering = ordering; - let p_query_page = page; - let p_query_page_size = page_size; - let p_query_policy_uuid = policy_uuid; - let p_query_search = search; - - let uri_str = format!("{}/policies/expression/", configuration.base_path); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref param_value) = p_query_created { - req_builder = req_builder.query(&[("created", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_execution_logging { - req_builder = req_builder.query(&[("execution_logging", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_expression { - req_builder = req_builder.query(&[("expression", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_last_updated { - req_builder = req_builder.query(&[("last_updated", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_name { - req_builder = req_builder.query(&[("name", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_ordering { - req_builder = req_builder.query(&[("ordering", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_page { - req_builder = req_builder.query(&[("page", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_page_size { - req_builder = req_builder.query(&[("page_size", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_policy_uuid { - req_builder = req_builder.query(&[("policy_uuid", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_search { - req_builder = req_builder.query(&[("search", ¶m_value.to_string())]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::PaginatedExpressionPolicyList`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::PaginatedExpressionPolicyList`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Source Viewset -pub async fn policies_expression_partial_update( - configuration: &configuration::Configuration, - policy_uuid: &str, - patched_expression_policy_request: Option, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_policy_uuid = policy_uuid; - let p_body_patched_expression_policy_request = patched_expression_policy_request; - - let uri_str = format!( - "{}/policies/expression/{policy_uuid}/", - configuration.base_path, - policy_uuid = crate::apis::urlencode(p_path_policy_uuid) - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::PATCH, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - req_builder = req_builder.json(&p_body_patched_expression_policy_request); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::ExpressionPolicy`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::ExpressionPolicy`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Source Viewset -pub async fn policies_expression_retrieve( - configuration: &configuration::Configuration, - policy_uuid: &str, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_policy_uuid = policy_uuid; - - let uri_str = format!( - "{}/policies/expression/{policy_uuid}/", - configuration.base_path, - policy_uuid = crate::apis::urlencode(p_path_policy_uuid) - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::ExpressionPolicy`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::ExpressionPolicy`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Source Viewset -pub async fn policies_expression_update( - configuration: &configuration::Configuration, - policy_uuid: &str, - expression_policy_request: models::ExpressionPolicyRequest, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_policy_uuid = policy_uuid; - let p_body_expression_policy_request = expression_policy_request; - - let uri_str = format!( - "{}/policies/expression/{policy_uuid}/", - configuration.base_path, - policy_uuid = crate::apis::urlencode(p_path_policy_uuid) - ); - let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - req_builder = req_builder.json(&p_body_expression_policy_request); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::ExpressionPolicy`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::ExpressionPolicy`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Get a list of all objects that use this object -pub async fn policies_expression_used_by_list( - configuration: &configuration::Configuration, - policy_uuid: &str, -) -> Result, Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_policy_uuid = policy_uuid; - - let uri_str = format!( - "{}/policies/expression/{policy_uuid}/used_by/", - configuration.base_path, - policy_uuid = crate::apis::urlencode(p_path_policy_uuid) - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `Vec<models::UsedBy>`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `Vec<models::UsedBy>`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// GeoIP Viewset -pub async fn policies_geoip_create( - configuration: &configuration::Configuration, - geo_ip_policy_request: models::GeoIpPolicyRequest, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_body_geo_ip_policy_request = geo_ip_policy_request; - - let uri_str = format!("{}/policies/geoip/", configuration.base_path); - let mut req_builder = configuration - .client - .request(reqwest::Method::POST, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - req_builder = req_builder.json(&p_body_geo_ip_policy_request); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::GeoIpPolicy`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::GeoIpPolicy`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// GeoIP Viewset -pub async fn policies_geoip_destroy( - configuration: &configuration::Configuration, - policy_uuid: &str, -) -> Result<(), Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_policy_uuid = policy_uuid; - - let uri_str = format!( - "{}/policies/geoip/{policy_uuid}/", - configuration.base_path, - policy_uuid = crate::apis::urlencode(p_path_policy_uuid) - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::DELETE, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - - if !status.is_client_error() && !status.is_server_error() { - Ok(()) - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Get all countries in ISO-3166-1 -pub async fn policies_geoip_iso3166_list( - configuration: &configuration::Configuration, -) -> Result, Error> { - let uri_str = format!("{}/policies/geoip_iso3166/", configuration.base_path); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `Vec<models::DetailedCountry>`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `Vec<models::DetailedCountry>`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// GeoIP Viewset -pub async fn policies_geoip_list( - configuration: &configuration::Configuration, - name: Option<&str>, - ordering: Option<&str>, - page: Option, - page_size: Option, - search: Option<&str>, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_query_name = name; - let p_query_ordering = ordering; - let p_query_page = page; - let p_query_page_size = page_size; - let p_query_search = search; - - let uri_str = format!("{}/policies/geoip/", configuration.base_path); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref param_value) = p_query_name { - req_builder = req_builder.query(&[("name", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_ordering { - req_builder = req_builder.query(&[("ordering", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_page { - req_builder = req_builder.query(&[("page", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_page_size { - req_builder = req_builder.query(&[("page_size", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_search { - req_builder = req_builder.query(&[("search", ¶m_value.to_string())]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::PaginatedGeoIpPolicyList`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::PaginatedGeoIpPolicyList`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// GeoIP Viewset -pub async fn policies_geoip_partial_update( - configuration: &configuration::Configuration, - policy_uuid: &str, - patched_geo_ip_policy_request: Option, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_policy_uuid = policy_uuid; - let p_body_patched_geo_ip_policy_request = patched_geo_ip_policy_request; - - let uri_str = format!( - "{}/policies/geoip/{policy_uuid}/", - configuration.base_path, - policy_uuid = crate::apis::urlencode(p_path_policy_uuid) - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::PATCH, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - req_builder = req_builder.json(&p_body_patched_geo_ip_policy_request); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::GeoIpPolicy`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::GeoIpPolicy`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// GeoIP Viewset -pub async fn policies_geoip_retrieve( - configuration: &configuration::Configuration, - policy_uuid: &str, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_policy_uuid = policy_uuid; - - let uri_str = format!( - "{}/policies/geoip/{policy_uuid}/", - configuration.base_path, - policy_uuid = crate::apis::urlencode(p_path_policy_uuid) - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::GeoIpPolicy`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::GeoIpPolicy`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// GeoIP Viewset -pub async fn policies_geoip_update( - configuration: &configuration::Configuration, - policy_uuid: &str, - geo_ip_policy_request: models::GeoIpPolicyRequest, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_policy_uuid = policy_uuid; - let p_body_geo_ip_policy_request = geo_ip_policy_request; - - let uri_str = format!( - "{}/policies/geoip/{policy_uuid}/", - configuration.base_path, - policy_uuid = crate::apis::urlencode(p_path_policy_uuid) - ); - let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - req_builder = req_builder.json(&p_body_geo_ip_policy_request); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::GeoIpPolicy`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::GeoIpPolicy`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Get a list of all objects that use this object -pub async fn policies_geoip_used_by_list( - configuration: &configuration::Configuration, - policy_uuid: &str, -) -> Result, Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_policy_uuid = policy_uuid; - - let uri_str = format!( - "{}/policies/geoip/{policy_uuid}/used_by/", - configuration.base_path, - policy_uuid = crate::apis::urlencode(p_path_policy_uuid) - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `Vec<models::UsedBy>`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `Vec<models::UsedBy>`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Password Policy Viewset -pub async fn policies_password_create( - configuration: &configuration::Configuration, - password_policy_request: models::PasswordPolicyRequest, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_body_password_policy_request = password_policy_request; - - let uri_str = format!("{}/policies/password/", configuration.base_path); - let mut req_builder = configuration - .client - .request(reqwest::Method::POST, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - req_builder = req_builder.json(&p_body_password_policy_request); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::PasswordPolicy`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::PasswordPolicy`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Password Policy Viewset -pub async fn policies_password_destroy( - configuration: &configuration::Configuration, - policy_uuid: &str, -) -> Result<(), Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_policy_uuid = policy_uuid; - - let uri_str = format!( - "{}/policies/password/{policy_uuid}/", - configuration.base_path, - policy_uuid = crate::apis::urlencode(p_path_policy_uuid) - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::DELETE, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - - if !status.is_client_error() && !status.is_server_error() { - Ok(()) - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Password Expiry Viewset -pub async fn policies_password_expiry_create( - configuration: &configuration::Configuration, - password_expiry_policy_request: models::PasswordExpiryPolicyRequest, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_body_password_expiry_policy_request = password_expiry_policy_request; - - let uri_str = format!("{}/policies/password_expiry/", configuration.base_path); - let mut req_builder = configuration - .client - .request(reqwest::Method::POST, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - req_builder = req_builder.json(&p_body_password_expiry_policy_request); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::PasswordExpiryPolicy`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::PasswordExpiryPolicy`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Password Expiry Viewset -pub async fn policies_password_expiry_destroy( - configuration: &configuration::Configuration, - policy_uuid: &str, -) -> Result<(), Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_policy_uuid = policy_uuid; - - let uri_str = format!( - "{}/policies/password_expiry/{policy_uuid}/", - configuration.base_path, - policy_uuid = crate::apis::urlencode(p_path_policy_uuid) - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::DELETE, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - - if !status.is_client_error() && !status.is_server_error() { - Ok(()) - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Password Expiry Viewset -pub async fn policies_password_expiry_list( - configuration: &configuration::Configuration, - created: Option, - days: Option, - deny_only: Option, - execution_logging: Option, - last_updated: Option, - name: Option<&str>, - ordering: Option<&str>, - page: Option, - page_size: Option, - policy_uuid: Option<&str>, - search: Option<&str>, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_query_created = created; - let p_query_days = days; - let p_query_deny_only = deny_only; - let p_query_execution_logging = execution_logging; - let p_query_last_updated = last_updated; - let p_query_name = name; - let p_query_ordering = ordering; - let p_query_page = page; - let p_query_page_size = page_size; - let p_query_policy_uuid = policy_uuid; - let p_query_search = search; - - let uri_str = format!("{}/policies/password_expiry/", configuration.base_path); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref param_value) = p_query_created { - req_builder = req_builder.query(&[("created", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_days { - req_builder = req_builder.query(&[("days", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_deny_only { - req_builder = req_builder.query(&[("deny_only", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_execution_logging { - req_builder = req_builder.query(&[("execution_logging", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_last_updated { - req_builder = req_builder.query(&[("last_updated", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_name { - req_builder = req_builder.query(&[("name", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_ordering { - req_builder = req_builder.query(&[("ordering", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_page { - req_builder = req_builder.query(&[("page", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_page_size { - req_builder = req_builder.query(&[("page_size", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_policy_uuid { - req_builder = req_builder.query(&[("policy_uuid", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_search { - req_builder = req_builder.query(&[("search", ¶m_value.to_string())]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::PaginatedPasswordExpiryPolicyList`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::PaginatedPasswordExpiryPolicyList`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Password Expiry Viewset -pub async fn policies_password_expiry_partial_update( - configuration: &configuration::Configuration, - policy_uuid: &str, - patched_password_expiry_policy_request: Option, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_policy_uuid = policy_uuid; - let p_body_patched_password_expiry_policy_request = patched_password_expiry_policy_request; - - let uri_str = format!( - "{}/policies/password_expiry/{policy_uuid}/", - configuration.base_path, - policy_uuid = crate::apis::urlencode(p_path_policy_uuid) - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::PATCH, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - req_builder = req_builder.json(&p_body_patched_password_expiry_policy_request); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::PasswordExpiryPolicy`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::PasswordExpiryPolicy`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Password Expiry Viewset -pub async fn policies_password_expiry_retrieve( - configuration: &configuration::Configuration, - policy_uuid: &str, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_policy_uuid = policy_uuid; - - let uri_str = format!( - "{}/policies/password_expiry/{policy_uuid}/", - configuration.base_path, - policy_uuid = crate::apis::urlencode(p_path_policy_uuid) - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::PasswordExpiryPolicy`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::PasswordExpiryPolicy`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Password Expiry Viewset -pub async fn policies_password_expiry_update( - configuration: &configuration::Configuration, - policy_uuid: &str, - password_expiry_policy_request: models::PasswordExpiryPolicyRequest, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_policy_uuid = policy_uuid; - let p_body_password_expiry_policy_request = password_expiry_policy_request; - - let uri_str = format!( - "{}/policies/password_expiry/{policy_uuid}/", - configuration.base_path, - policy_uuid = crate::apis::urlencode(p_path_policy_uuid) - ); - let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - req_builder = req_builder.json(&p_body_password_expiry_policy_request); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::PasswordExpiryPolicy`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::PasswordExpiryPolicy`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Get a list of all objects that use this object -pub async fn policies_password_expiry_used_by_list( - configuration: &configuration::Configuration, - policy_uuid: &str, -) -> Result, Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_policy_uuid = policy_uuid; - - let uri_str = format!( - "{}/policies/password_expiry/{policy_uuid}/used_by/", - configuration.base_path, - policy_uuid = crate::apis::urlencode(p_path_policy_uuid) - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `Vec<models::UsedBy>`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `Vec<models::UsedBy>`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Password Policy Viewset -pub async fn policies_password_list( - configuration: &configuration::Configuration, - amount_digits: Option, - amount_lowercase: Option, - amount_symbols: Option, - amount_uppercase: Option, - check_have_i_been_pwned: Option, - check_static_rules: Option, - check_zxcvbn: Option, - created: Option, - error_message: Option<&str>, - execution_logging: Option, - hibp_allowed_count: Option, - last_updated: Option, - length_min: Option, - name: Option<&str>, - ordering: Option<&str>, - page: Option, - page_size: Option, - password_field: Option<&str>, - policy_uuid: Option<&str>, - search: Option<&str>, - symbol_charset: Option<&str>, - zxcvbn_score_threshold: Option, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_query_amount_digits = amount_digits; - let p_query_amount_lowercase = amount_lowercase; - let p_query_amount_symbols = amount_symbols; - let p_query_amount_uppercase = amount_uppercase; - let p_query_check_have_i_been_pwned = check_have_i_been_pwned; - let p_query_check_static_rules = check_static_rules; - let p_query_check_zxcvbn = check_zxcvbn; - let p_query_created = created; - let p_query_error_message = error_message; - let p_query_execution_logging = execution_logging; - let p_query_hibp_allowed_count = hibp_allowed_count; - let p_query_last_updated = last_updated; - let p_query_length_min = length_min; - let p_query_name = name; - let p_query_ordering = ordering; - let p_query_page = page; - let p_query_page_size = page_size; - let p_query_password_field = password_field; - let p_query_policy_uuid = policy_uuid; - let p_query_search = search; - let p_query_symbol_charset = symbol_charset; - let p_query_zxcvbn_score_threshold = zxcvbn_score_threshold; - - let uri_str = format!("{}/policies/password/", configuration.base_path); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref param_value) = p_query_amount_digits { - req_builder = req_builder.query(&[("amount_digits", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_amount_lowercase { - req_builder = req_builder.query(&[("amount_lowercase", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_amount_symbols { - req_builder = req_builder.query(&[("amount_symbols", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_amount_uppercase { - req_builder = req_builder.query(&[("amount_uppercase", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_check_have_i_been_pwned { - req_builder = req_builder.query(&[("check_have_i_been_pwned", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_check_static_rules { - req_builder = req_builder.query(&[("check_static_rules", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_check_zxcvbn { - req_builder = req_builder.query(&[("check_zxcvbn", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_created { - req_builder = req_builder.query(&[("created", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_error_message { - req_builder = req_builder.query(&[("error_message", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_execution_logging { - req_builder = req_builder.query(&[("execution_logging", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_hibp_allowed_count { - req_builder = req_builder.query(&[("hibp_allowed_count", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_last_updated { - req_builder = req_builder.query(&[("last_updated", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_length_min { - req_builder = req_builder.query(&[("length_min", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_name { - req_builder = req_builder.query(&[("name", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_ordering { - req_builder = req_builder.query(&[("ordering", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_page { - req_builder = req_builder.query(&[("page", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_page_size { - req_builder = req_builder.query(&[("page_size", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_password_field { - req_builder = req_builder.query(&[("password_field", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_policy_uuid { - req_builder = req_builder.query(&[("policy_uuid", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_search { - req_builder = req_builder.query(&[("search", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_symbol_charset { - req_builder = req_builder.query(&[("symbol_charset", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_zxcvbn_score_threshold { - req_builder = req_builder.query(&[("zxcvbn_score_threshold", ¶m_value.to_string())]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::PaginatedPasswordPolicyList`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::PaginatedPasswordPolicyList`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Password Policy Viewset -pub async fn policies_password_partial_update( - configuration: &configuration::Configuration, - policy_uuid: &str, - patched_password_policy_request: Option, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_policy_uuid = policy_uuid; - let p_body_patched_password_policy_request = patched_password_policy_request; - - let uri_str = format!( - "{}/policies/password/{policy_uuid}/", - configuration.base_path, - policy_uuid = crate::apis::urlencode(p_path_policy_uuid) - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::PATCH, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - req_builder = req_builder.json(&p_body_patched_password_policy_request); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::PasswordPolicy`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::PasswordPolicy`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Password Policy Viewset -pub async fn policies_password_retrieve( - configuration: &configuration::Configuration, - policy_uuid: &str, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_policy_uuid = policy_uuid; - - let uri_str = format!( - "{}/policies/password/{policy_uuid}/", - configuration.base_path, - policy_uuid = crate::apis::urlencode(p_path_policy_uuid) - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::PasswordPolicy`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::PasswordPolicy`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Password Policy Viewset -pub async fn policies_password_update( - configuration: &configuration::Configuration, - policy_uuid: &str, - password_policy_request: models::PasswordPolicyRequest, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_policy_uuid = policy_uuid; - let p_body_password_policy_request = password_policy_request; - - let uri_str = format!( - "{}/policies/password/{policy_uuid}/", - configuration.base_path, - policy_uuid = crate::apis::urlencode(p_path_policy_uuid) - ); - let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - req_builder = req_builder.json(&p_body_password_policy_request); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::PasswordPolicy`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::PasswordPolicy`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Get a list of all objects that use this object -pub async fn policies_password_used_by_list( - configuration: &configuration::Configuration, - policy_uuid: &str, -) -> Result, Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_policy_uuid = policy_uuid; - - let uri_str = format!( - "{}/policies/password/{policy_uuid}/used_by/", - configuration.base_path, - policy_uuid = crate::apis::urlencode(p_path_policy_uuid) - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `Vec<models::UsedBy>`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `Vec<models::UsedBy>`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Reputation Policy Viewset -pub async fn policies_reputation_create( - configuration: &configuration::Configuration, - reputation_policy_request: models::ReputationPolicyRequest, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_body_reputation_policy_request = reputation_policy_request; - - let uri_str = format!("{}/policies/reputation/", configuration.base_path); - let mut req_builder = configuration - .client - .request(reqwest::Method::POST, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - req_builder = req_builder.json(&p_body_reputation_policy_request); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::ReputationPolicy`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::ReputationPolicy`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Reputation Policy Viewset -pub async fn policies_reputation_destroy( - configuration: &configuration::Configuration, - policy_uuid: &str, -) -> Result<(), Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_policy_uuid = policy_uuid; - - let uri_str = format!( - "{}/policies/reputation/{policy_uuid}/", - configuration.base_path, - policy_uuid = crate::apis::urlencode(p_path_policy_uuid) - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::DELETE, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - - if !status.is_client_error() && !status.is_server_error() { - Ok(()) - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Reputation Policy Viewset -pub async fn policies_reputation_list( - configuration: &configuration::Configuration, - check_ip: Option, - check_username: Option, - created: Option, - execution_logging: Option, - last_updated: Option, - name: Option<&str>, - ordering: Option<&str>, - page: Option, - page_size: Option, - policy_uuid: Option<&str>, - search: Option<&str>, - threshold: Option, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_query_check_ip = check_ip; - let p_query_check_username = check_username; - let p_query_created = created; - let p_query_execution_logging = execution_logging; - let p_query_last_updated = last_updated; - let p_query_name = name; - let p_query_ordering = ordering; - let p_query_page = page; - let p_query_page_size = page_size; - let p_query_policy_uuid = policy_uuid; - let p_query_search = search; - let p_query_threshold = threshold; - - let uri_str = format!("{}/policies/reputation/", configuration.base_path); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref param_value) = p_query_check_ip { - req_builder = req_builder.query(&[("check_ip", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_check_username { - req_builder = req_builder.query(&[("check_username", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_created { - req_builder = req_builder.query(&[("created", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_execution_logging { - req_builder = req_builder.query(&[("execution_logging", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_last_updated { - req_builder = req_builder.query(&[("last_updated", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_name { - req_builder = req_builder.query(&[("name", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_ordering { - req_builder = req_builder.query(&[("ordering", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_page { - req_builder = req_builder.query(&[("page", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_page_size { - req_builder = req_builder.query(&[("page_size", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_policy_uuid { - req_builder = req_builder.query(&[("policy_uuid", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_search { - req_builder = req_builder.query(&[("search", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_threshold { - req_builder = req_builder.query(&[("threshold", ¶m_value.to_string())]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::PaginatedReputationPolicyList`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::PaginatedReputationPolicyList`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Reputation Policy Viewset -pub async fn policies_reputation_partial_update( - configuration: &configuration::Configuration, - policy_uuid: &str, - patched_reputation_policy_request: Option, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_policy_uuid = policy_uuid; - let p_body_patched_reputation_policy_request = patched_reputation_policy_request; - - let uri_str = format!( - "{}/policies/reputation/{policy_uuid}/", - configuration.base_path, - policy_uuid = crate::apis::urlencode(p_path_policy_uuid) - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::PATCH, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - req_builder = req_builder.json(&p_body_patched_reputation_policy_request); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::ReputationPolicy`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::ReputationPolicy`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Reputation Policy Viewset -pub async fn policies_reputation_retrieve( - configuration: &configuration::Configuration, - policy_uuid: &str, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_policy_uuid = policy_uuid; - - let uri_str = format!( - "{}/policies/reputation/{policy_uuid}/", - configuration.base_path, - policy_uuid = crate::apis::urlencode(p_path_policy_uuid) - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::ReputationPolicy`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::ReputationPolicy`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Reputation Viewset -pub async fn policies_reputation_scores_destroy( - configuration: &configuration::Configuration, - reputation_uuid: &str, -) -> Result<(), Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_reputation_uuid = reputation_uuid; - - let uri_str = format!( - "{}/policies/reputation/scores/{reputation_uuid}/", - configuration.base_path, - reputation_uuid = crate::apis::urlencode(p_path_reputation_uuid) - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::DELETE, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - - if !status.is_client_error() && !status.is_server_error() { - Ok(()) - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Reputation Viewset -pub async fn policies_reputation_scores_list( - configuration: &configuration::Configuration, - identifier: Option<&str>, - identifier_in: Option>, - ip: Option<&str>, - ordering: Option<&str>, - page: Option, - page_size: Option, - score: Option, - search: Option<&str>, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_query_identifier = identifier; - let p_query_identifier_in = identifier_in; - let p_query_ip = ip; - let p_query_ordering = ordering; - let p_query_page = page; - let p_query_page_size = page_size; - let p_query_score = score; - let p_query_search = search; - - let uri_str = format!("{}/policies/reputation/scores/", configuration.base_path); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref param_value) = p_query_identifier { - req_builder = req_builder.query(&[("identifier", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_identifier_in { - req_builder = match "csv" { - "multi" => req_builder.query( - ¶m_value - .into_iter() - .map(|p| ("identifier_in".to_owned(), p.to_string())) - .collect::>(), - ), - _ => req_builder.query(&[( - "identifier_in", - ¶m_value - .into_iter() - .map(|p| p.to_string()) - .collect::>() - .join(",") - .to_string(), - )]), - }; - } - if let Some(ref param_value) = p_query_ip { - req_builder = req_builder.query(&[("ip", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_ordering { - req_builder = req_builder.query(&[("ordering", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_page { - req_builder = req_builder.query(&[("page", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_page_size { - req_builder = req_builder.query(&[("page_size", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_score { - req_builder = req_builder.query(&[("score", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_search { - req_builder = req_builder.query(&[("search", ¶m_value.to_string())]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::PaginatedReputationList`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::PaginatedReputationList`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Reputation Viewset -pub async fn policies_reputation_scores_retrieve( - configuration: &configuration::Configuration, - reputation_uuid: &str, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_reputation_uuid = reputation_uuid; - - let uri_str = format!( - "{}/policies/reputation/scores/{reputation_uuid}/", - configuration.base_path, - reputation_uuid = crate::apis::urlencode(p_path_reputation_uuid) - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::Reputation`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::Reputation`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Get a list of all objects that use this object -pub async fn policies_reputation_scores_used_by_list( - configuration: &configuration::Configuration, - reputation_uuid: &str, -) -> Result, Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_reputation_uuid = reputation_uuid; - - let uri_str = format!( - "{}/policies/reputation/scores/{reputation_uuid}/used_by/", - configuration.base_path, - reputation_uuid = crate::apis::urlencode(p_path_reputation_uuid) - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `Vec<models::UsedBy>`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `Vec<models::UsedBy>`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Reputation Policy Viewset -pub async fn policies_reputation_update( - configuration: &configuration::Configuration, - policy_uuid: &str, - reputation_policy_request: models::ReputationPolicyRequest, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_policy_uuid = policy_uuid; - let p_body_reputation_policy_request = reputation_policy_request; - - let uri_str = format!( - "{}/policies/reputation/{policy_uuid}/", - configuration.base_path, - policy_uuid = crate::apis::urlencode(p_path_policy_uuid) - ); - let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - req_builder = req_builder.json(&p_body_reputation_policy_request); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::ReputationPolicy`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::ReputationPolicy`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Get a list of all objects that use this object -pub async fn policies_reputation_used_by_list( - configuration: &configuration::Configuration, - policy_uuid: &str, -) -> Result, Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_policy_uuid = policy_uuid; - - let uri_str = format!( - "{}/policies/reputation/{policy_uuid}/used_by/", - configuration.base_path, - policy_uuid = crate::apis::urlencode(p_path_policy_uuid) - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `Vec<models::UsedBy>`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `Vec<models::UsedBy>`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Password Uniqueness Policy Viewset -pub async fn policies_unique_password_create( - configuration: &configuration::Configuration, - unique_password_policy_request: models::UniquePasswordPolicyRequest, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_body_unique_password_policy_request = unique_password_policy_request; - - let uri_str = format!("{}/policies/unique_password/", configuration.base_path); - let mut req_builder = configuration - .client - .request(reqwest::Method::POST, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - req_builder = req_builder.json(&p_body_unique_password_policy_request); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::UniquePasswordPolicy`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::UniquePasswordPolicy`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Password Uniqueness Policy Viewset -pub async fn policies_unique_password_destroy( - configuration: &configuration::Configuration, - policy_uuid: &str, -) -> Result<(), Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_policy_uuid = policy_uuid; - - let uri_str = format!( - "{}/policies/unique_password/{policy_uuid}/", - configuration.base_path, - policy_uuid = crate::apis::urlencode(p_path_policy_uuid) - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::DELETE, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - - if !status.is_client_error() && !status.is_server_error() { - Ok(()) - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Password Uniqueness Policy Viewset -pub async fn policies_unique_password_list( - configuration: &configuration::Configuration, - created: Option, - execution_logging: Option, - last_updated: Option, - name: Option<&str>, - num_historical_passwords: Option, - ordering: Option<&str>, - page: Option, - page_size: Option, - password_field: Option<&str>, - policy_uuid: Option<&str>, - search: Option<&str>, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_query_created = created; - let p_query_execution_logging = execution_logging; - let p_query_last_updated = last_updated; - let p_query_name = name; - let p_query_num_historical_passwords = num_historical_passwords; - let p_query_ordering = ordering; - let p_query_page = page; - let p_query_page_size = page_size; - let p_query_password_field = password_field; - let p_query_policy_uuid = policy_uuid; - let p_query_search = search; - - let uri_str = format!("{}/policies/unique_password/", configuration.base_path); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref param_value) = p_query_created { - req_builder = req_builder.query(&[("created", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_execution_logging { - req_builder = req_builder.query(&[("execution_logging", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_last_updated { - req_builder = req_builder.query(&[("last_updated", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_name { - req_builder = req_builder.query(&[("name", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_num_historical_passwords { - req_builder = req_builder.query(&[("num_historical_passwords", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_ordering { - req_builder = req_builder.query(&[("ordering", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_page { - req_builder = req_builder.query(&[("page", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_page_size { - req_builder = req_builder.query(&[("page_size", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_password_field { - req_builder = req_builder.query(&[("password_field", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_policy_uuid { - req_builder = req_builder.query(&[("policy_uuid", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_search { - req_builder = req_builder.query(&[("search", ¶m_value.to_string())]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::PaginatedUniquePasswordPolicyList`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::PaginatedUniquePasswordPolicyList`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Password Uniqueness Policy Viewset -pub async fn policies_unique_password_partial_update( - configuration: &configuration::Configuration, - policy_uuid: &str, - patched_unique_password_policy_request: Option, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_policy_uuid = policy_uuid; - let p_body_patched_unique_password_policy_request = patched_unique_password_policy_request; - - let uri_str = format!( - "{}/policies/unique_password/{policy_uuid}/", - configuration.base_path, - policy_uuid = crate::apis::urlencode(p_path_policy_uuid) - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::PATCH, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - req_builder = req_builder.json(&p_body_patched_unique_password_policy_request); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::UniquePasswordPolicy`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::UniquePasswordPolicy`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Password Uniqueness Policy Viewset -pub async fn policies_unique_password_retrieve( - configuration: &configuration::Configuration, - policy_uuid: &str, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_policy_uuid = policy_uuid; - - let uri_str = format!( - "{}/policies/unique_password/{policy_uuid}/", - configuration.base_path, - policy_uuid = crate::apis::urlencode(p_path_policy_uuid) - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::UniquePasswordPolicy`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::UniquePasswordPolicy`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Password Uniqueness Policy Viewset -pub async fn policies_unique_password_update( - configuration: &configuration::Configuration, - policy_uuid: &str, - unique_password_policy_request: models::UniquePasswordPolicyRequest, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_policy_uuid = policy_uuid; - let p_body_unique_password_policy_request = unique_password_policy_request; - - let uri_str = format!( - "{}/policies/unique_password/{policy_uuid}/", - configuration.base_path, - policy_uuid = crate::apis::urlencode(p_path_policy_uuid) - ); - let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - req_builder = req_builder.json(&p_body_unique_password_policy_request); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::UniquePasswordPolicy`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::UniquePasswordPolicy`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Get a list of all objects that use this object -pub async fn policies_unique_password_used_by_list( - configuration: &configuration::Configuration, - policy_uuid: &str, -) -> Result, Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_policy_uuid = policy_uuid; - - let uri_str = format!( - "{}/policies/unique_password/{policy_uuid}/used_by/", - configuration.base_path, - policy_uuid = crate::apis::urlencode(p_path_policy_uuid) - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `Vec<models::UsedBy>`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `Vec<models::UsedBy>`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} diff --git a/packages/client-rust/src/apis/propertymappings_api.rs b/packages/client-rust/src/apis/propertymappings_api.rs deleted file mode 100644 index 45ccae3f18..0000000000 --- a/packages/client-rust/src/apis/propertymappings_api.rs +++ /dev/null @@ -1,8572 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use reqwest; -use serde::{Deserialize, Serialize, de::Error as _}; - -use super::{ContentType, Error, configuration}; -use crate::{apis::ResponseContent, models}; - -/// struct for typed errors of method [`propertymappings_all_destroy`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum PropertymappingsAllDestroyError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`propertymappings_all_list`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum PropertymappingsAllListError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`propertymappings_all_retrieve`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum PropertymappingsAllRetrieveError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`propertymappings_all_test_create`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum PropertymappingsAllTestCreateError { - Status400(), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`propertymappings_all_types_list`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum PropertymappingsAllTypesListError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`propertymappings_all_used_by_list`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum PropertymappingsAllUsedByListError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`propertymappings_notification_create`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum PropertymappingsNotificationCreateError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`propertymappings_notification_destroy`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum PropertymappingsNotificationDestroyError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`propertymappings_notification_list`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum PropertymappingsNotificationListError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`propertymappings_notification_partial_update`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum PropertymappingsNotificationPartialUpdateError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`propertymappings_notification_retrieve`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum PropertymappingsNotificationRetrieveError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`propertymappings_notification_update`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum PropertymappingsNotificationUpdateError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`propertymappings_notification_used_by_list`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum PropertymappingsNotificationUsedByListError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`propertymappings_provider_google_workspace_create`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum PropertymappingsProviderGoogleWorkspaceCreateError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`propertymappings_provider_google_workspace_destroy`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum PropertymappingsProviderGoogleWorkspaceDestroyError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`propertymappings_provider_google_workspace_list`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum PropertymappingsProviderGoogleWorkspaceListError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`propertymappings_provider_google_workspace_partial_update`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum PropertymappingsProviderGoogleWorkspacePartialUpdateError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`propertymappings_provider_google_workspace_retrieve`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum PropertymappingsProviderGoogleWorkspaceRetrieveError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`propertymappings_provider_google_workspace_update`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum PropertymappingsProviderGoogleWorkspaceUpdateError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`propertymappings_provider_google_workspace_used_by_list`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum PropertymappingsProviderGoogleWorkspaceUsedByListError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`propertymappings_provider_microsoft_entra_create`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum PropertymappingsProviderMicrosoftEntraCreateError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`propertymappings_provider_microsoft_entra_destroy`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum PropertymappingsProviderMicrosoftEntraDestroyError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`propertymappings_provider_microsoft_entra_list`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum PropertymappingsProviderMicrosoftEntraListError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`propertymappings_provider_microsoft_entra_partial_update`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum PropertymappingsProviderMicrosoftEntraPartialUpdateError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`propertymappings_provider_microsoft_entra_retrieve`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum PropertymappingsProviderMicrosoftEntraRetrieveError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`propertymappings_provider_microsoft_entra_update`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum PropertymappingsProviderMicrosoftEntraUpdateError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`propertymappings_provider_microsoft_entra_used_by_list`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum PropertymappingsProviderMicrosoftEntraUsedByListError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`propertymappings_provider_rac_create`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum PropertymappingsProviderRacCreateError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`propertymappings_provider_rac_destroy`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum PropertymappingsProviderRacDestroyError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`propertymappings_provider_rac_list`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum PropertymappingsProviderRacListError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`propertymappings_provider_rac_partial_update`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum PropertymappingsProviderRacPartialUpdateError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`propertymappings_provider_rac_retrieve`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum PropertymappingsProviderRacRetrieveError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`propertymappings_provider_rac_update`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum PropertymappingsProviderRacUpdateError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`propertymappings_provider_rac_used_by_list`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum PropertymappingsProviderRacUsedByListError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`propertymappings_provider_radius_create`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum PropertymappingsProviderRadiusCreateError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`propertymappings_provider_radius_destroy`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum PropertymappingsProviderRadiusDestroyError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`propertymappings_provider_radius_list`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum PropertymappingsProviderRadiusListError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`propertymappings_provider_radius_partial_update`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum PropertymappingsProviderRadiusPartialUpdateError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`propertymappings_provider_radius_retrieve`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum PropertymappingsProviderRadiusRetrieveError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`propertymappings_provider_radius_update`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum PropertymappingsProviderRadiusUpdateError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`propertymappings_provider_radius_used_by_list`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum PropertymappingsProviderRadiusUsedByListError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`propertymappings_provider_saml_create`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum PropertymappingsProviderSamlCreateError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`propertymappings_provider_saml_destroy`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum PropertymappingsProviderSamlDestroyError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`propertymappings_provider_saml_list`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum PropertymappingsProviderSamlListError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`propertymappings_provider_saml_partial_update`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum PropertymappingsProviderSamlPartialUpdateError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`propertymappings_provider_saml_retrieve`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum PropertymappingsProviderSamlRetrieveError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`propertymappings_provider_saml_update`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum PropertymappingsProviderSamlUpdateError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`propertymappings_provider_saml_used_by_list`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum PropertymappingsProviderSamlUsedByListError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`propertymappings_provider_scim_create`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum PropertymappingsProviderScimCreateError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`propertymappings_provider_scim_destroy`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum PropertymappingsProviderScimDestroyError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`propertymappings_provider_scim_list`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum PropertymappingsProviderScimListError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`propertymappings_provider_scim_partial_update`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum PropertymappingsProviderScimPartialUpdateError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`propertymappings_provider_scim_retrieve`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum PropertymappingsProviderScimRetrieveError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`propertymappings_provider_scim_update`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum PropertymappingsProviderScimUpdateError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`propertymappings_provider_scim_used_by_list`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum PropertymappingsProviderScimUsedByListError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`propertymappings_provider_scope_create`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum PropertymappingsProviderScopeCreateError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`propertymappings_provider_scope_destroy`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum PropertymappingsProviderScopeDestroyError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`propertymappings_provider_scope_list`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum PropertymappingsProviderScopeListError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`propertymappings_provider_scope_partial_update`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum PropertymappingsProviderScopePartialUpdateError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`propertymappings_provider_scope_retrieve`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum PropertymappingsProviderScopeRetrieveError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`propertymappings_provider_scope_update`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum PropertymappingsProviderScopeUpdateError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`propertymappings_provider_scope_used_by_list`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum PropertymappingsProviderScopeUsedByListError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`propertymappings_source_kerberos_create`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum PropertymappingsSourceKerberosCreateError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`propertymappings_source_kerberos_destroy`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum PropertymappingsSourceKerberosDestroyError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`propertymappings_source_kerberos_list`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum PropertymappingsSourceKerberosListError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`propertymappings_source_kerberos_partial_update`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum PropertymappingsSourceKerberosPartialUpdateError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`propertymappings_source_kerberos_retrieve`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum PropertymappingsSourceKerberosRetrieveError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`propertymappings_source_kerberos_update`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum PropertymappingsSourceKerberosUpdateError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`propertymappings_source_kerberos_used_by_list`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum PropertymappingsSourceKerberosUsedByListError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`propertymappings_source_ldap_create`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum PropertymappingsSourceLdapCreateError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`propertymappings_source_ldap_destroy`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum PropertymappingsSourceLdapDestroyError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`propertymappings_source_ldap_list`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum PropertymappingsSourceLdapListError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`propertymappings_source_ldap_partial_update`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum PropertymappingsSourceLdapPartialUpdateError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`propertymappings_source_ldap_retrieve`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum PropertymappingsSourceLdapRetrieveError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`propertymappings_source_ldap_update`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum PropertymappingsSourceLdapUpdateError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`propertymappings_source_ldap_used_by_list`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum PropertymappingsSourceLdapUsedByListError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`propertymappings_source_oauth_create`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum PropertymappingsSourceOauthCreateError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`propertymappings_source_oauth_destroy`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum PropertymappingsSourceOauthDestroyError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`propertymappings_source_oauth_list`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum PropertymappingsSourceOauthListError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`propertymappings_source_oauth_partial_update`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum PropertymappingsSourceOauthPartialUpdateError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`propertymappings_source_oauth_retrieve`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum PropertymappingsSourceOauthRetrieveError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`propertymappings_source_oauth_update`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum PropertymappingsSourceOauthUpdateError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`propertymappings_source_oauth_used_by_list`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum PropertymappingsSourceOauthUsedByListError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`propertymappings_source_plex_create`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum PropertymappingsSourcePlexCreateError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`propertymappings_source_plex_destroy`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum PropertymappingsSourcePlexDestroyError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`propertymappings_source_plex_list`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum PropertymappingsSourcePlexListError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`propertymappings_source_plex_partial_update`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum PropertymappingsSourcePlexPartialUpdateError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`propertymappings_source_plex_retrieve`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum PropertymappingsSourcePlexRetrieveError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`propertymappings_source_plex_update`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum PropertymappingsSourcePlexUpdateError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`propertymappings_source_plex_used_by_list`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum PropertymappingsSourcePlexUsedByListError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`propertymappings_source_saml_create`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum PropertymappingsSourceSamlCreateError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`propertymappings_source_saml_destroy`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum PropertymappingsSourceSamlDestroyError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`propertymappings_source_saml_list`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum PropertymappingsSourceSamlListError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`propertymappings_source_saml_partial_update`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum PropertymappingsSourceSamlPartialUpdateError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`propertymappings_source_saml_retrieve`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum PropertymappingsSourceSamlRetrieveError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`propertymappings_source_saml_update`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum PropertymappingsSourceSamlUpdateError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`propertymappings_source_saml_used_by_list`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum PropertymappingsSourceSamlUsedByListError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`propertymappings_source_scim_create`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum PropertymappingsSourceScimCreateError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`propertymappings_source_scim_destroy`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum PropertymappingsSourceScimDestroyError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`propertymappings_source_scim_list`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum PropertymappingsSourceScimListError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`propertymappings_source_scim_partial_update`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum PropertymappingsSourceScimPartialUpdateError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`propertymappings_source_scim_retrieve`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum PropertymappingsSourceScimRetrieveError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`propertymappings_source_scim_update`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum PropertymappingsSourceScimUpdateError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`propertymappings_source_scim_used_by_list`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum PropertymappingsSourceScimUsedByListError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`propertymappings_source_telegram_create`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum PropertymappingsSourceTelegramCreateError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`propertymappings_source_telegram_destroy`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum PropertymappingsSourceTelegramDestroyError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`propertymappings_source_telegram_list`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum PropertymappingsSourceTelegramListError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`propertymappings_source_telegram_partial_update`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum PropertymappingsSourceTelegramPartialUpdateError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`propertymappings_source_telegram_retrieve`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum PropertymappingsSourceTelegramRetrieveError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`propertymappings_source_telegram_update`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum PropertymappingsSourceTelegramUpdateError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`propertymappings_source_telegram_used_by_list`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum PropertymappingsSourceTelegramUsedByListError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// PropertyMapping Viewset -pub async fn propertymappings_all_destroy( - configuration: &configuration::Configuration, - pm_uuid: &str, -) -> Result<(), Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_pm_uuid = pm_uuid; - - let uri_str = format!( - "{}/propertymappings/all/{pm_uuid}/", - configuration.base_path, - pm_uuid = crate::apis::urlencode(p_path_pm_uuid) - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::DELETE, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - - if !status.is_client_error() && !status.is_server_error() { - Ok(()) - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// PropertyMapping Viewset -pub async fn propertymappings_all_list( - configuration: &configuration::Configuration, - managed: Option>, - managed__isnull: Option, - name: Option<&str>, - ordering: Option<&str>, - page: Option, - page_size: Option, - search: Option<&str>, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_query_managed = managed; - let p_query_managed__isnull = managed__isnull; - let p_query_name = name; - let p_query_ordering = ordering; - let p_query_page = page; - let p_query_page_size = page_size; - let p_query_search = search; - - let uri_str = format!("{}/propertymappings/all/", configuration.base_path); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref param_value) = p_query_managed { - req_builder = match "multi" { - "multi" => req_builder.query( - ¶m_value - .into_iter() - .map(|p| ("managed".to_owned(), p.to_string())) - .collect::>(), - ), - _ => req_builder.query(&[( - "managed", - ¶m_value - .into_iter() - .map(|p| p.to_string()) - .collect::>() - .join(",") - .to_string(), - )]), - }; - } - if let Some(ref param_value) = p_query_managed__isnull { - req_builder = req_builder.query(&[("managed__isnull", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_name { - req_builder = req_builder.query(&[("name", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_ordering { - req_builder = req_builder.query(&[("ordering", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_page { - req_builder = req_builder.query(&[("page", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_page_size { - req_builder = req_builder.query(&[("page_size", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_search { - req_builder = req_builder.query(&[("search", ¶m_value.to_string())]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::PaginatedPropertyMappingList`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::PaginatedPropertyMappingList`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// PropertyMapping Viewset -pub async fn propertymappings_all_retrieve( - configuration: &configuration::Configuration, - pm_uuid: &str, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_pm_uuid = pm_uuid; - - let uri_str = format!( - "{}/propertymappings/all/{pm_uuid}/", - configuration.base_path, - pm_uuid = crate::apis::urlencode(p_path_pm_uuid) - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::PropertyMapping`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::PropertyMapping`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Test Property Mapping -pub async fn propertymappings_all_test_create( - configuration: &configuration::Configuration, - pm_uuid: &str, - format_result: Option, - property_mapping_test_request: Option, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_pm_uuid = pm_uuid; - let p_query_format_result = format_result; - let p_body_property_mapping_test_request = property_mapping_test_request; - - let uri_str = format!( - "{}/propertymappings/all/{pm_uuid}/test/", - configuration.base_path, - pm_uuid = crate::apis::urlencode(p_path_pm_uuid) - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::POST, &uri_str); - - if let Some(ref param_value) = p_query_format_result { - req_builder = req_builder.query(&[("format_result", ¶m_value.to_string())]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - req_builder = req_builder.json(&p_body_property_mapping_test_request); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::PropertyMappingTestResult`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::PropertyMappingTestResult`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Get all creatable types -pub async fn propertymappings_all_types_list( - configuration: &configuration::Configuration, -) -> Result, Error> { - let uri_str = format!("{}/propertymappings/all/types/", configuration.base_path); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `Vec<models::TypeCreate>`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `Vec<models::TypeCreate>`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Get a list of all objects that use this object -pub async fn propertymappings_all_used_by_list( - configuration: &configuration::Configuration, - pm_uuid: &str, -) -> Result, Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_pm_uuid = pm_uuid; - - let uri_str = format!( - "{}/propertymappings/all/{pm_uuid}/used_by/", - configuration.base_path, - pm_uuid = crate::apis::urlencode(p_path_pm_uuid) - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `Vec<models::UsedBy>`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `Vec<models::UsedBy>`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// NotificationWebhookMapping Viewset -pub async fn propertymappings_notification_create( - configuration: &configuration::Configuration, - notification_webhook_mapping_request: models::NotificationWebhookMappingRequest, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_body_notification_webhook_mapping_request = notification_webhook_mapping_request; - - let uri_str = format!("{}/propertymappings/notification/", configuration.base_path); - let mut req_builder = configuration - .client - .request(reqwest::Method::POST, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - req_builder = req_builder.json(&p_body_notification_webhook_mapping_request); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::NotificationWebhookMapping`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::NotificationWebhookMapping`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// NotificationWebhookMapping Viewset -pub async fn propertymappings_notification_destroy( - configuration: &configuration::Configuration, - pm_uuid: &str, -) -> Result<(), Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_pm_uuid = pm_uuid; - - let uri_str = format!( - "{}/propertymappings/notification/{pm_uuid}/", - configuration.base_path, - pm_uuid = crate::apis::urlencode(p_path_pm_uuid) - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::DELETE, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - - if !status.is_client_error() && !status.is_server_error() { - Ok(()) - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// NotificationWebhookMapping Viewset -pub async fn propertymappings_notification_list( - configuration: &configuration::Configuration, - name: Option<&str>, - ordering: Option<&str>, - page: Option, - page_size: Option, - search: Option<&str>, -) -> Result< - models::PaginatedNotificationWebhookMappingList, - Error, -> { - // add a prefix to parameters to efficiently prevent name collisions - let p_query_name = name; - let p_query_ordering = ordering; - let p_query_page = page; - let p_query_page_size = page_size; - let p_query_search = search; - - let uri_str = format!("{}/propertymappings/notification/", configuration.base_path); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref param_value) = p_query_name { - req_builder = req_builder.query(&[("name", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_ordering { - req_builder = req_builder.query(&[("ordering", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_page { - req_builder = req_builder.query(&[("page", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_page_size { - req_builder = req_builder.query(&[("page_size", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_search { - req_builder = req_builder.query(&[("search", ¶m_value.to_string())]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::PaginatedNotificationWebhookMappingList`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::PaginatedNotificationWebhookMappingList`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// NotificationWebhookMapping Viewset -pub async fn propertymappings_notification_partial_update( - configuration: &configuration::Configuration, - pm_uuid: &str, - patched_notification_webhook_mapping_request: Option< - models::PatchedNotificationWebhookMappingRequest, - >, -) -> Result> -{ - // add a prefix to parameters to efficiently prevent name collisions - let p_path_pm_uuid = pm_uuid; - let p_body_patched_notification_webhook_mapping_request = - patched_notification_webhook_mapping_request; - - let uri_str = format!( - "{}/propertymappings/notification/{pm_uuid}/", - configuration.base_path, - pm_uuid = crate::apis::urlencode(p_path_pm_uuid) - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::PATCH, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - req_builder = req_builder.json(&p_body_patched_notification_webhook_mapping_request); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::NotificationWebhookMapping`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::NotificationWebhookMapping`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// NotificationWebhookMapping Viewset -pub async fn propertymappings_notification_retrieve( - configuration: &configuration::Configuration, - pm_uuid: &str, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_pm_uuid = pm_uuid; - - let uri_str = format!( - "{}/propertymappings/notification/{pm_uuid}/", - configuration.base_path, - pm_uuid = crate::apis::urlencode(p_path_pm_uuid) - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::NotificationWebhookMapping`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::NotificationWebhookMapping`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// NotificationWebhookMapping Viewset -pub async fn propertymappings_notification_update( - configuration: &configuration::Configuration, - pm_uuid: &str, - notification_webhook_mapping_request: models::NotificationWebhookMappingRequest, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_pm_uuid = pm_uuid; - let p_body_notification_webhook_mapping_request = notification_webhook_mapping_request; - - let uri_str = format!( - "{}/propertymappings/notification/{pm_uuid}/", - configuration.base_path, - pm_uuid = crate::apis::urlencode(p_path_pm_uuid) - ); - let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - req_builder = req_builder.json(&p_body_notification_webhook_mapping_request); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::NotificationWebhookMapping`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::NotificationWebhookMapping`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Get a list of all objects that use this object -pub async fn propertymappings_notification_used_by_list( - configuration: &configuration::Configuration, - pm_uuid: &str, -) -> Result, Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_pm_uuid = pm_uuid; - - let uri_str = format!( - "{}/propertymappings/notification/{pm_uuid}/used_by/", - configuration.base_path, - pm_uuid = crate::apis::urlencode(p_path_pm_uuid) - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `Vec<models::UsedBy>`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `Vec<models::UsedBy>`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// GoogleWorkspaceProviderMapping Viewset -pub async fn propertymappings_provider_google_workspace_create( - configuration: &configuration::Configuration, - google_workspace_provider_mapping_request: models::GoogleWorkspaceProviderMappingRequest, -) -> Result< - models::GoogleWorkspaceProviderMapping, - Error, -> { - // add a prefix to parameters to efficiently prevent name collisions - let p_body_google_workspace_provider_mapping_request = - google_workspace_provider_mapping_request; - - let uri_str = format!( - "{}/propertymappings/provider/google_workspace/", - configuration.base_path - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::POST, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - req_builder = req_builder.json(&p_body_google_workspace_provider_mapping_request); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::GoogleWorkspaceProviderMapping`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::GoogleWorkspaceProviderMapping`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// GoogleWorkspaceProviderMapping Viewset -pub async fn propertymappings_provider_google_workspace_destroy( - configuration: &configuration::Configuration, - pm_uuid: &str, -) -> Result<(), Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_pm_uuid = pm_uuid; - - let uri_str = format!( - "{}/propertymappings/provider/google_workspace/{pm_uuid}/", - configuration.base_path, - pm_uuid = crate::apis::urlencode(p_path_pm_uuid) - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::DELETE, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - - if !status.is_client_error() && !status.is_server_error() { - Ok(()) - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// GoogleWorkspaceProviderMapping Viewset -pub async fn propertymappings_provider_google_workspace_list( - configuration: &configuration::Configuration, - expression: Option<&str>, - managed: Option>, - name: Option<&str>, - ordering: Option<&str>, - page: Option, - page_size: Option, - pm_uuid: Option<&str>, - search: Option<&str>, -) -> Result< - models::PaginatedGoogleWorkspaceProviderMappingList, - Error, -> { - // add a prefix to parameters to efficiently prevent name collisions - let p_query_expression = expression; - let p_query_managed = managed; - let p_query_name = name; - let p_query_ordering = ordering; - let p_query_page = page; - let p_query_page_size = page_size; - let p_query_pm_uuid = pm_uuid; - let p_query_search = search; - - let uri_str = format!( - "{}/propertymappings/provider/google_workspace/", - configuration.base_path - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref param_value) = p_query_expression { - req_builder = req_builder.query(&[("expression", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_managed { - req_builder = match "multi" { - "multi" => req_builder.query( - ¶m_value - .into_iter() - .map(|p| ("managed".to_owned(), p.to_string())) - .collect::>(), - ), - _ => req_builder.query(&[( - "managed", - ¶m_value - .into_iter() - .map(|p| p.to_string()) - .collect::>() - .join(",") - .to_string(), - )]), - }; - } - if let Some(ref param_value) = p_query_name { - req_builder = req_builder.query(&[("name", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_ordering { - req_builder = req_builder.query(&[("ordering", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_page { - req_builder = req_builder.query(&[("page", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_page_size { - req_builder = req_builder.query(&[("page_size", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_pm_uuid { - req_builder = req_builder.query(&[("pm_uuid", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_search { - req_builder = req_builder.query(&[("search", ¶m_value.to_string())]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::PaginatedGoogleWorkspaceProviderMappingList`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::PaginatedGoogleWorkspaceProviderMappingList`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// GoogleWorkspaceProviderMapping Viewset -pub async fn propertymappings_provider_google_workspace_partial_update( - configuration: &configuration::Configuration, - pm_uuid: &str, - patched_google_workspace_provider_mapping_request: Option< - models::PatchedGoogleWorkspaceProviderMappingRequest, - >, -) -> Result< - models::GoogleWorkspaceProviderMapping, - Error, -> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_pm_uuid = pm_uuid; - let p_body_patched_google_workspace_provider_mapping_request = - patched_google_workspace_provider_mapping_request; - - let uri_str = format!( - "{}/propertymappings/provider/google_workspace/{pm_uuid}/", - configuration.base_path, - pm_uuid = crate::apis::urlencode(p_path_pm_uuid) - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::PATCH, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - req_builder = req_builder.json(&p_body_patched_google_workspace_provider_mapping_request); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::GoogleWorkspaceProviderMapping`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::GoogleWorkspaceProviderMapping`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// GoogleWorkspaceProviderMapping Viewset -pub async fn propertymappings_provider_google_workspace_retrieve( - configuration: &configuration::Configuration, - pm_uuid: &str, -) -> Result< - models::GoogleWorkspaceProviderMapping, - Error, -> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_pm_uuid = pm_uuid; - - let uri_str = format!( - "{}/propertymappings/provider/google_workspace/{pm_uuid}/", - configuration.base_path, - pm_uuid = crate::apis::urlencode(p_path_pm_uuid) - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::GoogleWorkspaceProviderMapping`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::GoogleWorkspaceProviderMapping`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// GoogleWorkspaceProviderMapping Viewset -pub async fn propertymappings_provider_google_workspace_update( - configuration: &configuration::Configuration, - pm_uuid: &str, - google_workspace_provider_mapping_request: models::GoogleWorkspaceProviderMappingRequest, -) -> Result< - models::GoogleWorkspaceProviderMapping, - Error, -> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_pm_uuid = pm_uuid; - let p_body_google_workspace_provider_mapping_request = - google_workspace_provider_mapping_request; - - let uri_str = format!( - "{}/propertymappings/provider/google_workspace/{pm_uuid}/", - configuration.base_path, - pm_uuid = crate::apis::urlencode(p_path_pm_uuid) - ); - let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - req_builder = req_builder.json(&p_body_google_workspace_provider_mapping_request); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::GoogleWorkspaceProviderMapping`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::GoogleWorkspaceProviderMapping`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Get a list of all objects that use this object -pub async fn propertymappings_provider_google_workspace_used_by_list( - configuration: &configuration::Configuration, - pm_uuid: &str, -) -> Result, Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_pm_uuid = pm_uuid; - - let uri_str = format!( - "{}/propertymappings/provider/google_workspace/{pm_uuid}/used_by/", - configuration.base_path, - pm_uuid = crate::apis::urlencode(p_path_pm_uuid) - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `Vec<models::UsedBy>`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `Vec<models::UsedBy>`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// MicrosoftEntraProviderMapping Viewset -pub async fn propertymappings_provider_microsoft_entra_create( - configuration: &configuration::Configuration, - microsoft_entra_provider_mapping_request: models::MicrosoftEntraProviderMappingRequest, -) -> Result< - models::MicrosoftEntraProviderMapping, - Error, -> { - // add a prefix to parameters to efficiently prevent name collisions - let p_body_microsoft_entra_provider_mapping_request = microsoft_entra_provider_mapping_request; - - let uri_str = format!( - "{}/propertymappings/provider/microsoft_entra/", - configuration.base_path - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::POST, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - req_builder = req_builder.json(&p_body_microsoft_entra_provider_mapping_request); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::MicrosoftEntraProviderMapping`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::MicrosoftEntraProviderMapping`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// MicrosoftEntraProviderMapping Viewset -pub async fn propertymappings_provider_microsoft_entra_destroy( - configuration: &configuration::Configuration, - pm_uuid: &str, -) -> Result<(), Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_pm_uuid = pm_uuid; - - let uri_str = format!( - "{}/propertymappings/provider/microsoft_entra/{pm_uuid}/", - configuration.base_path, - pm_uuid = crate::apis::urlencode(p_path_pm_uuid) - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::DELETE, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - - if !status.is_client_error() && !status.is_server_error() { - Ok(()) - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// MicrosoftEntraProviderMapping Viewset -pub async fn propertymappings_provider_microsoft_entra_list( - configuration: &configuration::Configuration, - expression: Option<&str>, - managed: Option>, - name: Option<&str>, - ordering: Option<&str>, - page: Option, - page_size: Option, - pm_uuid: Option<&str>, - search: Option<&str>, -) -> Result< - models::PaginatedMicrosoftEntraProviderMappingList, - Error, -> { - // add a prefix to parameters to efficiently prevent name collisions - let p_query_expression = expression; - let p_query_managed = managed; - let p_query_name = name; - let p_query_ordering = ordering; - let p_query_page = page; - let p_query_page_size = page_size; - let p_query_pm_uuid = pm_uuid; - let p_query_search = search; - - let uri_str = format!( - "{}/propertymappings/provider/microsoft_entra/", - configuration.base_path - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref param_value) = p_query_expression { - req_builder = req_builder.query(&[("expression", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_managed { - req_builder = match "multi" { - "multi" => req_builder.query( - ¶m_value - .into_iter() - .map(|p| ("managed".to_owned(), p.to_string())) - .collect::>(), - ), - _ => req_builder.query(&[( - "managed", - ¶m_value - .into_iter() - .map(|p| p.to_string()) - .collect::>() - .join(",") - .to_string(), - )]), - }; - } - if let Some(ref param_value) = p_query_name { - req_builder = req_builder.query(&[("name", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_ordering { - req_builder = req_builder.query(&[("ordering", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_page { - req_builder = req_builder.query(&[("page", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_page_size { - req_builder = req_builder.query(&[("page_size", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_pm_uuid { - req_builder = req_builder.query(&[("pm_uuid", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_search { - req_builder = req_builder.query(&[("search", ¶m_value.to_string())]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::PaginatedMicrosoftEntraProviderMappingList`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::PaginatedMicrosoftEntraProviderMappingList`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// MicrosoftEntraProviderMapping Viewset -pub async fn propertymappings_provider_microsoft_entra_partial_update( - configuration: &configuration::Configuration, - pm_uuid: &str, - patched_microsoft_entra_provider_mapping_request: Option< - models::PatchedMicrosoftEntraProviderMappingRequest, - >, -) -> Result< - models::MicrosoftEntraProviderMapping, - Error, -> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_pm_uuid = pm_uuid; - let p_body_patched_microsoft_entra_provider_mapping_request = - patched_microsoft_entra_provider_mapping_request; - - let uri_str = format!( - "{}/propertymappings/provider/microsoft_entra/{pm_uuid}/", - configuration.base_path, - pm_uuid = crate::apis::urlencode(p_path_pm_uuid) - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::PATCH, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - req_builder = req_builder.json(&p_body_patched_microsoft_entra_provider_mapping_request); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::MicrosoftEntraProviderMapping`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::MicrosoftEntraProviderMapping`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// MicrosoftEntraProviderMapping Viewset -pub async fn propertymappings_provider_microsoft_entra_retrieve( - configuration: &configuration::Configuration, - pm_uuid: &str, -) -> Result< - models::MicrosoftEntraProviderMapping, - Error, -> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_pm_uuid = pm_uuid; - - let uri_str = format!( - "{}/propertymappings/provider/microsoft_entra/{pm_uuid}/", - configuration.base_path, - pm_uuid = crate::apis::urlencode(p_path_pm_uuid) - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::MicrosoftEntraProviderMapping`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::MicrosoftEntraProviderMapping`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// MicrosoftEntraProviderMapping Viewset -pub async fn propertymappings_provider_microsoft_entra_update( - configuration: &configuration::Configuration, - pm_uuid: &str, - microsoft_entra_provider_mapping_request: models::MicrosoftEntraProviderMappingRequest, -) -> Result< - models::MicrosoftEntraProviderMapping, - Error, -> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_pm_uuid = pm_uuid; - let p_body_microsoft_entra_provider_mapping_request = microsoft_entra_provider_mapping_request; - - let uri_str = format!( - "{}/propertymappings/provider/microsoft_entra/{pm_uuid}/", - configuration.base_path, - pm_uuid = crate::apis::urlencode(p_path_pm_uuid) - ); - let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - req_builder = req_builder.json(&p_body_microsoft_entra_provider_mapping_request); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::MicrosoftEntraProviderMapping`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::MicrosoftEntraProviderMapping`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Get a list of all objects that use this object -pub async fn propertymappings_provider_microsoft_entra_used_by_list( - configuration: &configuration::Configuration, - pm_uuid: &str, -) -> Result, Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_pm_uuid = pm_uuid; - - let uri_str = format!( - "{}/propertymappings/provider/microsoft_entra/{pm_uuid}/used_by/", - configuration.base_path, - pm_uuid = crate::apis::urlencode(p_path_pm_uuid) - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `Vec<models::UsedBy>`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `Vec<models::UsedBy>`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// RACPropertyMapping Viewset -pub async fn propertymappings_provider_rac_create( - configuration: &configuration::Configuration, - rac_property_mapping_request: models::RacPropertyMappingRequest, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_body_rac_property_mapping_request = rac_property_mapping_request; - - let uri_str = format!("{}/propertymappings/provider/rac/", configuration.base_path); - let mut req_builder = configuration - .client - .request(reqwest::Method::POST, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - req_builder = req_builder.json(&p_body_rac_property_mapping_request); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::RacPropertyMapping`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::RacPropertyMapping`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// RACPropertyMapping Viewset -pub async fn propertymappings_provider_rac_destroy( - configuration: &configuration::Configuration, - pm_uuid: &str, -) -> Result<(), Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_pm_uuid = pm_uuid; - - let uri_str = format!( - "{}/propertymappings/provider/rac/{pm_uuid}/", - configuration.base_path, - pm_uuid = crate::apis::urlencode(p_path_pm_uuid) - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::DELETE, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - - if !status.is_client_error() && !status.is_server_error() { - Ok(()) - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// RACPropertyMapping Viewset -pub async fn propertymappings_provider_rac_list( - configuration: &configuration::Configuration, - managed: Option>, - name: Option<&str>, - ordering: Option<&str>, - page: Option, - page_size: Option, - search: Option<&str>, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_query_managed = managed; - let p_query_name = name; - let p_query_ordering = ordering; - let p_query_page = page; - let p_query_page_size = page_size; - let p_query_search = search; - - let uri_str = format!("{}/propertymappings/provider/rac/", configuration.base_path); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref param_value) = p_query_managed { - req_builder = match "multi" { - "multi" => req_builder.query( - ¶m_value - .into_iter() - .map(|p| ("managed".to_owned(), p.to_string())) - .collect::>(), - ), - _ => req_builder.query(&[( - "managed", - ¶m_value - .into_iter() - .map(|p| p.to_string()) - .collect::>() - .join(",") - .to_string(), - )]), - }; - } - if let Some(ref param_value) = p_query_name { - req_builder = req_builder.query(&[("name", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_ordering { - req_builder = req_builder.query(&[("ordering", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_page { - req_builder = req_builder.query(&[("page", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_page_size { - req_builder = req_builder.query(&[("page_size", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_search { - req_builder = req_builder.query(&[("search", ¶m_value.to_string())]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::PaginatedRacPropertyMappingList`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::PaginatedRacPropertyMappingList`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// RACPropertyMapping Viewset -pub async fn propertymappings_provider_rac_partial_update( - configuration: &configuration::Configuration, - pm_uuid: &str, - patched_rac_property_mapping_request: Option, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_pm_uuid = pm_uuid; - let p_body_patched_rac_property_mapping_request = patched_rac_property_mapping_request; - - let uri_str = format!( - "{}/propertymappings/provider/rac/{pm_uuid}/", - configuration.base_path, - pm_uuid = crate::apis::urlencode(p_path_pm_uuid) - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::PATCH, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - req_builder = req_builder.json(&p_body_patched_rac_property_mapping_request); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::RacPropertyMapping`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::RacPropertyMapping`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// RACPropertyMapping Viewset -pub async fn propertymappings_provider_rac_retrieve( - configuration: &configuration::Configuration, - pm_uuid: &str, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_pm_uuid = pm_uuid; - - let uri_str = format!( - "{}/propertymappings/provider/rac/{pm_uuid}/", - configuration.base_path, - pm_uuid = crate::apis::urlencode(p_path_pm_uuid) - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::RacPropertyMapping`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::RacPropertyMapping`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// RACPropertyMapping Viewset -pub async fn propertymappings_provider_rac_update( - configuration: &configuration::Configuration, - pm_uuid: &str, - rac_property_mapping_request: models::RacPropertyMappingRequest, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_pm_uuid = pm_uuid; - let p_body_rac_property_mapping_request = rac_property_mapping_request; - - let uri_str = format!( - "{}/propertymappings/provider/rac/{pm_uuid}/", - configuration.base_path, - pm_uuid = crate::apis::urlencode(p_path_pm_uuid) - ); - let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - req_builder = req_builder.json(&p_body_rac_property_mapping_request); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::RacPropertyMapping`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::RacPropertyMapping`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Get a list of all objects that use this object -pub async fn propertymappings_provider_rac_used_by_list( - configuration: &configuration::Configuration, - pm_uuid: &str, -) -> Result, Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_pm_uuid = pm_uuid; - - let uri_str = format!( - "{}/propertymappings/provider/rac/{pm_uuid}/used_by/", - configuration.base_path, - pm_uuid = crate::apis::urlencode(p_path_pm_uuid) - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `Vec<models::UsedBy>`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `Vec<models::UsedBy>`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// RadiusProviderPropertyMapping Viewset -pub async fn propertymappings_provider_radius_create( - configuration: &configuration::Configuration, - radius_provider_property_mapping_request: models::RadiusProviderPropertyMappingRequest, -) -> Result> -{ - // add a prefix to parameters to efficiently prevent name collisions - let p_body_radius_provider_property_mapping_request = radius_provider_property_mapping_request; - - let uri_str = format!( - "{}/propertymappings/provider/radius/", - configuration.base_path - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::POST, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - req_builder = req_builder.json(&p_body_radius_provider_property_mapping_request); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::RadiusProviderPropertyMapping`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::RadiusProviderPropertyMapping`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// RadiusProviderPropertyMapping Viewset -pub async fn propertymappings_provider_radius_destroy( - configuration: &configuration::Configuration, - pm_uuid: &str, -) -> Result<(), Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_pm_uuid = pm_uuid; - - let uri_str = format!( - "{}/propertymappings/provider/radius/{pm_uuid}/", - configuration.base_path, - pm_uuid = crate::apis::urlencode(p_path_pm_uuid) - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::DELETE, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - - if !status.is_client_error() && !status.is_server_error() { - Ok(()) - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// RadiusProviderPropertyMapping Viewset -pub async fn propertymappings_provider_radius_list( - configuration: &configuration::Configuration, - managed: Option>, - managed__isnull: Option, - name: Option<&str>, - ordering: Option<&str>, - page: Option, - page_size: Option, - search: Option<&str>, -) -> Result< - models::PaginatedRadiusProviderPropertyMappingList, - Error, -> { - // add a prefix to parameters to efficiently prevent name collisions - let p_query_managed = managed; - let p_query_managed__isnull = managed__isnull; - let p_query_name = name; - let p_query_ordering = ordering; - let p_query_page = page; - let p_query_page_size = page_size; - let p_query_search = search; - - let uri_str = format!( - "{}/propertymappings/provider/radius/", - configuration.base_path - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref param_value) = p_query_managed { - req_builder = match "multi" { - "multi" => req_builder.query( - ¶m_value - .into_iter() - .map(|p| ("managed".to_owned(), p.to_string())) - .collect::>(), - ), - _ => req_builder.query(&[( - "managed", - ¶m_value - .into_iter() - .map(|p| p.to_string()) - .collect::>() - .join(",") - .to_string(), - )]), - }; - } - if let Some(ref param_value) = p_query_managed__isnull { - req_builder = req_builder.query(&[("managed__isnull", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_name { - req_builder = req_builder.query(&[("name", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_ordering { - req_builder = req_builder.query(&[("ordering", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_page { - req_builder = req_builder.query(&[("page", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_page_size { - req_builder = req_builder.query(&[("page_size", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_search { - req_builder = req_builder.query(&[("search", ¶m_value.to_string())]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::PaginatedRadiusProviderPropertyMappingList`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::PaginatedRadiusProviderPropertyMappingList`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// RadiusProviderPropertyMapping Viewset -pub async fn propertymappings_provider_radius_partial_update( - configuration: &configuration::Configuration, - pm_uuid: &str, - patched_radius_provider_property_mapping_request: Option< - models::PatchedRadiusProviderPropertyMappingRequest, - >, -) -> Result< - models::RadiusProviderPropertyMapping, - Error, -> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_pm_uuid = pm_uuid; - let p_body_patched_radius_provider_property_mapping_request = - patched_radius_provider_property_mapping_request; - - let uri_str = format!( - "{}/propertymappings/provider/radius/{pm_uuid}/", - configuration.base_path, - pm_uuid = crate::apis::urlencode(p_path_pm_uuid) - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::PATCH, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - req_builder = req_builder.json(&p_body_patched_radius_provider_property_mapping_request); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::RadiusProviderPropertyMapping`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::RadiusProviderPropertyMapping`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// RadiusProviderPropertyMapping Viewset -pub async fn propertymappings_provider_radius_retrieve( - configuration: &configuration::Configuration, - pm_uuid: &str, -) -> Result> -{ - // add a prefix to parameters to efficiently prevent name collisions - let p_path_pm_uuid = pm_uuid; - - let uri_str = format!( - "{}/propertymappings/provider/radius/{pm_uuid}/", - configuration.base_path, - pm_uuid = crate::apis::urlencode(p_path_pm_uuid) - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::RadiusProviderPropertyMapping`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::RadiusProviderPropertyMapping`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// RadiusProviderPropertyMapping Viewset -pub async fn propertymappings_provider_radius_update( - configuration: &configuration::Configuration, - pm_uuid: &str, - radius_provider_property_mapping_request: models::RadiusProviderPropertyMappingRequest, -) -> Result> -{ - // add a prefix to parameters to efficiently prevent name collisions - let p_path_pm_uuid = pm_uuid; - let p_body_radius_provider_property_mapping_request = radius_provider_property_mapping_request; - - let uri_str = format!( - "{}/propertymappings/provider/radius/{pm_uuid}/", - configuration.base_path, - pm_uuid = crate::apis::urlencode(p_path_pm_uuid) - ); - let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - req_builder = req_builder.json(&p_body_radius_provider_property_mapping_request); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::RadiusProviderPropertyMapping`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::RadiusProviderPropertyMapping`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Get a list of all objects that use this object -pub async fn propertymappings_provider_radius_used_by_list( - configuration: &configuration::Configuration, - pm_uuid: &str, -) -> Result, Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_pm_uuid = pm_uuid; - - let uri_str = format!( - "{}/propertymappings/provider/radius/{pm_uuid}/used_by/", - configuration.base_path, - pm_uuid = crate::apis::urlencode(p_path_pm_uuid) - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `Vec<models::UsedBy>`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `Vec<models::UsedBy>`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// SAMLPropertyMapping Viewset -pub async fn propertymappings_provider_saml_create( - configuration: &configuration::Configuration, - saml_property_mapping_request: models::SamlPropertyMappingRequest, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_body_saml_property_mapping_request = saml_property_mapping_request; - - let uri_str = format!( - "{}/propertymappings/provider/saml/", - configuration.base_path - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::POST, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - req_builder = req_builder.json(&p_body_saml_property_mapping_request); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::SamlPropertyMapping`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::SamlPropertyMapping`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// SAMLPropertyMapping Viewset -pub async fn propertymappings_provider_saml_destroy( - configuration: &configuration::Configuration, - pm_uuid: &str, -) -> Result<(), Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_pm_uuid = pm_uuid; - - let uri_str = format!( - "{}/propertymappings/provider/saml/{pm_uuid}/", - configuration.base_path, - pm_uuid = crate::apis::urlencode(p_path_pm_uuid) - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::DELETE, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - - if !status.is_client_error() && !status.is_server_error() { - Ok(()) - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// SAMLPropertyMapping Viewset -pub async fn propertymappings_provider_saml_list( - configuration: &configuration::Configuration, - friendly_name: Option<&str>, - managed: Option>, - managed__isnull: Option, - name: Option<&str>, - ordering: Option<&str>, - page: Option, - page_size: Option, - saml_name: Option<&str>, - search: Option<&str>, -) -> Result> -{ - // add a prefix to parameters to efficiently prevent name collisions - let p_query_friendly_name = friendly_name; - let p_query_managed = managed; - let p_query_managed__isnull = managed__isnull; - let p_query_name = name; - let p_query_ordering = ordering; - let p_query_page = page; - let p_query_page_size = page_size; - let p_query_saml_name = saml_name; - let p_query_search = search; - - let uri_str = format!( - "{}/propertymappings/provider/saml/", - configuration.base_path - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref param_value) = p_query_friendly_name { - req_builder = req_builder.query(&[("friendly_name", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_managed { - req_builder = match "multi" { - "multi" => req_builder.query( - ¶m_value - .into_iter() - .map(|p| ("managed".to_owned(), p.to_string())) - .collect::>(), - ), - _ => req_builder.query(&[( - "managed", - ¶m_value - .into_iter() - .map(|p| p.to_string()) - .collect::>() - .join(",") - .to_string(), - )]), - }; - } - if let Some(ref param_value) = p_query_managed__isnull { - req_builder = req_builder.query(&[("managed__isnull", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_name { - req_builder = req_builder.query(&[("name", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_ordering { - req_builder = req_builder.query(&[("ordering", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_page { - req_builder = req_builder.query(&[("page", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_page_size { - req_builder = req_builder.query(&[("page_size", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_saml_name { - req_builder = req_builder.query(&[("saml_name", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_search { - req_builder = req_builder.query(&[("search", ¶m_value.to_string())]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::PaginatedSamlPropertyMappingList`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::PaginatedSamlPropertyMappingList`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// SAMLPropertyMapping Viewset -pub async fn propertymappings_provider_saml_partial_update( - configuration: &configuration::Configuration, - pm_uuid: &str, - patched_saml_property_mapping_request: Option, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_pm_uuid = pm_uuid; - let p_body_patched_saml_property_mapping_request = patched_saml_property_mapping_request; - - let uri_str = format!( - "{}/propertymappings/provider/saml/{pm_uuid}/", - configuration.base_path, - pm_uuid = crate::apis::urlencode(p_path_pm_uuid) - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::PATCH, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - req_builder = req_builder.json(&p_body_patched_saml_property_mapping_request); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::SamlPropertyMapping`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::SamlPropertyMapping`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// SAMLPropertyMapping Viewset -pub async fn propertymappings_provider_saml_retrieve( - configuration: &configuration::Configuration, - pm_uuid: &str, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_pm_uuid = pm_uuid; - - let uri_str = format!( - "{}/propertymappings/provider/saml/{pm_uuid}/", - configuration.base_path, - pm_uuid = crate::apis::urlencode(p_path_pm_uuid) - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::SamlPropertyMapping`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::SamlPropertyMapping`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// SAMLPropertyMapping Viewset -pub async fn propertymappings_provider_saml_update( - configuration: &configuration::Configuration, - pm_uuid: &str, - saml_property_mapping_request: models::SamlPropertyMappingRequest, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_pm_uuid = pm_uuid; - let p_body_saml_property_mapping_request = saml_property_mapping_request; - - let uri_str = format!( - "{}/propertymappings/provider/saml/{pm_uuid}/", - configuration.base_path, - pm_uuid = crate::apis::urlencode(p_path_pm_uuid) - ); - let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - req_builder = req_builder.json(&p_body_saml_property_mapping_request); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::SamlPropertyMapping`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::SamlPropertyMapping`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Get a list of all objects that use this object -pub async fn propertymappings_provider_saml_used_by_list( - configuration: &configuration::Configuration, - pm_uuid: &str, -) -> Result, Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_pm_uuid = pm_uuid; - - let uri_str = format!( - "{}/propertymappings/provider/saml/{pm_uuid}/used_by/", - configuration.base_path, - pm_uuid = crate::apis::urlencode(p_path_pm_uuid) - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `Vec<models::UsedBy>`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `Vec<models::UsedBy>`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// SCIMMapping Viewset -pub async fn propertymappings_provider_scim_create( - configuration: &configuration::Configuration, - scim_mapping_request: models::ScimMappingRequest, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_body_scim_mapping_request = scim_mapping_request; - - let uri_str = format!( - "{}/propertymappings/provider/scim/", - configuration.base_path - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::POST, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - req_builder = req_builder.json(&p_body_scim_mapping_request); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::ScimMapping`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::ScimMapping`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// SCIMMapping Viewset -pub async fn propertymappings_provider_scim_destroy( - configuration: &configuration::Configuration, - pm_uuid: &str, -) -> Result<(), Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_pm_uuid = pm_uuid; - - let uri_str = format!( - "{}/propertymappings/provider/scim/{pm_uuid}/", - configuration.base_path, - pm_uuid = crate::apis::urlencode(p_path_pm_uuid) - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::DELETE, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - - if !status.is_client_error() && !status.is_server_error() { - Ok(()) - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// SCIMMapping Viewset -pub async fn propertymappings_provider_scim_list( - configuration: &configuration::Configuration, - managed: Option>, - managed__isnull: Option, - name: Option<&str>, - ordering: Option<&str>, - page: Option, - page_size: Option, - search: Option<&str>, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_query_managed = managed; - let p_query_managed__isnull = managed__isnull; - let p_query_name = name; - let p_query_ordering = ordering; - let p_query_page = page; - let p_query_page_size = page_size; - let p_query_search = search; - - let uri_str = format!( - "{}/propertymappings/provider/scim/", - configuration.base_path - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref param_value) = p_query_managed { - req_builder = match "multi" { - "multi" => req_builder.query( - ¶m_value - .into_iter() - .map(|p| ("managed".to_owned(), p.to_string())) - .collect::>(), - ), - _ => req_builder.query(&[( - "managed", - ¶m_value - .into_iter() - .map(|p| p.to_string()) - .collect::>() - .join(",") - .to_string(), - )]), - }; - } - if let Some(ref param_value) = p_query_managed__isnull { - req_builder = req_builder.query(&[("managed__isnull", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_name { - req_builder = req_builder.query(&[("name", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_ordering { - req_builder = req_builder.query(&[("ordering", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_page { - req_builder = req_builder.query(&[("page", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_page_size { - req_builder = req_builder.query(&[("page_size", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_search { - req_builder = req_builder.query(&[("search", ¶m_value.to_string())]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::PaginatedScimMappingList`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::PaginatedScimMappingList`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// SCIMMapping Viewset -pub async fn propertymappings_provider_scim_partial_update( - configuration: &configuration::Configuration, - pm_uuid: &str, - patched_scim_mapping_request: Option, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_pm_uuid = pm_uuid; - let p_body_patched_scim_mapping_request = patched_scim_mapping_request; - - let uri_str = format!( - "{}/propertymappings/provider/scim/{pm_uuid}/", - configuration.base_path, - pm_uuid = crate::apis::urlencode(p_path_pm_uuid) - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::PATCH, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - req_builder = req_builder.json(&p_body_patched_scim_mapping_request); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::ScimMapping`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::ScimMapping`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// SCIMMapping Viewset -pub async fn propertymappings_provider_scim_retrieve( - configuration: &configuration::Configuration, - pm_uuid: &str, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_pm_uuid = pm_uuid; - - let uri_str = format!( - "{}/propertymappings/provider/scim/{pm_uuid}/", - configuration.base_path, - pm_uuid = crate::apis::urlencode(p_path_pm_uuid) - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::ScimMapping`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::ScimMapping`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// SCIMMapping Viewset -pub async fn propertymappings_provider_scim_update( - configuration: &configuration::Configuration, - pm_uuid: &str, - scim_mapping_request: models::ScimMappingRequest, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_pm_uuid = pm_uuid; - let p_body_scim_mapping_request = scim_mapping_request; - - let uri_str = format!( - "{}/propertymappings/provider/scim/{pm_uuid}/", - configuration.base_path, - pm_uuid = crate::apis::urlencode(p_path_pm_uuid) - ); - let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - req_builder = req_builder.json(&p_body_scim_mapping_request); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::ScimMapping`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::ScimMapping`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Get a list of all objects that use this object -pub async fn propertymappings_provider_scim_used_by_list( - configuration: &configuration::Configuration, - pm_uuid: &str, -) -> Result, Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_pm_uuid = pm_uuid; - - let uri_str = format!( - "{}/propertymappings/provider/scim/{pm_uuid}/used_by/", - configuration.base_path, - pm_uuid = crate::apis::urlencode(p_path_pm_uuid) - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `Vec<models::UsedBy>`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `Vec<models::UsedBy>`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// ScopeMapping Viewset -pub async fn propertymappings_provider_scope_create( - configuration: &configuration::Configuration, - scope_mapping_request: models::ScopeMappingRequest, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_body_scope_mapping_request = scope_mapping_request; - - let uri_str = format!( - "{}/propertymappings/provider/scope/", - configuration.base_path - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::POST, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - req_builder = req_builder.json(&p_body_scope_mapping_request); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::ScopeMapping`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::ScopeMapping`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// ScopeMapping Viewset -pub async fn propertymappings_provider_scope_destroy( - configuration: &configuration::Configuration, - pm_uuid: &str, -) -> Result<(), Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_pm_uuid = pm_uuid; - - let uri_str = format!( - "{}/propertymappings/provider/scope/{pm_uuid}/", - configuration.base_path, - pm_uuid = crate::apis::urlencode(p_path_pm_uuid) - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::DELETE, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - - if !status.is_client_error() && !status.is_server_error() { - Ok(()) - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// ScopeMapping Viewset -pub async fn propertymappings_provider_scope_list( - configuration: &configuration::Configuration, - managed: Option>, - managed__isnull: Option, - name: Option<&str>, - ordering: Option<&str>, - page: Option, - page_size: Option, - scope_name: Option<&str>, - search: Option<&str>, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_query_managed = managed; - let p_query_managed__isnull = managed__isnull; - let p_query_name = name; - let p_query_ordering = ordering; - let p_query_page = page; - let p_query_page_size = page_size; - let p_query_scope_name = scope_name; - let p_query_search = search; - - let uri_str = format!( - "{}/propertymappings/provider/scope/", - configuration.base_path - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref param_value) = p_query_managed { - req_builder = match "multi" { - "multi" => req_builder.query( - ¶m_value - .into_iter() - .map(|p| ("managed".to_owned(), p.to_string())) - .collect::>(), - ), - _ => req_builder.query(&[( - "managed", - ¶m_value - .into_iter() - .map(|p| p.to_string()) - .collect::>() - .join(",") - .to_string(), - )]), - }; - } - if let Some(ref param_value) = p_query_managed__isnull { - req_builder = req_builder.query(&[("managed__isnull", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_name { - req_builder = req_builder.query(&[("name", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_ordering { - req_builder = req_builder.query(&[("ordering", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_page { - req_builder = req_builder.query(&[("page", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_page_size { - req_builder = req_builder.query(&[("page_size", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_scope_name { - req_builder = req_builder.query(&[("scope_name", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_search { - req_builder = req_builder.query(&[("search", ¶m_value.to_string())]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::PaginatedScopeMappingList`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::PaginatedScopeMappingList`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// ScopeMapping Viewset -pub async fn propertymappings_provider_scope_partial_update( - configuration: &configuration::Configuration, - pm_uuid: &str, - patched_scope_mapping_request: Option, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_pm_uuid = pm_uuid; - let p_body_patched_scope_mapping_request = patched_scope_mapping_request; - - let uri_str = format!( - "{}/propertymappings/provider/scope/{pm_uuid}/", - configuration.base_path, - pm_uuid = crate::apis::urlencode(p_path_pm_uuid) - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::PATCH, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - req_builder = req_builder.json(&p_body_patched_scope_mapping_request); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::ScopeMapping`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::ScopeMapping`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// ScopeMapping Viewset -pub async fn propertymappings_provider_scope_retrieve( - configuration: &configuration::Configuration, - pm_uuid: &str, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_pm_uuid = pm_uuid; - - let uri_str = format!( - "{}/propertymappings/provider/scope/{pm_uuid}/", - configuration.base_path, - pm_uuid = crate::apis::urlencode(p_path_pm_uuid) - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::ScopeMapping`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::ScopeMapping`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// ScopeMapping Viewset -pub async fn propertymappings_provider_scope_update( - configuration: &configuration::Configuration, - pm_uuid: &str, - scope_mapping_request: models::ScopeMappingRequest, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_pm_uuid = pm_uuid; - let p_body_scope_mapping_request = scope_mapping_request; - - let uri_str = format!( - "{}/propertymappings/provider/scope/{pm_uuid}/", - configuration.base_path, - pm_uuid = crate::apis::urlencode(p_path_pm_uuid) - ); - let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - req_builder = req_builder.json(&p_body_scope_mapping_request); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::ScopeMapping`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::ScopeMapping`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Get a list of all objects that use this object -pub async fn propertymappings_provider_scope_used_by_list( - configuration: &configuration::Configuration, - pm_uuid: &str, -) -> Result, Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_pm_uuid = pm_uuid; - - let uri_str = format!( - "{}/propertymappings/provider/scope/{pm_uuid}/used_by/", - configuration.base_path, - pm_uuid = crate::apis::urlencode(p_path_pm_uuid) - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `Vec<models::UsedBy>`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `Vec<models::UsedBy>`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// KerberosSource PropertyMapping Viewset -pub async fn propertymappings_source_kerberos_create( - configuration: &configuration::Configuration, - kerberos_source_property_mapping_request: models::KerberosSourcePropertyMappingRequest, -) -> Result> -{ - // add a prefix to parameters to efficiently prevent name collisions - let p_body_kerberos_source_property_mapping_request = kerberos_source_property_mapping_request; - - let uri_str = format!( - "{}/propertymappings/source/kerberos/", - configuration.base_path - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::POST, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - req_builder = req_builder.json(&p_body_kerberos_source_property_mapping_request); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::KerberosSourcePropertyMapping`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::KerberosSourcePropertyMapping`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// KerberosSource PropertyMapping Viewset -pub async fn propertymappings_source_kerberos_destroy( - configuration: &configuration::Configuration, - pm_uuid: &str, -) -> Result<(), Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_pm_uuid = pm_uuid; - - let uri_str = format!( - "{}/propertymappings/source/kerberos/{pm_uuid}/", - configuration.base_path, - pm_uuid = crate::apis::urlencode(p_path_pm_uuid) - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::DELETE, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - - if !status.is_client_error() && !status.is_server_error() { - Ok(()) - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// KerberosSource PropertyMapping Viewset -pub async fn propertymappings_source_kerberos_list( - configuration: &configuration::Configuration, - managed: Option>, - managed__isnull: Option, - name: Option<&str>, - ordering: Option<&str>, - page: Option, - page_size: Option, - search: Option<&str>, -) -> Result< - models::PaginatedKerberosSourcePropertyMappingList, - Error, -> { - // add a prefix to parameters to efficiently prevent name collisions - let p_query_managed = managed; - let p_query_managed__isnull = managed__isnull; - let p_query_name = name; - let p_query_ordering = ordering; - let p_query_page = page; - let p_query_page_size = page_size; - let p_query_search = search; - - let uri_str = format!( - "{}/propertymappings/source/kerberos/", - configuration.base_path - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref param_value) = p_query_managed { - req_builder = match "multi" { - "multi" => req_builder.query( - ¶m_value - .into_iter() - .map(|p| ("managed".to_owned(), p.to_string())) - .collect::>(), - ), - _ => req_builder.query(&[( - "managed", - ¶m_value - .into_iter() - .map(|p| p.to_string()) - .collect::>() - .join(",") - .to_string(), - )]), - }; - } - if let Some(ref param_value) = p_query_managed__isnull { - req_builder = req_builder.query(&[("managed__isnull", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_name { - req_builder = req_builder.query(&[("name", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_ordering { - req_builder = req_builder.query(&[("ordering", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_page { - req_builder = req_builder.query(&[("page", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_page_size { - req_builder = req_builder.query(&[("page_size", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_search { - req_builder = req_builder.query(&[("search", ¶m_value.to_string())]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::PaginatedKerberosSourcePropertyMappingList`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::PaginatedKerberosSourcePropertyMappingList`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// KerberosSource PropertyMapping Viewset -pub async fn propertymappings_source_kerberos_partial_update( - configuration: &configuration::Configuration, - pm_uuid: &str, - patched_kerberos_source_property_mapping_request: Option< - models::PatchedKerberosSourcePropertyMappingRequest, - >, -) -> Result< - models::KerberosSourcePropertyMapping, - Error, -> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_pm_uuid = pm_uuid; - let p_body_patched_kerberos_source_property_mapping_request = - patched_kerberos_source_property_mapping_request; - - let uri_str = format!( - "{}/propertymappings/source/kerberos/{pm_uuid}/", - configuration.base_path, - pm_uuid = crate::apis::urlencode(p_path_pm_uuid) - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::PATCH, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - req_builder = req_builder.json(&p_body_patched_kerberos_source_property_mapping_request); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::KerberosSourcePropertyMapping`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::KerberosSourcePropertyMapping`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// KerberosSource PropertyMapping Viewset -pub async fn propertymappings_source_kerberos_retrieve( - configuration: &configuration::Configuration, - pm_uuid: &str, -) -> Result> -{ - // add a prefix to parameters to efficiently prevent name collisions - let p_path_pm_uuid = pm_uuid; - - let uri_str = format!( - "{}/propertymappings/source/kerberos/{pm_uuid}/", - configuration.base_path, - pm_uuid = crate::apis::urlencode(p_path_pm_uuid) - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::KerberosSourcePropertyMapping`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::KerberosSourcePropertyMapping`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// KerberosSource PropertyMapping Viewset -pub async fn propertymappings_source_kerberos_update( - configuration: &configuration::Configuration, - pm_uuid: &str, - kerberos_source_property_mapping_request: models::KerberosSourcePropertyMappingRequest, -) -> Result> -{ - // add a prefix to parameters to efficiently prevent name collisions - let p_path_pm_uuid = pm_uuid; - let p_body_kerberos_source_property_mapping_request = kerberos_source_property_mapping_request; - - let uri_str = format!( - "{}/propertymappings/source/kerberos/{pm_uuid}/", - configuration.base_path, - pm_uuid = crate::apis::urlencode(p_path_pm_uuid) - ); - let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - req_builder = req_builder.json(&p_body_kerberos_source_property_mapping_request); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::KerberosSourcePropertyMapping`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::KerberosSourcePropertyMapping`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Get a list of all objects that use this object -pub async fn propertymappings_source_kerberos_used_by_list( - configuration: &configuration::Configuration, - pm_uuid: &str, -) -> Result, Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_pm_uuid = pm_uuid; - - let uri_str = format!( - "{}/propertymappings/source/kerberos/{pm_uuid}/used_by/", - configuration.base_path, - pm_uuid = crate::apis::urlencode(p_path_pm_uuid) - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `Vec<models::UsedBy>`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `Vec<models::UsedBy>`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// LDAP PropertyMapping Viewset -pub async fn propertymappings_source_ldap_create( - configuration: &configuration::Configuration, - ldap_source_property_mapping_request: models::LdapSourcePropertyMappingRequest, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_body_ldap_source_property_mapping_request = ldap_source_property_mapping_request; - - let uri_str = format!("{}/propertymappings/source/ldap/", configuration.base_path); - let mut req_builder = configuration - .client - .request(reqwest::Method::POST, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - req_builder = req_builder.json(&p_body_ldap_source_property_mapping_request); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::LdapSourcePropertyMapping`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::LdapSourcePropertyMapping`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// LDAP PropertyMapping Viewset -pub async fn propertymappings_source_ldap_destroy( - configuration: &configuration::Configuration, - pm_uuid: &str, -) -> Result<(), Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_pm_uuid = pm_uuid; - - let uri_str = format!( - "{}/propertymappings/source/ldap/{pm_uuid}/", - configuration.base_path, - pm_uuid = crate::apis::urlencode(p_path_pm_uuid) - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::DELETE, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - - if !status.is_client_error() && !status.is_server_error() { - Ok(()) - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// LDAP PropertyMapping Viewset -pub async fn propertymappings_source_ldap_list( - configuration: &configuration::Configuration, - managed: Option>, - managed__isnull: Option, - name: Option<&str>, - ordering: Option<&str>, - page: Option, - page_size: Option, - search: Option<&str>, -) -> Result< - models::PaginatedLdapSourcePropertyMappingList, - Error, -> { - // add a prefix to parameters to efficiently prevent name collisions - let p_query_managed = managed; - let p_query_managed__isnull = managed__isnull; - let p_query_name = name; - let p_query_ordering = ordering; - let p_query_page = page; - let p_query_page_size = page_size; - let p_query_search = search; - - let uri_str = format!("{}/propertymappings/source/ldap/", configuration.base_path); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref param_value) = p_query_managed { - req_builder = match "multi" { - "multi" => req_builder.query( - ¶m_value - .into_iter() - .map(|p| ("managed".to_owned(), p.to_string())) - .collect::>(), - ), - _ => req_builder.query(&[( - "managed", - ¶m_value - .into_iter() - .map(|p| p.to_string()) - .collect::>() - .join(",") - .to_string(), - )]), - }; - } - if let Some(ref param_value) = p_query_managed__isnull { - req_builder = req_builder.query(&[("managed__isnull", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_name { - req_builder = req_builder.query(&[("name", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_ordering { - req_builder = req_builder.query(&[("ordering", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_page { - req_builder = req_builder.query(&[("page", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_page_size { - req_builder = req_builder.query(&[("page_size", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_search { - req_builder = req_builder.query(&[("search", ¶m_value.to_string())]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::PaginatedLdapSourcePropertyMappingList`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::PaginatedLdapSourcePropertyMappingList`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// LDAP PropertyMapping Viewset -pub async fn propertymappings_source_ldap_partial_update( - configuration: &configuration::Configuration, - pm_uuid: &str, - patched_ldap_source_property_mapping_request: Option< - models::PatchedLdapSourcePropertyMappingRequest, - >, -) -> Result> -{ - // add a prefix to parameters to efficiently prevent name collisions - let p_path_pm_uuid = pm_uuid; - let p_body_patched_ldap_source_property_mapping_request = - patched_ldap_source_property_mapping_request; - - let uri_str = format!( - "{}/propertymappings/source/ldap/{pm_uuid}/", - configuration.base_path, - pm_uuid = crate::apis::urlencode(p_path_pm_uuid) - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::PATCH, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - req_builder = req_builder.json(&p_body_patched_ldap_source_property_mapping_request); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::LdapSourcePropertyMapping`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::LdapSourcePropertyMapping`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// LDAP PropertyMapping Viewset -pub async fn propertymappings_source_ldap_retrieve( - configuration: &configuration::Configuration, - pm_uuid: &str, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_pm_uuid = pm_uuid; - - let uri_str = format!( - "{}/propertymappings/source/ldap/{pm_uuid}/", - configuration.base_path, - pm_uuid = crate::apis::urlencode(p_path_pm_uuid) - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::LdapSourcePropertyMapping`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::LdapSourcePropertyMapping`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// LDAP PropertyMapping Viewset -pub async fn propertymappings_source_ldap_update( - configuration: &configuration::Configuration, - pm_uuid: &str, - ldap_source_property_mapping_request: models::LdapSourcePropertyMappingRequest, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_pm_uuid = pm_uuid; - let p_body_ldap_source_property_mapping_request = ldap_source_property_mapping_request; - - let uri_str = format!( - "{}/propertymappings/source/ldap/{pm_uuid}/", - configuration.base_path, - pm_uuid = crate::apis::urlencode(p_path_pm_uuid) - ); - let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - req_builder = req_builder.json(&p_body_ldap_source_property_mapping_request); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::LdapSourcePropertyMapping`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::LdapSourcePropertyMapping`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Get a list of all objects that use this object -pub async fn propertymappings_source_ldap_used_by_list( - configuration: &configuration::Configuration, - pm_uuid: &str, -) -> Result, Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_pm_uuid = pm_uuid; - - let uri_str = format!( - "{}/propertymappings/source/ldap/{pm_uuid}/used_by/", - configuration.base_path, - pm_uuid = crate::apis::urlencode(p_path_pm_uuid) - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `Vec<models::UsedBy>`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `Vec<models::UsedBy>`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// OAuthSourcePropertyMapping Viewset -pub async fn propertymappings_source_oauth_create( - configuration: &configuration::Configuration, - o_auth_source_property_mapping_request: models::OAuthSourcePropertyMappingRequest, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_body_o_auth_source_property_mapping_request = o_auth_source_property_mapping_request; - - let uri_str = format!("{}/propertymappings/source/oauth/", configuration.base_path); - let mut req_builder = configuration - .client - .request(reqwest::Method::POST, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - req_builder = req_builder.json(&p_body_o_auth_source_property_mapping_request); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::OAuthSourcePropertyMapping`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::OAuthSourcePropertyMapping`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// OAuthSourcePropertyMapping Viewset -pub async fn propertymappings_source_oauth_destroy( - configuration: &configuration::Configuration, - pm_uuid: &str, -) -> Result<(), Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_pm_uuid = pm_uuid; - - let uri_str = format!( - "{}/propertymappings/source/oauth/{pm_uuid}/", - configuration.base_path, - pm_uuid = crate::apis::urlencode(p_path_pm_uuid) - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::DELETE, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - - if !status.is_client_error() && !status.is_server_error() { - Ok(()) - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// OAuthSourcePropertyMapping Viewset -pub async fn propertymappings_source_oauth_list( - configuration: &configuration::Configuration, - managed: Option>, - managed__isnull: Option, - name: Option<&str>, - ordering: Option<&str>, - page: Option, - page_size: Option, - search: Option<&str>, -) -> Result< - models::PaginatedOAuthSourcePropertyMappingList, - Error, -> { - // add a prefix to parameters to efficiently prevent name collisions - let p_query_managed = managed; - let p_query_managed__isnull = managed__isnull; - let p_query_name = name; - let p_query_ordering = ordering; - let p_query_page = page; - let p_query_page_size = page_size; - let p_query_search = search; - - let uri_str = format!("{}/propertymappings/source/oauth/", configuration.base_path); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref param_value) = p_query_managed { - req_builder = match "multi" { - "multi" => req_builder.query( - ¶m_value - .into_iter() - .map(|p| ("managed".to_owned(), p.to_string())) - .collect::>(), - ), - _ => req_builder.query(&[( - "managed", - ¶m_value - .into_iter() - .map(|p| p.to_string()) - .collect::>() - .join(",") - .to_string(), - )]), - }; - } - if let Some(ref param_value) = p_query_managed__isnull { - req_builder = req_builder.query(&[("managed__isnull", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_name { - req_builder = req_builder.query(&[("name", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_ordering { - req_builder = req_builder.query(&[("ordering", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_page { - req_builder = req_builder.query(&[("page", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_page_size { - req_builder = req_builder.query(&[("page_size", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_search { - req_builder = req_builder.query(&[("search", ¶m_value.to_string())]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::PaginatedOAuthSourcePropertyMappingList`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::PaginatedOAuthSourcePropertyMappingList`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// OAuthSourcePropertyMapping Viewset -pub async fn propertymappings_source_oauth_partial_update( - configuration: &configuration::Configuration, - pm_uuid: &str, - patched_o_auth_source_property_mapping_request: Option< - models::PatchedOAuthSourcePropertyMappingRequest, - >, -) -> Result> -{ - // add a prefix to parameters to efficiently prevent name collisions - let p_path_pm_uuid = pm_uuid; - let p_body_patched_o_auth_source_property_mapping_request = - patched_o_auth_source_property_mapping_request; - - let uri_str = format!( - "{}/propertymappings/source/oauth/{pm_uuid}/", - configuration.base_path, - pm_uuid = crate::apis::urlencode(p_path_pm_uuid) - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::PATCH, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - req_builder = req_builder.json(&p_body_patched_o_auth_source_property_mapping_request); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::OAuthSourcePropertyMapping`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::OAuthSourcePropertyMapping`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// OAuthSourcePropertyMapping Viewset -pub async fn propertymappings_source_oauth_retrieve( - configuration: &configuration::Configuration, - pm_uuid: &str, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_pm_uuid = pm_uuid; - - let uri_str = format!( - "{}/propertymappings/source/oauth/{pm_uuid}/", - configuration.base_path, - pm_uuid = crate::apis::urlencode(p_path_pm_uuid) - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::OAuthSourcePropertyMapping`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::OAuthSourcePropertyMapping`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// OAuthSourcePropertyMapping Viewset -pub async fn propertymappings_source_oauth_update( - configuration: &configuration::Configuration, - pm_uuid: &str, - o_auth_source_property_mapping_request: models::OAuthSourcePropertyMappingRequest, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_pm_uuid = pm_uuid; - let p_body_o_auth_source_property_mapping_request = o_auth_source_property_mapping_request; - - let uri_str = format!( - "{}/propertymappings/source/oauth/{pm_uuid}/", - configuration.base_path, - pm_uuid = crate::apis::urlencode(p_path_pm_uuid) - ); - let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - req_builder = req_builder.json(&p_body_o_auth_source_property_mapping_request); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::OAuthSourcePropertyMapping`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::OAuthSourcePropertyMapping`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Get a list of all objects that use this object -pub async fn propertymappings_source_oauth_used_by_list( - configuration: &configuration::Configuration, - pm_uuid: &str, -) -> Result, Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_pm_uuid = pm_uuid; - - let uri_str = format!( - "{}/propertymappings/source/oauth/{pm_uuid}/used_by/", - configuration.base_path, - pm_uuid = crate::apis::urlencode(p_path_pm_uuid) - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `Vec<models::UsedBy>`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `Vec<models::UsedBy>`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// PlexSourcePropertyMapping Viewset -pub async fn propertymappings_source_plex_create( - configuration: &configuration::Configuration, - plex_source_property_mapping_request: models::PlexSourcePropertyMappingRequest, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_body_plex_source_property_mapping_request = plex_source_property_mapping_request; - - let uri_str = format!("{}/propertymappings/source/plex/", configuration.base_path); - let mut req_builder = configuration - .client - .request(reqwest::Method::POST, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - req_builder = req_builder.json(&p_body_plex_source_property_mapping_request); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::PlexSourcePropertyMapping`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::PlexSourcePropertyMapping`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// PlexSourcePropertyMapping Viewset -pub async fn propertymappings_source_plex_destroy( - configuration: &configuration::Configuration, - pm_uuid: &str, -) -> Result<(), Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_pm_uuid = pm_uuid; - - let uri_str = format!( - "{}/propertymappings/source/plex/{pm_uuid}/", - configuration.base_path, - pm_uuid = crate::apis::urlencode(p_path_pm_uuid) - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::DELETE, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - - if !status.is_client_error() && !status.is_server_error() { - Ok(()) - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// PlexSourcePropertyMapping Viewset -pub async fn propertymappings_source_plex_list( - configuration: &configuration::Configuration, - managed: Option>, - managed__isnull: Option, - name: Option<&str>, - ordering: Option<&str>, - page: Option, - page_size: Option, - search: Option<&str>, -) -> Result< - models::PaginatedPlexSourcePropertyMappingList, - Error, -> { - // add a prefix to parameters to efficiently prevent name collisions - let p_query_managed = managed; - let p_query_managed__isnull = managed__isnull; - let p_query_name = name; - let p_query_ordering = ordering; - let p_query_page = page; - let p_query_page_size = page_size; - let p_query_search = search; - - let uri_str = format!("{}/propertymappings/source/plex/", configuration.base_path); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref param_value) = p_query_managed { - req_builder = match "multi" { - "multi" => req_builder.query( - ¶m_value - .into_iter() - .map(|p| ("managed".to_owned(), p.to_string())) - .collect::>(), - ), - _ => req_builder.query(&[( - "managed", - ¶m_value - .into_iter() - .map(|p| p.to_string()) - .collect::>() - .join(",") - .to_string(), - )]), - }; - } - if let Some(ref param_value) = p_query_managed__isnull { - req_builder = req_builder.query(&[("managed__isnull", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_name { - req_builder = req_builder.query(&[("name", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_ordering { - req_builder = req_builder.query(&[("ordering", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_page { - req_builder = req_builder.query(&[("page", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_page_size { - req_builder = req_builder.query(&[("page_size", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_search { - req_builder = req_builder.query(&[("search", ¶m_value.to_string())]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::PaginatedPlexSourcePropertyMappingList`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::PaginatedPlexSourcePropertyMappingList`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// PlexSourcePropertyMapping Viewset -pub async fn propertymappings_source_plex_partial_update( - configuration: &configuration::Configuration, - pm_uuid: &str, - patched_plex_source_property_mapping_request: Option< - models::PatchedPlexSourcePropertyMappingRequest, - >, -) -> Result> -{ - // add a prefix to parameters to efficiently prevent name collisions - let p_path_pm_uuid = pm_uuid; - let p_body_patched_plex_source_property_mapping_request = - patched_plex_source_property_mapping_request; - - let uri_str = format!( - "{}/propertymappings/source/plex/{pm_uuid}/", - configuration.base_path, - pm_uuid = crate::apis::urlencode(p_path_pm_uuid) - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::PATCH, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - req_builder = req_builder.json(&p_body_patched_plex_source_property_mapping_request); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::PlexSourcePropertyMapping`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::PlexSourcePropertyMapping`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// PlexSourcePropertyMapping Viewset -pub async fn propertymappings_source_plex_retrieve( - configuration: &configuration::Configuration, - pm_uuid: &str, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_pm_uuid = pm_uuid; - - let uri_str = format!( - "{}/propertymappings/source/plex/{pm_uuid}/", - configuration.base_path, - pm_uuid = crate::apis::urlencode(p_path_pm_uuid) - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::PlexSourcePropertyMapping`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::PlexSourcePropertyMapping`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// PlexSourcePropertyMapping Viewset -pub async fn propertymappings_source_plex_update( - configuration: &configuration::Configuration, - pm_uuid: &str, - plex_source_property_mapping_request: models::PlexSourcePropertyMappingRequest, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_pm_uuid = pm_uuid; - let p_body_plex_source_property_mapping_request = plex_source_property_mapping_request; - - let uri_str = format!( - "{}/propertymappings/source/plex/{pm_uuid}/", - configuration.base_path, - pm_uuid = crate::apis::urlencode(p_path_pm_uuid) - ); - let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - req_builder = req_builder.json(&p_body_plex_source_property_mapping_request); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::PlexSourcePropertyMapping`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::PlexSourcePropertyMapping`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Get a list of all objects that use this object -pub async fn propertymappings_source_plex_used_by_list( - configuration: &configuration::Configuration, - pm_uuid: &str, -) -> Result, Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_pm_uuid = pm_uuid; - - let uri_str = format!( - "{}/propertymappings/source/plex/{pm_uuid}/used_by/", - configuration.base_path, - pm_uuid = crate::apis::urlencode(p_path_pm_uuid) - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `Vec<models::UsedBy>`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `Vec<models::UsedBy>`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// SAMLSourcePropertyMapping Viewset -pub async fn propertymappings_source_saml_create( - configuration: &configuration::Configuration, - saml_source_property_mapping_request: models::SamlSourcePropertyMappingRequest, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_body_saml_source_property_mapping_request = saml_source_property_mapping_request; - - let uri_str = format!("{}/propertymappings/source/saml/", configuration.base_path); - let mut req_builder = configuration - .client - .request(reqwest::Method::POST, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - req_builder = req_builder.json(&p_body_saml_source_property_mapping_request); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::SamlSourcePropertyMapping`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::SamlSourcePropertyMapping`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// SAMLSourcePropertyMapping Viewset -pub async fn propertymappings_source_saml_destroy( - configuration: &configuration::Configuration, - pm_uuid: &str, -) -> Result<(), Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_pm_uuid = pm_uuid; - - let uri_str = format!( - "{}/propertymappings/source/saml/{pm_uuid}/", - configuration.base_path, - pm_uuid = crate::apis::urlencode(p_path_pm_uuid) - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::DELETE, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - - if !status.is_client_error() && !status.is_server_error() { - Ok(()) - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// SAMLSourcePropertyMapping Viewset -pub async fn propertymappings_source_saml_list( - configuration: &configuration::Configuration, - managed: Option>, - managed__isnull: Option, - name: Option<&str>, - ordering: Option<&str>, - page: Option, - page_size: Option, - search: Option<&str>, -) -> Result< - models::PaginatedSamlSourcePropertyMappingList, - Error, -> { - // add a prefix to parameters to efficiently prevent name collisions - let p_query_managed = managed; - let p_query_managed__isnull = managed__isnull; - let p_query_name = name; - let p_query_ordering = ordering; - let p_query_page = page; - let p_query_page_size = page_size; - let p_query_search = search; - - let uri_str = format!("{}/propertymappings/source/saml/", configuration.base_path); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref param_value) = p_query_managed { - req_builder = match "multi" { - "multi" => req_builder.query( - ¶m_value - .into_iter() - .map(|p| ("managed".to_owned(), p.to_string())) - .collect::>(), - ), - _ => req_builder.query(&[( - "managed", - ¶m_value - .into_iter() - .map(|p| p.to_string()) - .collect::>() - .join(",") - .to_string(), - )]), - }; - } - if let Some(ref param_value) = p_query_managed__isnull { - req_builder = req_builder.query(&[("managed__isnull", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_name { - req_builder = req_builder.query(&[("name", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_ordering { - req_builder = req_builder.query(&[("ordering", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_page { - req_builder = req_builder.query(&[("page", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_page_size { - req_builder = req_builder.query(&[("page_size", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_search { - req_builder = req_builder.query(&[("search", ¶m_value.to_string())]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::PaginatedSamlSourcePropertyMappingList`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::PaginatedSamlSourcePropertyMappingList`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// SAMLSourcePropertyMapping Viewset -pub async fn propertymappings_source_saml_partial_update( - configuration: &configuration::Configuration, - pm_uuid: &str, - patched_saml_source_property_mapping_request: Option< - models::PatchedSamlSourcePropertyMappingRequest, - >, -) -> Result> -{ - // add a prefix to parameters to efficiently prevent name collisions - let p_path_pm_uuid = pm_uuid; - let p_body_patched_saml_source_property_mapping_request = - patched_saml_source_property_mapping_request; - - let uri_str = format!( - "{}/propertymappings/source/saml/{pm_uuid}/", - configuration.base_path, - pm_uuid = crate::apis::urlencode(p_path_pm_uuid) - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::PATCH, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - req_builder = req_builder.json(&p_body_patched_saml_source_property_mapping_request); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::SamlSourcePropertyMapping`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::SamlSourcePropertyMapping`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// SAMLSourcePropertyMapping Viewset -pub async fn propertymappings_source_saml_retrieve( - configuration: &configuration::Configuration, - pm_uuid: &str, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_pm_uuid = pm_uuid; - - let uri_str = format!( - "{}/propertymappings/source/saml/{pm_uuid}/", - configuration.base_path, - pm_uuid = crate::apis::urlencode(p_path_pm_uuid) - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::SamlSourcePropertyMapping`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::SamlSourcePropertyMapping`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// SAMLSourcePropertyMapping Viewset -pub async fn propertymappings_source_saml_update( - configuration: &configuration::Configuration, - pm_uuid: &str, - saml_source_property_mapping_request: models::SamlSourcePropertyMappingRequest, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_pm_uuid = pm_uuid; - let p_body_saml_source_property_mapping_request = saml_source_property_mapping_request; - - let uri_str = format!( - "{}/propertymappings/source/saml/{pm_uuid}/", - configuration.base_path, - pm_uuid = crate::apis::urlencode(p_path_pm_uuid) - ); - let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - req_builder = req_builder.json(&p_body_saml_source_property_mapping_request); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::SamlSourcePropertyMapping`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::SamlSourcePropertyMapping`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Get a list of all objects that use this object -pub async fn propertymappings_source_saml_used_by_list( - configuration: &configuration::Configuration, - pm_uuid: &str, -) -> Result, Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_pm_uuid = pm_uuid; - - let uri_str = format!( - "{}/propertymappings/source/saml/{pm_uuid}/used_by/", - configuration.base_path, - pm_uuid = crate::apis::urlencode(p_path_pm_uuid) - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `Vec<models::UsedBy>`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `Vec<models::UsedBy>`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// SCIMSourcePropertyMapping Viewset -pub async fn propertymappings_source_scim_create( - configuration: &configuration::Configuration, - scim_source_property_mapping_request: models::ScimSourcePropertyMappingRequest, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_body_scim_source_property_mapping_request = scim_source_property_mapping_request; - - let uri_str = format!("{}/propertymappings/source/scim/", configuration.base_path); - let mut req_builder = configuration - .client - .request(reqwest::Method::POST, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - req_builder = req_builder.json(&p_body_scim_source_property_mapping_request); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::ScimSourcePropertyMapping`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::ScimSourcePropertyMapping`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// SCIMSourcePropertyMapping Viewset -pub async fn propertymappings_source_scim_destroy( - configuration: &configuration::Configuration, - pm_uuid: &str, -) -> Result<(), Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_pm_uuid = pm_uuid; - - let uri_str = format!( - "{}/propertymappings/source/scim/{pm_uuid}/", - configuration.base_path, - pm_uuid = crate::apis::urlencode(p_path_pm_uuid) - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::DELETE, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - - if !status.is_client_error() && !status.is_server_error() { - Ok(()) - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// SCIMSourcePropertyMapping Viewset -pub async fn propertymappings_source_scim_list( - configuration: &configuration::Configuration, - managed: Option>, - managed__isnull: Option, - name: Option<&str>, - ordering: Option<&str>, - page: Option, - page_size: Option, - search: Option<&str>, -) -> Result< - models::PaginatedScimSourcePropertyMappingList, - Error, -> { - // add a prefix to parameters to efficiently prevent name collisions - let p_query_managed = managed; - let p_query_managed__isnull = managed__isnull; - let p_query_name = name; - let p_query_ordering = ordering; - let p_query_page = page; - let p_query_page_size = page_size; - let p_query_search = search; - - let uri_str = format!("{}/propertymappings/source/scim/", configuration.base_path); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref param_value) = p_query_managed { - req_builder = match "multi" { - "multi" => req_builder.query( - ¶m_value - .into_iter() - .map(|p| ("managed".to_owned(), p.to_string())) - .collect::>(), - ), - _ => req_builder.query(&[( - "managed", - ¶m_value - .into_iter() - .map(|p| p.to_string()) - .collect::>() - .join(",") - .to_string(), - )]), - }; - } - if let Some(ref param_value) = p_query_managed__isnull { - req_builder = req_builder.query(&[("managed__isnull", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_name { - req_builder = req_builder.query(&[("name", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_ordering { - req_builder = req_builder.query(&[("ordering", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_page { - req_builder = req_builder.query(&[("page", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_page_size { - req_builder = req_builder.query(&[("page_size", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_search { - req_builder = req_builder.query(&[("search", ¶m_value.to_string())]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::PaginatedScimSourcePropertyMappingList`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::PaginatedScimSourcePropertyMappingList`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// SCIMSourcePropertyMapping Viewset -pub async fn propertymappings_source_scim_partial_update( - configuration: &configuration::Configuration, - pm_uuid: &str, - patched_scim_source_property_mapping_request: Option< - models::PatchedScimSourcePropertyMappingRequest, - >, -) -> Result> -{ - // add a prefix to parameters to efficiently prevent name collisions - let p_path_pm_uuid = pm_uuid; - let p_body_patched_scim_source_property_mapping_request = - patched_scim_source_property_mapping_request; - - let uri_str = format!( - "{}/propertymappings/source/scim/{pm_uuid}/", - configuration.base_path, - pm_uuid = crate::apis::urlencode(p_path_pm_uuid) - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::PATCH, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - req_builder = req_builder.json(&p_body_patched_scim_source_property_mapping_request); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::ScimSourcePropertyMapping`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::ScimSourcePropertyMapping`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// SCIMSourcePropertyMapping Viewset -pub async fn propertymappings_source_scim_retrieve( - configuration: &configuration::Configuration, - pm_uuid: &str, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_pm_uuid = pm_uuid; - - let uri_str = format!( - "{}/propertymappings/source/scim/{pm_uuid}/", - configuration.base_path, - pm_uuid = crate::apis::urlencode(p_path_pm_uuid) - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::ScimSourcePropertyMapping`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::ScimSourcePropertyMapping`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// SCIMSourcePropertyMapping Viewset -pub async fn propertymappings_source_scim_update( - configuration: &configuration::Configuration, - pm_uuid: &str, - scim_source_property_mapping_request: models::ScimSourcePropertyMappingRequest, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_pm_uuid = pm_uuid; - let p_body_scim_source_property_mapping_request = scim_source_property_mapping_request; - - let uri_str = format!( - "{}/propertymappings/source/scim/{pm_uuid}/", - configuration.base_path, - pm_uuid = crate::apis::urlencode(p_path_pm_uuid) - ); - let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - req_builder = req_builder.json(&p_body_scim_source_property_mapping_request); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::ScimSourcePropertyMapping`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::ScimSourcePropertyMapping`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Get a list of all objects that use this object -pub async fn propertymappings_source_scim_used_by_list( - configuration: &configuration::Configuration, - pm_uuid: &str, -) -> Result, Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_pm_uuid = pm_uuid; - - let uri_str = format!( - "{}/propertymappings/source/scim/{pm_uuid}/used_by/", - configuration.base_path, - pm_uuid = crate::apis::urlencode(p_path_pm_uuid) - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `Vec<models::UsedBy>`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `Vec<models::UsedBy>`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// TelegramSourcePropertyMapping Viewset -pub async fn propertymappings_source_telegram_create( - configuration: &configuration::Configuration, - telegram_source_property_mapping_request: models::TelegramSourcePropertyMappingRequest, -) -> Result> -{ - // add a prefix to parameters to efficiently prevent name collisions - let p_body_telegram_source_property_mapping_request = telegram_source_property_mapping_request; - - let uri_str = format!( - "{}/propertymappings/source/telegram/", - configuration.base_path - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::POST, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - req_builder = req_builder.json(&p_body_telegram_source_property_mapping_request); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::TelegramSourcePropertyMapping`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::TelegramSourcePropertyMapping`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// TelegramSourcePropertyMapping Viewset -pub async fn propertymappings_source_telegram_destroy( - configuration: &configuration::Configuration, - pm_uuid: &str, -) -> Result<(), Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_pm_uuid = pm_uuid; - - let uri_str = format!( - "{}/propertymappings/source/telegram/{pm_uuid}/", - configuration.base_path, - pm_uuid = crate::apis::urlencode(p_path_pm_uuid) - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::DELETE, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - - if !status.is_client_error() && !status.is_server_error() { - Ok(()) - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// TelegramSourcePropertyMapping Viewset -pub async fn propertymappings_source_telegram_list( - configuration: &configuration::Configuration, - managed: Option>, - managed__isnull: Option, - name: Option<&str>, - ordering: Option<&str>, - page: Option, - page_size: Option, - search: Option<&str>, -) -> Result< - models::PaginatedTelegramSourcePropertyMappingList, - Error, -> { - // add a prefix to parameters to efficiently prevent name collisions - let p_query_managed = managed; - let p_query_managed__isnull = managed__isnull; - let p_query_name = name; - let p_query_ordering = ordering; - let p_query_page = page; - let p_query_page_size = page_size; - let p_query_search = search; - - let uri_str = format!( - "{}/propertymappings/source/telegram/", - configuration.base_path - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref param_value) = p_query_managed { - req_builder = match "multi" { - "multi" => req_builder.query( - ¶m_value - .into_iter() - .map(|p| ("managed".to_owned(), p.to_string())) - .collect::>(), - ), - _ => req_builder.query(&[( - "managed", - ¶m_value - .into_iter() - .map(|p| p.to_string()) - .collect::>() - .join(",") - .to_string(), - )]), - }; - } - if let Some(ref param_value) = p_query_managed__isnull { - req_builder = req_builder.query(&[("managed__isnull", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_name { - req_builder = req_builder.query(&[("name", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_ordering { - req_builder = req_builder.query(&[("ordering", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_page { - req_builder = req_builder.query(&[("page", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_page_size { - req_builder = req_builder.query(&[("page_size", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_search { - req_builder = req_builder.query(&[("search", ¶m_value.to_string())]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::PaginatedTelegramSourcePropertyMappingList`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::PaginatedTelegramSourcePropertyMappingList`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// TelegramSourcePropertyMapping Viewset -pub async fn propertymappings_source_telegram_partial_update( - configuration: &configuration::Configuration, - pm_uuid: &str, - patched_telegram_source_property_mapping_request: Option< - models::PatchedTelegramSourcePropertyMappingRequest, - >, -) -> Result< - models::TelegramSourcePropertyMapping, - Error, -> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_pm_uuid = pm_uuid; - let p_body_patched_telegram_source_property_mapping_request = - patched_telegram_source_property_mapping_request; - - let uri_str = format!( - "{}/propertymappings/source/telegram/{pm_uuid}/", - configuration.base_path, - pm_uuid = crate::apis::urlencode(p_path_pm_uuid) - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::PATCH, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - req_builder = req_builder.json(&p_body_patched_telegram_source_property_mapping_request); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::TelegramSourcePropertyMapping`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::TelegramSourcePropertyMapping`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// TelegramSourcePropertyMapping Viewset -pub async fn propertymappings_source_telegram_retrieve( - configuration: &configuration::Configuration, - pm_uuid: &str, -) -> Result> -{ - // add a prefix to parameters to efficiently prevent name collisions - let p_path_pm_uuid = pm_uuid; - - let uri_str = format!( - "{}/propertymappings/source/telegram/{pm_uuid}/", - configuration.base_path, - pm_uuid = crate::apis::urlencode(p_path_pm_uuid) - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::TelegramSourcePropertyMapping`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::TelegramSourcePropertyMapping`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// TelegramSourcePropertyMapping Viewset -pub async fn propertymappings_source_telegram_update( - configuration: &configuration::Configuration, - pm_uuid: &str, - telegram_source_property_mapping_request: models::TelegramSourcePropertyMappingRequest, -) -> Result> -{ - // add a prefix to parameters to efficiently prevent name collisions - let p_path_pm_uuid = pm_uuid; - let p_body_telegram_source_property_mapping_request = telegram_source_property_mapping_request; - - let uri_str = format!( - "{}/propertymappings/source/telegram/{pm_uuid}/", - configuration.base_path, - pm_uuid = crate::apis::urlencode(p_path_pm_uuid) - ); - let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - req_builder = req_builder.json(&p_body_telegram_source_property_mapping_request); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::TelegramSourcePropertyMapping`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::TelegramSourcePropertyMapping`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Get a list of all objects that use this object -pub async fn propertymappings_source_telegram_used_by_list( - configuration: &configuration::Configuration, - pm_uuid: &str, -) -> Result, Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_pm_uuid = pm_uuid; - - let uri_str = format!( - "{}/propertymappings/source/telegram/{pm_uuid}/used_by/", - configuration.base_path, - pm_uuid = crate::apis::urlencode(p_path_pm_uuid) - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `Vec<models::UsedBy>`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `Vec<models::UsedBy>`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} diff --git a/packages/client-rust/src/apis/providers_api.rs b/packages/client-rust/src/apis/providers_api.rs deleted file mode 100644 index cdc5d8a94a..0000000000 --- a/packages/client-rust/src/apis/providers_api.rs +++ /dev/null @@ -1,9690 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use reqwest; -use serde::{Deserialize, Serialize, de::Error as _}; -use tokio::fs::File as TokioFile; -use tokio_util::codec::{BytesCodec, FramedRead}; - -use super::{ContentType, Error, configuration}; -use crate::{apis::ResponseContent, models}; - -/// struct for typed errors of method [`providers_all_destroy`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum ProvidersAllDestroyError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`providers_all_list`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum ProvidersAllListError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`providers_all_retrieve`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum ProvidersAllRetrieveError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`providers_all_types_list`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum ProvidersAllTypesListError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`providers_all_used_by_list`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum ProvidersAllUsedByListError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`providers_google_workspace_create`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum ProvidersGoogleWorkspaceCreateError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`providers_google_workspace_destroy`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum ProvidersGoogleWorkspaceDestroyError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`providers_google_workspace_groups_create`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum ProvidersGoogleWorkspaceGroupsCreateError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`providers_google_workspace_groups_destroy`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum ProvidersGoogleWorkspaceGroupsDestroyError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`providers_google_workspace_groups_list`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum ProvidersGoogleWorkspaceGroupsListError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`providers_google_workspace_groups_retrieve`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum ProvidersGoogleWorkspaceGroupsRetrieveError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`providers_google_workspace_groups_used_by_list`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum ProvidersGoogleWorkspaceGroupsUsedByListError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`providers_google_workspace_list`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum ProvidersGoogleWorkspaceListError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`providers_google_workspace_partial_update`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum ProvidersGoogleWorkspacePartialUpdateError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`providers_google_workspace_retrieve`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum ProvidersGoogleWorkspaceRetrieveError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`providers_google_workspace_sync_object_create`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum ProvidersGoogleWorkspaceSyncObjectCreateError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`providers_google_workspace_sync_status_retrieve`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum ProvidersGoogleWorkspaceSyncStatusRetrieveError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`providers_google_workspace_update`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum ProvidersGoogleWorkspaceUpdateError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`providers_google_workspace_used_by_list`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum ProvidersGoogleWorkspaceUsedByListError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`providers_google_workspace_users_create`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum ProvidersGoogleWorkspaceUsersCreateError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`providers_google_workspace_users_destroy`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum ProvidersGoogleWorkspaceUsersDestroyError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`providers_google_workspace_users_list`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum ProvidersGoogleWorkspaceUsersListError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`providers_google_workspace_users_retrieve`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum ProvidersGoogleWorkspaceUsersRetrieveError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`providers_google_workspace_users_used_by_list`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum ProvidersGoogleWorkspaceUsersUsedByListError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`providers_ldap_create`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum ProvidersLdapCreateError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`providers_ldap_destroy`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum ProvidersLdapDestroyError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`providers_ldap_list`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum ProvidersLdapListError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`providers_ldap_partial_update`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum ProvidersLdapPartialUpdateError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`providers_ldap_retrieve`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum ProvidersLdapRetrieveError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`providers_ldap_update`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum ProvidersLdapUpdateError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`providers_ldap_used_by_list`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum ProvidersLdapUsedByListError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`providers_microsoft_entra_create`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum ProvidersMicrosoftEntraCreateError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`providers_microsoft_entra_destroy`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum ProvidersMicrosoftEntraDestroyError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`providers_microsoft_entra_groups_create`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum ProvidersMicrosoftEntraGroupsCreateError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`providers_microsoft_entra_groups_destroy`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum ProvidersMicrosoftEntraGroupsDestroyError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`providers_microsoft_entra_groups_list`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum ProvidersMicrosoftEntraGroupsListError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`providers_microsoft_entra_groups_retrieve`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum ProvidersMicrosoftEntraGroupsRetrieveError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`providers_microsoft_entra_groups_used_by_list`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum ProvidersMicrosoftEntraGroupsUsedByListError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`providers_microsoft_entra_list`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum ProvidersMicrosoftEntraListError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`providers_microsoft_entra_partial_update`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum ProvidersMicrosoftEntraPartialUpdateError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`providers_microsoft_entra_retrieve`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum ProvidersMicrosoftEntraRetrieveError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`providers_microsoft_entra_sync_object_create`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum ProvidersMicrosoftEntraSyncObjectCreateError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`providers_microsoft_entra_sync_status_retrieve`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum ProvidersMicrosoftEntraSyncStatusRetrieveError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`providers_microsoft_entra_update`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum ProvidersMicrosoftEntraUpdateError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`providers_microsoft_entra_used_by_list`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum ProvidersMicrosoftEntraUsedByListError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`providers_microsoft_entra_users_create`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum ProvidersMicrosoftEntraUsersCreateError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`providers_microsoft_entra_users_destroy`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum ProvidersMicrosoftEntraUsersDestroyError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`providers_microsoft_entra_users_list`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum ProvidersMicrosoftEntraUsersListError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`providers_microsoft_entra_users_retrieve`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum ProvidersMicrosoftEntraUsersRetrieveError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`providers_microsoft_entra_users_used_by_list`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum ProvidersMicrosoftEntraUsersUsedByListError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`providers_oauth2_create`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum ProvidersOauth2CreateError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`providers_oauth2_destroy`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum ProvidersOauth2DestroyError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`providers_oauth2_list`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum ProvidersOauth2ListError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`providers_oauth2_partial_update`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum ProvidersOauth2PartialUpdateError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`providers_oauth2_preview_user_retrieve`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum ProvidersOauth2PreviewUserRetrieveError { - Status400(), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`providers_oauth2_retrieve`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum ProvidersOauth2RetrieveError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`providers_oauth2_setup_urls_retrieve`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum ProvidersOauth2SetupUrlsRetrieveError { - Status404(), - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`providers_oauth2_update`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum ProvidersOauth2UpdateError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`providers_oauth2_used_by_list`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum ProvidersOauth2UsedByListError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`providers_proxy_create`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum ProvidersProxyCreateError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`providers_proxy_destroy`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum ProvidersProxyDestroyError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`providers_proxy_list`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum ProvidersProxyListError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`providers_proxy_partial_update`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum ProvidersProxyPartialUpdateError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`providers_proxy_retrieve`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum ProvidersProxyRetrieveError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`providers_proxy_update`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum ProvidersProxyUpdateError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`providers_proxy_used_by_list`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum ProvidersProxyUsedByListError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`providers_rac_create`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum ProvidersRacCreateError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`providers_rac_destroy`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum ProvidersRacDestroyError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`providers_rac_list`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum ProvidersRacListError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`providers_rac_partial_update`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum ProvidersRacPartialUpdateError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`providers_rac_retrieve`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum ProvidersRacRetrieveError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`providers_rac_update`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum ProvidersRacUpdateError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`providers_rac_used_by_list`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum ProvidersRacUsedByListError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`providers_radius_create`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum ProvidersRadiusCreateError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`providers_radius_destroy`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum ProvidersRadiusDestroyError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`providers_radius_list`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum ProvidersRadiusListError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`providers_radius_partial_update`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum ProvidersRadiusPartialUpdateError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`providers_radius_retrieve`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum ProvidersRadiusRetrieveError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`providers_radius_update`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum ProvidersRadiusUpdateError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`providers_radius_used_by_list`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum ProvidersRadiusUsedByListError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`providers_saml_create`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum ProvidersSamlCreateError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`providers_saml_destroy`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum ProvidersSamlDestroyError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`providers_saml_import_metadata_create`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum ProvidersSamlImportMetadataCreateError { - Status400(), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`providers_saml_list`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum ProvidersSamlListError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`providers_saml_metadata_retrieve`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum ProvidersSamlMetadataRetrieveError { - Status404(), - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`providers_saml_partial_update`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum ProvidersSamlPartialUpdateError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`providers_saml_preview_user_retrieve`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum ProvidersSamlPreviewUserRetrieveError { - Status400(), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`providers_saml_retrieve`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum ProvidersSamlRetrieveError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`providers_saml_update`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum ProvidersSamlUpdateError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`providers_saml_used_by_list`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum ProvidersSamlUsedByListError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`providers_scim_create`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum ProvidersScimCreateError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`providers_scim_destroy`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum ProvidersScimDestroyError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`providers_scim_groups_create`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum ProvidersScimGroupsCreateError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`providers_scim_groups_destroy`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum ProvidersScimGroupsDestroyError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`providers_scim_groups_list`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum ProvidersScimGroupsListError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`providers_scim_groups_retrieve`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum ProvidersScimGroupsRetrieveError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`providers_scim_groups_used_by_list`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum ProvidersScimGroupsUsedByListError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`providers_scim_list`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum ProvidersScimListError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`providers_scim_partial_update`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum ProvidersScimPartialUpdateError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`providers_scim_retrieve`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum ProvidersScimRetrieveError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`providers_scim_sync_object_create`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum ProvidersScimSyncObjectCreateError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`providers_scim_sync_status_retrieve`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum ProvidersScimSyncStatusRetrieveError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`providers_scim_update`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum ProvidersScimUpdateError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`providers_scim_used_by_list`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum ProvidersScimUsedByListError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`providers_scim_users_create`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum ProvidersScimUsersCreateError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`providers_scim_users_destroy`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum ProvidersScimUsersDestroyError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`providers_scim_users_list`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum ProvidersScimUsersListError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`providers_scim_users_retrieve`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum ProvidersScimUsersRetrieveError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`providers_scim_users_used_by_list`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum ProvidersScimUsersUsedByListError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`providers_ssf_create`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum ProvidersSsfCreateError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`providers_ssf_destroy`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum ProvidersSsfDestroyError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`providers_ssf_list`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum ProvidersSsfListError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`providers_ssf_partial_update`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum ProvidersSsfPartialUpdateError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`providers_ssf_retrieve`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum ProvidersSsfRetrieveError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`providers_ssf_update`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum ProvidersSsfUpdateError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`providers_ssf_used_by_list`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum ProvidersSsfUsedByListError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`providers_wsfed_create`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum ProvidersWsfedCreateError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`providers_wsfed_destroy`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum ProvidersWsfedDestroyError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`providers_wsfed_list`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum ProvidersWsfedListError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`providers_wsfed_metadata_retrieve`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum ProvidersWsfedMetadataRetrieveError { - Status404(), - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`providers_wsfed_partial_update`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum ProvidersWsfedPartialUpdateError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`providers_wsfed_preview_user_retrieve`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum ProvidersWsfedPreviewUserRetrieveError { - Status400(), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`providers_wsfed_retrieve`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum ProvidersWsfedRetrieveError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`providers_wsfed_update`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum ProvidersWsfedUpdateError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`providers_wsfed_used_by_list`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum ProvidersWsfedUsedByListError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// Provider Viewset -pub async fn providers_all_destroy( - configuration: &configuration::Configuration, - id: i32, -) -> Result<(), Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_id = id; - - let uri_str = format!( - "{}/providers/all/{id}/", - configuration.base_path, - id = p_path_id - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::DELETE, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - - if !status.is_client_error() && !status.is_server_error() { - Ok(()) - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Provider Viewset -pub async fn providers_all_list( - configuration: &configuration::Configuration, - application__isnull: Option, - backchannel: Option, - ordering: Option<&str>, - page: Option, - page_size: Option, - search: Option<&str>, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_query_application__isnull = application__isnull; - let p_query_backchannel = backchannel; - let p_query_ordering = ordering; - let p_query_page = page; - let p_query_page_size = page_size; - let p_query_search = search; - - let uri_str = format!("{}/providers/all/", configuration.base_path); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref param_value) = p_query_application__isnull { - req_builder = req_builder.query(&[("application__isnull", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_backchannel { - req_builder = req_builder.query(&[("backchannel", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_ordering { - req_builder = req_builder.query(&[("ordering", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_page { - req_builder = req_builder.query(&[("page", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_page_size { - req_builder = req_builder.query(&[("page_size", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_search { - req_builder = req_builder.query(&[("search", ¶m_value.to_string())]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::PaginatedProviderList`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::PaginatedProviderList`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Provider Viewset -pub async fn providers_all_retrieve( - configuration: &configuration::Configuration, - id: i32, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_id = id; - - let uri_str = format!( - "{}/providers/all/{id}/", - configuration.base_path, - id = p_path_id - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::Provider`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::Provider`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Get all creatable types -pub async fn providers_all_types_list( - configuration: &configuration::Configuration, -) -> Result, Error> { - let uri_str = format!("{}/providers/all/types/", configuration.base_path); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `Vec<models::TypeCreate>`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `Vec<models::TypeCreate>`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Get a list of all objects that use this object -pub async fn providers_all_used_by_list( - configuration: &configuration::Configuration, - id: i32, -) -> Result, Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_id = id; - - let uri_str = format!( - "{}/providers/all/{id}/used_by/", - configuration.base_path, - id = p_path_id - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `Vec<models::UsedBy>`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `Vec<models::UsedBy>`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// GoogleWorkspaceProvider Viewset -pub async fn providers_google_workspace_create( - configuration: &configuration::Configuration, - google_workspace_provider_request: models::GoogleWorkspaceProviderRequest, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_body_google_workspace_provider_request = google_workspace_provider_request; - - let uri_str = format!("{}/providers/google_workspace/", configuration.base_path); - let mut req_builder = configuration - .client - .request(reqwest::Method::POST, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - req_builder = req_builder.json(&p_body_google_workspace_provider_request); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::GoogleWorkspaceProvider`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::GoogleWorkspaceProvider`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// GoogleWorkspaceProvider Viewset -pub async fn providers_google_workspace_destroy( - configuration: &configuration::Configuration, - id: i32, -) -> Result<(), Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_id = id; - - let uri_str = format!( - "{}/providers/google_workspace/{id}/", - configuration.base_path, - id = p_path_id - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::DELETE, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - - if !status.is_client_error() && !status.is_server_error() { - Ok(()) - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// GoogleWorkspaceProviderGroup Viewset -pub async fn providers_google_workspace_groups_create( - configuration: &configuration::Configuration, - google_workspace_provider_group_request: models::GoogleWorkspaceProviderGroupRequest, -) -> Result> -{ - // add a prefix to parameters to efficiently prevent name collisions - let p_body_google_workspace_provider_group_request = google_workspace_provider_group_request; - - let uri_str = format!( - "{}/providers/google_workspace_groups/", - configuration.base_path - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::POST, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - req_builder = req_builder.json(&p_body_google_workspace_provider_group_request); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::GoogleWorkspaceProviderGroup`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::GoogleWorkspaceProviderGroup`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// GoogleWorkspaceProviderGroup Viewset -pub async fn providers_google_workspace_groups_destroy( - configuration: &configuration::Configuration, - id: &str, -) -> Result<(), Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_id = id; - - let uri_str = format!( - "{}/providers/google_workspace_groups/{id}/", - configuration.base_path, - id = crate::apis::urlencode(p_path_id) - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::DELETE, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - - if !status.is_client_error() && !status.is_server_error() { - Ok(()) - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// GoogleWorkspaceProviderGroup Viewset -pub async fn providers_google_workspace_groups_list( - configuration: &configuration::Configuration, - group__group_uuid: Option<&str>, - group__name: Option<&str>, - ordering: Option<&str>, - page: Option, - page_size: Option, - provider__id: Option, - search: Option<&str>, -) -> Result< - models::PaginatedGoogleWorkspaceProviderGroupList, - Error, -> { - // add a prefix to parameters to efficiently prevent name collisions - let p_query_group__group_uuid = group__group_uuid; - let p_query_group__name = group__name; - let p_query_ordering = ordering; - let p_query_page = page; - let p_query_page_size = page_size; - let p_query_provider__id = provider__id; - let p_query_search = search; - - let uri_str = format!( - "{}/providers/google_workspace_groups/", - configuration.base_path - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref param_value) = p_query_group__group_uuid { - req_builder = req_builder.query(&[("group__group_uuid", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_group__name { - req_builder = req_builder.query(&[("group__name", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_ordering { - req_builder = req_builder.query(&[("ordering", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_page { - req_builder = req_builder.query(&[("page", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_page_size { - req_builder = req_builder.query(&[("page_size", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_provider__id { - req_builder = req_builder.query(&[("provider__id", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_search { - req_builder = req_builder.query(&[("search", ¶m_value.to_string())]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::PaginatedGoogleWorkspaceProviderGroupList`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::PaginatedGoogleWorkspaceProviderGroupList`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// GoogleWorkspaceProviderGroup Viewset -pub async fn providers_google_workspace_groups_retrieve( - configuration: &configuration::Configuration, - id: &str, -) -> Result> -{ - // add a prefix to parameters to efficiently prevent name collisions - let p_path_id = id; - - let uri_str = format!( - "{}/providers/google_workspace_groups/{id}/", - configuration.base_path, - id = crate::apis::urlencode(p_path_id) - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::GoogleWorkspaceProviderGroup`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::GoogleWorkspaceProviderGroup`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Get a list of all objects that use this object -pub async fn providers_google_workspace_groups_used_by_list( - configuration: &configuration::Configuration, - id: &str, -) -> Result, Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_id = id; - - let uri_str = format!( - "{}/providers/google_workspace_groups/{id}/used_by/", - configuration.base_path, - id = crate::apis::urlencode(p_path_id) - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `Vec<models::UsedBy>`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `Vec<models::UsedBy>`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// GoogleWorkspaceProvider Viewset -pub async fn providers_google_workspace_list( - configuration: &configuration::Configuration, - delegated_subject: Option<&str>, - exclude_users_service_account: Option, - filter_group: Option<&str>, - name: Option<&str>, - ordering: Option<&str>, - page: Option, - page_size: Option, - search: Option<&str>, -) -> Result> -{ - // add a prefix to parameters to efficiently prevent name collisions - let p_query_delegated_subject = delegated_subject; - let p_query_exclude_users_service_account = exclude_users_service_account; - let p_query_filter_group = filter_group; - let p_query_name = name; - let p_query_ordering = ordering; - let p_query_page = page; - let p_query_page_size = page_size; - let p_query_search = search; - - let uri_str = format!("{}/providers/google_workspace/", configuration.base_path); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref param_value) = p_query_delegated_subject { - req_builder = req_builder.query(&[("delegated_subject", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_exclude_users_service_account { - req_builder = - req_builder.query(&[("exclude_users_service_account", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_filter_group { - req_builder = req_builder.query(&[("filter_group", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_name { - req_builder = req_builder.query(&[("name", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_ordering { - req_builder = req_builder.query(&[("ordering", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_page { - req_builder = req_builder.query(&[("page", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_page_size { - req_builder = req_builder.query(&[("page_size", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_search { - req_builder = req_builder.query(&[("search", ¶m_value.to_string())]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::PaginatedGoogleWorkspaceProviderList`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::PaginatedGoogleWorkspaceProviderList`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// GoogleWorkspaceProvider Viewset -pub async fn providers_google_workspace_partial_update( - configuration: &configuration::Configuration, - id: i32, - patched_google_workspace_provider_request: Option< - models::PatchedGoogleWorkspaceProviderRequest, - >, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_id = id; - let p_body_patched_google_workspace_provider_request = - patched_google_workspace_provider_request; - - let uri_str = format!( - "{}/providers/google_workspace/{id}/", - configuration.base_path, - id = p_path_id - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::PATCH, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - req_builder = req_builder.json(&p_body_patched_google_workspace_provider_request); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::GoogleWorkspaceProvider`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::GoogleWorkspaceProvider`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// GoogleWorkspaceProvider Viewset -pub async fn providers_google_workspace_retrieve( - configuration: &configuration::Configuration, - id: i32, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_id = id; - - let uri_str = format!( - "{}/providers/google_workspace/{id}/", - configuration.base_path, - id = p_path_id - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::GoogleWorkspaceProvider`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::GoogleWorkspaceProvider`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Sync/Re-sync a single user/group object -pub async fn providers_google_workspace_sync_object_create( - configuration: &configuration::Configuration, - id: i32, - sync_object_request: models::SyncObjectRequest, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_id = id; - let p_body_sync_object_request = sync_object_request; - - let uri_str = format!( - "{}/providers/google_workspace/{id}/sync/object/", - configuration.base_path, - id = p_path_id - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::POST, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - req_builder = req_builder.json(&p_body_sync_object_request); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::SyncObjectResult`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::SyncObjectResult`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Get provider's sync status -pub async fn providers_google_workspace_sync_status_retrieve( - configuration: &configuration::Configuration, - id: i32, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_id = id; - - let uri_str = format!( - "{}/providers/google_workspace/{id}/sync/status/", - configuration.base_path, - id = p_path_id - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::SyncStatus`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::SyncStatus`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// GoogleWorkspaceProvider Viewset -pub async fn providers_google_workspace_update( - configuration: &configuration::Configuration, - id: i32, - google_workspace_provider_request: models::GoogleWorkspaceProviderRequest, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_id = id; - let p_body_google_workspace_provider_request = google_workspace_provider_request; - - let uri_str = format!( - "{}/providers/google_workspace/{id}/", - configuration.base_path, - id = p_path_id - ); - let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - req_builder = req_builder.json(&p_body_google_workspace_provider_request); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::GoogleWorkspaceProvider`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::GoogleWorkspaceProvider`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Get a list of all objects that use this object -pub async fn providers_google_workspace_used_by_list( - configuration: &configuration::Configuration, - id: i32, -) -> Result, Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_id = id; - - let uri_str = format!( - "{}/providers/google_workspace/{id}/used_by/", - configuration.base_path, - id = p_path_id - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `Vec<models::UsedBy>`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `Vec<models::UsedBy>`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// GoogleWorkspaceProviderUser Viewset -pub async fn providers_google_workspace_users_create( - configuration: &configuration::Configuration, - google_workspace_provider_user_request: models::GoogleWorkspaceProviderUserRequest, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_body_google_workspace_provider_user_request = google_workspace_provider_user_request; - - let uri_str = format!( - "{}/providers/google_workspace_users/", - configuration.base_path - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::POST, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - req_builder = req_builder.json(&p_body_google_workspace_provider_user_request); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::GoogleWorkspaceProviderUser`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::GoogleWorkspaceProviderUser`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// GoogleWorkspaceProviderUser Viewset -pub async fn providers_google_workspace_users_destroy( - configuration: &configuration::Configuration, - id: &str, -) -> Result<(), Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_id = id; - - let uri_str = format!( - "{}/providers/google_workspace_users/{id}/", - configuration.base_path, - id = crate::apis::urlencode(p_path_id) - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::DELETE, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - - if !status.is_client_error() && !status.is_server_error() { - Ok(()) - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// GoogleWorkspaceProviderUser Viewset -pub async fn providers_google_workspace_users_list( - configuration: &configuration::Configuration, - ordering: Option<&str>, - page: Option, - page_size: Option, - provider__id: Option, - search: Option<&str>, - user__id: Option, - user__username: Option<&str>, -) -> Result< - models::PaginatedGoogleWorkspaceProviderUserList, - Error, -> { - // add a prefix to parameters to efficiently prevent name collisions - let p_query_ordering = ordering; - let p_query_page = page; - let p_query_page_size = page_size; - let p_query_provider__id = provider__id; - let p_query_search = search; - let p_query_user__id = user__id; - let p_query_user__username = user__username; - - let uri_str = format!( - "{}/providers/google_workspace_users/", - configuration.base_path - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref param_value) = p_query_ordering { - req_builder = req_builder.query(&[("ordering", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_page { - req_builder = req_builder.query(&[("page", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_page_size { - req_builder = req_builder.query(&[("page_size", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_provider__id { - req_builder = req_builder.query(&[("provider__id", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_search { - req_builder = req_builder.query(&[("search", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_user__id { - req_builder = req_builder.query(&[("user__id", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_user__username { - req_builder = req_builder.query(&[("user__username", ¶m_value.to_string())]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::PaginatedGoogleWorkspaceProviderUserList`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::PaginatedGoogleWorkspaceProviderUserList`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// GoogleWorkspaceProviderUser Viewset -pub async fn providers_google_workspace_users_retrieve( - configuration: &configuration::Configuration, - id: &str, -) -> Result> -{ - // add a prefix to parameters to efficiently prevent name collisions - let p_path_id = id; - - let uri_str = format!( - "{}/providers/google_workspace_users/{id}/", - configuration.base_path, - id = crate::apis::urlencode(p_path_id) - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::GoogleWorkspaceProviderUser`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::GoogleWorkspaceProviderUser`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Get a list of all objects that use this object -pub async fn providers_google_workspace_users_used_by_list( - configuration: &configuration::Configuration, - id: &str, -) -> Result, Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_id = id; - - let uri_str = format!( - "{}/providers/google_workspace_users/{id}/used_by/", - configuration.base_path, - id = crate::apis::urlencode(p_path_id) - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `Vec<models::UsedBy>`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `Vec<models::UsedBy>`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// LDAPProvider Viewset -pub async fn providers_ldap_create( - configuration: &configuration::Configuration, - ldap_provider_request: models::LdapProviderRequest, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_body_ldap_provider_request = ldap_provider_request; - - let uri_str = format!("{}/providers/ldap/", configuration.base_path); - let mut req_builder = configuration - .client - .request(reqwest::Method::POST, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - req_builder = req_builder.json(&p_body_ldap_provider_request); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::LdapProvider`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::LdapProvider`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// LDAPProvider Viewset -pub async fn providers_ldap_destroy( - configuration: &configuration::Configuration, - id: i32, -) -> Result<(), Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_id = id; - - let uri_str = format!( - "{}/providers/ldap/{id}/", - configuration.base_path, - id = p_path_id - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::DELETE, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - - if !status.is_client_error() && !status.is_server_error() { - Ok(()) - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// LDAPProvider Viewset -pub async fn providers_ldap_list( - configuration: &configuration::Configuration, - application__isnull: Option, - authorization_flow__slug__iexact: Option<&str>, - base_dn__iexact: Option<&str>, - certificate__kp_uuid__iexact: Option<&str>, - certificate__name__iexact: Option<&str>, - gid_start_number__iexact: Option, - name__iexact: Option<&str>, - ordering: Option<&str>, - page: Option, - page_size: Option, - search: Option<&str>, - tls_server_name__iexact: Option<&str>, - uid_start_number__iexact: Option, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_query_application__isnull = application__isnull; - let p_query_authorization_flow__slug__iexact = authorization_flow__slug__iexact; - let p_query_base_dn__iexact = base_dn__iexact; - let p_query_certificate__kp_uuid__iexact = certificate__kp_uuid__iexact; - let p_query_certificate__name__iexact = certificate__name__iexact; - let p_query_gid_start_number__iexact = gid_start_number__iexact; - let p_query_name__iexact = name__iexact; - let p_query_ordering = ordering; - let p_query_page = page; - let p_query_page_size = page_size; - let p_query_search = search; - let p_query_tls_server_name__iexact = tls_server_name__iexact; - let p_query_uid_start_number__iexact = uid_start_number__iexact; - - let uri_str = format!("{}/providers/ldap/", configuration.base_path); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref param_value) = p_query_application__isnull { - req_builder = req_builder.query(&[("application__isnull", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_authorization_flow__slug__iexact { - req_builder = - req_builder.query(&[("authorization_flow__slug__iexact", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_base_dn__iexact { - req_builder = req_builder.query(&[("base_dn__iexact", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_certificate__kp_uuid__iexact { - req_builder = - req_builder.query(&[("certificate__kp_uuid__iexact", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_certificate__name__iexact { - req_builder = req_builder.query(&[("certificate__name__iexact", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_gid_start_number__iexact { - req_builder = req_builder.query(&[("gid_start_number__iexact", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_name__iexact { - req_builder = req_builder.query(&[("name__iexact", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_ordering { - req_builder = req_builder.query(&[("ordering", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_page { - req_builder = req_builder.query(&[("page", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_page_size { - req_builder = req_builder.query(&[("page_size", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_search { - req_builder = req_builder.query(&[("search", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_tls_server_name__iexact { - req_builder = req_builder.query(&[("tls_server_name__iexact", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_uid_start_number__iexact { - req_builder = req_builder.query(&[("uid_start_number__iexact", ¶m_value.to_string())]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::PaginatedLdapProviderList`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::PaginatedLdapProviderList`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// LDAPProvider Viewset -pub async fn providers_ldap_partial_update( - configuration: &configuration::Configuration, - id: i32, - patched_ldap_provider_request: Option, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_id = id; - let p_body_patched_ldap_provider_request = patched_ldap_provider_request; - - let uri_str = format!( - "{}/providers/ldap/{id}/", - configuration.base_path, - id = p_path_id - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::PATCH, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - req_builder = req_builder.json(&p_body_patched_ldap_provider_request); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::LdapProvider`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::LdapProvider`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// LDAPProvider Viewset -pub async fn providers_ldap_retrieve( - configuration: &configuration::Configuration, - id: i32, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_id = id; - - let uri_str = format!( - "{}/providers/ldap/{id}/", - configuration.base_path, - id = p_path_id - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::LdapProvider`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::LdapProvider`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// LDAPProvider Viewset -pub async fn providers_ldap_update( - configuration: &configuration::Configuration, - id: i32, - ldap_provider_request: models::LdapProviderRequest, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_id = id; - let p_body_ldap_provider_request = ldap_provider_request; - - let uri_str = format!( - "{}/providers/ldap/{id}/", - configuration.base_path, - id = p_path_id - ); - let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - req_builder = req_builder.json(&p_body_ldap_provider_request); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::LdapProvider`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::LdapProvider`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Get a list of all objects that use this object -pub async fn providers_ldap_used_by_list( - configuration: &configuration::Configuration, - id: i32, -) -> Result, Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_id = id; - - let uri_str = format!( - "{}/providers/ldap/{id}/used_by/", - configuration.base_path, - id = p_path_id - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `Vec<models::UsedBy>`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `Vec<models::UsedBy>`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// MicrosoftEntraProvider Viewset -pub async fn providers_microsoft_entra_create( - configuration: &configuration::Configuration, - microsoft_entra_provider_request: models::MicrosoftEntraProviderRequest, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_body_microsoft_entra_provider_request = microsoft_entra_provider_request; - - let uri_str = format!("{}/providers/microsoft_entra/", configuration.base_path); - let mut req_builder = configuration - .client - .request(reqwest::Method::POST, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - req_builder = req_builder.json(&p_body_microsoft_entra_provider_request); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::MicrosoftEntraProvider`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::MicrosoftEntraProvider`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// MicrosoftEntraProvider Viewset -pub async fn providers_microsoft_entra_destroy( - configuration: &configuration::Configuration, - id: i32, -) -> Result<(), Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_id = id; - - let uri_str = format!( - "{}/providers/microsoft_entra/{id}/", - configuration.base_path, - id = p_path_id - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::DELETE, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - - if !status.is_client_error() && !status.is_server_error() { - Ok(()) - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// MicrosoftEntraProviderGroup Viewset -pub async fn providers_microsoft_entra_groups_create( - configuration: &configuration::Configuration, - microsoft_entra_provider_group_request: models::MicrosoftEntraProviderGroupRequest, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_body_microsoft_entra_provider_group_request = microsoft_entra_provider_group_request; - - let uri_str = format!( - "{}/providers/microsoft_entra_groups/", - configuration.base_path - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::POST, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - req_builder = req_builder.json(&p_body_microsoft_entra_provider_group_request); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::MicrosoftEntraProviderGroup`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::MicrosoftEntraProviderGroup`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// MicrosoftEntraProviderGroup Viewset -pub async fn providers_microsoft_entra_groups_destroy( - configuration: &configuration::Configuration, - id: &str, -) -> Result<(), Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_id = id; - - let uri_str = format!( - "{}/providers/microsoft_entra_groups/{id}/", - configuration.base_path, - id = crate::apis::urlencode(p_path_id) - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::DELETE, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - - if !status.is_client_error() && !status.is_server_error() { - Ok(()) - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// MicrosoftEntraProviderGroup Viewset -pub async fn providers_microsoft_entra_groups_list( - configuration: &configuration::Configuration, - group__group_uuid: Option<&str>, - group__name: Option<&str>, - ordering: Option<&str>, - page: Option, - page_size: Option, - provider__id: Option, - search: Option<&str>, -) -> Result< - models::PaginatedMicrosoftEntraProviderGroupList, - Error, -> { - // add a prefix to parameters to efficiently prevent name collisions - let p_query_group__group_uuid = group__group_uuid; - let p_query_group__name = group__name; - let p_query_ordering = ordering; - let p_query_page = page; - let p_query_page_size = page_size; - let p_query_provider__id = provider__id; - let p_query_search = search; - - let uri_str = format!( - "{}/providers/microsoft_entra_groups/", - configuration.base_path - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref param_value) = p_query_group__group_uuid { - req_builder = req_builder.query(&[("group__group_uuid", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_group__name { - req_builder = req_builder.query(&[("group__name", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_ordering { - req_builder = req_builder.query(&[("ordering", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_page { - req_builder = req_builder.query(&[("page", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_page_size { - req_builder = req_builder.query(&[("page_size", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_provider__id { - req_builder = req_builder.query(&[("provider__id", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_search { - req_builder = req_builder.query(&[("search", ¶m_value.to_string())]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::PaginatedMicrosoftEntraProviderGroupList`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::PaginatedMicrosoftEntraProviderGroupList`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// MicrosoftEntraProviderGroup Viewset -pub async fn providers_microsoft_entra_groups_retrieve( - configuration: &configuration::Configuration, - id: &str, -) -> Result> -{ - // add a prefix to parameters to efficiently prevent name collisions - let p_path_id = id; - - let uri_str = format!( - "{}/providers/microsoft_entra_groups/{id}/", - configuration.base_path, - id = crate::apis::urlencode(p_path_id) - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::MicrosoftEntraProviderGroup`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::MicrosoftEntraProviderGroup`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Get a list of all objects that use this object -pub async fn providers_microsoft_entra_groups_used_by_list( - configuration: &configuration::Configuration, - id: &str, -) -> Result, Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_id = id; - - let uri_str = format!( - "{}/providers/microsoft_entra_groups/{id}/used_by/", - configuration.base_path, - id = crate::apis::urlencode(p_path_id) - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `Vec<models::UsedBy>`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `Vec<models::UsedBy>`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// MicrosoftEntraProvider Viewset -pub async fn providers_microsoft_entra_list( - configuration: &configuration::Configuration, - exclude_users_service_account: Option, - filter_group: Option<&str>, - name: Option<&str>, - ordering: Option<&str>, - page: Option, - page_size: Option, - search: Option<&str>, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_query_exclude_users_service_account = exclude_users_service_account; - let p_query_filter_group = filter_group; - let p_query_name = name; - let p_query_ordering = ordering; - let p_query_page = page; - let p_query_page_size = page_size; - let p_query_search = search; - - let uri_str = format!("{}/providers/microsoft_entra/", configuration.base_path); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref param_value) = p_query_exclude_users_service_account { - req_builder = - req_builder.query(&[("exclude_users_service_account", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_filter_group { - req_builder = req_builder.query(&[("filter_group", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_name { - req_builder = req_builder.query(&[("name", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_ordering { - req_builder = req_builder.query(&[("ordering", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_page { - req_builder = req_builder.query(&[("page", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_page_size { - req_builder = req_builder.query(&[("page_size", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_search { - req_builder = req_builder.query(&[("search", ¶m_value.to_string())]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::PaginatedMicrosoftEntraProviderList`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::PaginatedMicrosoftEntraProviderList`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// MicrosoftEntraProvider Viewset -pub async fn providers_microsoft_entra_partial_update( - configuration: &configuration::Configuration, - id: i32, - patched_microsoft_entra_provider_request: Option, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_id = id; - let p_body_patched_microsoft_entra_provider_request = patched_microsoft_entra_provider_request; - - let uri_str = format!( - "{}/providers/microsoft_entra/{id}/", - configuration.base_path, - id = p_path_id - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::PATCH, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - req_builder = req_builder.json(&p_body_patched_microsoft_entra_provider_request); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::MicrosoftEntraProvider`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::MicrosoftEntraProvider`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// MicrosoftEntraProvider Viewset -pub async fn providers_microsoft_entra_retrieve( - configuration: &configuration::Configuration, - id: i32, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_id = id; - - let uri_str = format!( - "{}/providers/microsoft_entra/{id}/", - configuration.base_path, - id = p_path_id - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::MicrosoftEntraProvider`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::MicrosoftEntraProvider`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Sync/Re-sync a single user/group object -pub async fn providers_microsoft_entra_sync_object_create( - configuration: &configuration::Configuration, - id: i32, - sync_object_request: models::SyncObjectRequest, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_id = id; - let p_body_sync_object_request = sync_object_request; - - let uri_str = format!( - "{}/providers/microsoft_entra/{id}/sync/object/", - configuration.base_path, - id = p_path_id - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::POST, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - req_builder = req_builder.json(&p_body_sync_object_request); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::SyncObjectResult`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::SyncObjectResult`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Get provider's sync status -pub async fn providers_microsoft_entra_sync_status_retrieve( - configuration: &configuration::Configuration, - id: i32, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_id = id; - - let uri_str = format!( - "{}/providers/microsoft_entra/{id}/sync/status/", - configuration.base_path, - id = p_path_id - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::SyncStatus`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::SyncStatus`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// MicrosoftEntraProvider Viewset -pub async fn providers_microsoft_entra_update( - configuration: &configuration::Configuration, - id: i32, - microsoft_entra_provider_request: models::MicrosoftEntraProviderRequest, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_id = id; - let p_body_microsoft_entra_provider_request = microsoft_entra_provider_request; - - let uri_str = format!( - "{}/providers/microsoft_entra/{id}/", - configuration.base_path, - id = p_path_id - ); - let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - req_builder = req_builder.json(&p_body_microsoft_entra_provider_request); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::MicrosoftEntraProvider`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::MicrosoftEntraProvider`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Get a list of all objects that use this object -pub async fn providers_microsoft_entra_used_by_list( - configuration: &configuration::Configuration, - id: i32, -) -> Result, Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_id = id; - - let uri_str = format!( - "{}/providers/microsoft_entra/{id}/used_by/", - configuration.base_path, - id = p_path_id - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `Vec<models::UsedBy>`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `Vec<models::UsedBy>`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// MicrosoftEntraProviderUser Viewset -pub async fn providers_microsoft_entra_users_create( - configuration: &configuration::Configuration, - microsoft_entra_provider_user_request: models::MicrosoftEntraProviderUserRequest, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_body_microsoft_entra_provider_user_request = microsoft_entra_provider_user_request; - - let uri_str = format!( - "{}/providers/microsoft_entra_users/", - configuration.base_path - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::POST, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - req_builder = req_builder.json(&p_body_microsoft_entra_provider_user_request); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::MicrosoftEntraProviderUser`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::MicrosoftEntraProviderUser`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// MicrosoftEntraProviderUser Viewset -pub async fn providers_microsoft_entra_users_destroy( - configuration: &configuration::Configuration, - id: &str, -) -> Result<(), Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_id = id; - - let uri_str = format!( - "{}/providers/microsoft_entra_users/{id}/", - configuration.base_path, - id = crate::apis::urlencode(p_path_id) - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::DELETE, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - - if !status.is_client_error() && !status.is_server_error() { - Ok(()) - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// MicrosoftEntraProviderUser Viewset -pub async fn providers_microsoft_entra_users_list( - configuration: &configuration::Configuration, - ordering: Option<&str>, - page: Option, - page_size: Option, - provider__id: Option, - search: Option<&str>, - user__id: Option, - user__username: Option<&str>, -) -> Result< - models::PaginatedMicrosoftEntraProviderUserList, - Error, -> { - // add a prefix to parameters to efficiently prevent name collisions - let p_query_ordering = ordering; - let p_query_page = page; - let p_query_page_size = page_size; - let p_query_provider__id = provider__id; - let p_query_search = search; - let p_query_user__id = user__id; - let p_query_user__username = user__username; - - let uri_str = format!( - "{}/providers/microsoft_entra_users/", - configuration.base_path - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref param_value) = p_query_ordering { - req_builder = req_builder.query(&[("ordering", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_page { - req_builder = req_builder.query(&[("page", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_page_size { - req_builder = req_builder.query(&[("page_size", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_provider__id { - req_builder = req_builder.query(&[("provider__id", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_search { - req_builder = req_builder.query(&[("search", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_user__id { - req_builder = req_builder.query(&[("user__id", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_user__username { - req_builder = req_builder.query(&[("user__username", ¶m_value.to_string())]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::PaginatedMicrosoftEntraProviderUserList`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::PaginatedMicrosoftEntraProviderUserList`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// MicrosoftEntraProviderUser Viewset -pub async fn providers_microsoft_entra_users_retrieve( - configuration: &configuration::Configuration, - id: &str, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_id = id; - - let uri_str = format!( - "{}/providers/microsoft_entra_users/{id}/", - configuration.base_path, - id = crate::apis::urlencode(p_path_id) - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::MicrosoftEntraProviderUser`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::MicrosoftEntraProviderUser`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Get a list of all objects that use this object -pub async fn providers_microsoft_entra_users_used_by_list( - configuration: &configuration::Configuration, - id: &str, -) -> Result, Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_id = id; - - let uri_str = format!( - "{}/providers/microsoft_entra_users/{id}/used_by/", - configuration.base_path, - id = crate::apis::urlencode(p_path_id) - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `Vec<models::UsedBy>`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `Vec<models::UsedBy>`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// OAuth2Provider Viewset -pub async fn providers_oauth2_create( - configuration: &configuration::Configuration, - o_auth2_provider_request: models::OAuth2ProviderRequest, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_body_o_auth2_provider_request = o_auth2_provider_request; - - let uri_str = format!("{}/providers/oauth2/", configuration.base_path); - let mut req_builder = configuration - .client - .request(reqwest::Method::POST, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - req_builder = req_builder.json(&p_body_o_auth2_provider_request); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::OAuth2Provider`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::OAuth2Provider`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// OAuth2Provider Viewset -pub async fn providers_oauth2_destroy( - configuration: &configuration::Configuration, - id: i32, -) -> Result<(), Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_id = id; - - let uri_str = format!( - "{}/providers/oauth2/{id}/", - configuration.base_path, - id = p_path_id - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::DELETE, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - - if !status.is_client_error() && !status.is_server_error() { - Ok(()) - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// OAuth2Provider Viewset -pub async fn providers_oauth2_list( - configuration: &configuration::Configuration, - access_code_validity: Option<&str>, - access_token_validity: Option<&str>, - application: Option<&str>, - authorization_flow: Option<&str>, - client_id: Option<&str>, - client_type: Option, - include_claims_in_id_token: Option, - issuer_mode: Option, - name: Option<&str>, - ordering: Option<&str>, - page: Option, - page_size: Option, - property_mappings: Option>, - refresh_token_validity: Option<&str>, - search: Option<&str>, - signing_key: Option<&str>, - sub_mode: Option, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_query_access_code_validity = access_code_validity; - let p_query_access_token_validity = access_token_validity; - let p_query_application = application; - let p_query_authorization_flow = authorization_flow; - let p_query_client_id = client_id; - let p_query_client_type = client_type; - let p_query_include_claims_in_id_token = include_claims_in_id_token; - let p_query_issuer_mode = issuer_mode; - let p_query_name = name; - let p_query_ordering = ordering; - let p_query_page = page; - let p_query_page_size = page_size; - let p_query_property_mappings = property_mappings; - let p_query_refresh_token_validity = refresh_token_validity; - let p_query_search = search; - let p_query_signing_key = signing_key; - let p_query_sub_mode = sub_mode; - - let uri_str = format!("{}/providers/oauth2/", configuration.base_path); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref param_value) = p_query_access_code_validity { - req_builder = req_builder.query(&[("access_code_validity", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_access_token_validity { - req_builder = req_builder.query(&[("access_token_validity", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_application { - req_builder = req_builder.query(&[("application", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_authorization_flow { - req_builder = req_builder.query(&[("authorization_flow", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_client_id { - req_builder = req_builder.query(&[("client_id", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_client_type { - req_builder = req_builder.query(&[("client_type", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_include_claims_in_id_token { - req_builder = - req_builder.query(&[("include_claims_in_id_token", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_issuer_mode { - req_builder = req_builder.query(&[("issuer_mode", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_name { - req_builder = req_builder.query(&[("name", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_ordering { - req_builder = req_builder.query(&[("ordering", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_page { - req_builder = req_builder.query(&[("page", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_page_size { - req_builder = req_builder.query(&[("page_size", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_property_mappings { - req_builder = match "multi" { - "multi" => req_builder.query( - ¶m_value - .into_iter() - .map(|p| ("property_mappings".to_owned(), p.to_string())) - .collect::>(), - ), - _ => req_builder.query(&[( - "property_mappings", - ¶m_value - .into_iter() - .map(|p| p.to_string()) - .collect::>() - .join(",") - .to_string(), - )]), - }; - } - if let Some(ref param_value) = p_query_refresh_token_validity { - req_builder = req_builder.query(&[("refresh_token_validity", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_search { - req_builder = req_builder.query(&[("search", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_signing_key { - req_builder = req_builder.query(&[("signing_key", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_sub_mode { - req_builder = req_builder.query(&[("sub_mode", ¶m_value.to_string())]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::PaginatedOAuth2ProviderList`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::PaginatedOAuth2ProviderList`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// OAuth2Provider Viewset -pub async fn providers_oauth2_partial_update( - configuration: &configuration::Configuration, - id: i32, - patched_o_auth2_provider_request: Option, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_id = id; - let p_body_patched_o_auth2_provider_request = patched_o_auth2_provider_request; - - let uri_str = format!( - "{}/providers/oauth2/{id}/", - configuration.base_path, - id = p_path_id - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::PATCH, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - req_builder = req_builder.json(&p_body_patched_o_auth2_provider_request); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::OAuth2Provider`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::OAuth2Provider`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Preview user data for provider -pub async fn providers_oauth2_preview_user_retrieve( - configuration: &configuration::Configuration, - id: i32, - for_user: Option, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_id = id; - let p_query_for_user = for_user; - - let uri_str = format!( - "{}/providers/oauth2/{id}/preview_user/", - configuration.base_path, - id = p_path_id - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref param_value) = p_query_for_user { - req_builder = req_builder.query(&[("for_user", ¶m_value.to_string())]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::PropertyMappingPreview`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::PropertyMappingPreview`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// OAuth2Provider Viewset -pub async fn providers_oauth2_retrieve( - configuration: &configuration::Configuration, - id: i32, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_id = id; - - let uri_str = format!( - "{}/providers/oauth2/{id}/", - configuration.base_path, - id = p_path_id - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::OAuth2Provider`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::OAuth2Provider`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Get Providers setup URLs -pub async fn providers_oauth2_setup_urls_retrieve( - configuration: &configuration::Configuration, - id: i32, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_id = id; - - let uri_str = format!( - "{}/providers/oauth2/{id}/setup_urls/", - configuration.base_path, - id = p_path_id - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::OAuth2ProviderSetupUrls`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::OAuth2ProviderSetupUrls`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// OAuth2Provider Viewset -pub async fn providers_oauth2_update( - configuration: &configuration::Configuration, - id: i32, - o_auth2_provider_request: models::OAuth2ProviderRequest, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_id = id; - let p_body_o_auth2_provider_request = o_auth2_provider_request; - - let uri_str = format!( - "{}/providers/oauth2/{id}/", - configuration.base_path, - id = p_path_id - ); - let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - req_builder = req_builder.json(&p_body_o_auth2_provider_request); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::OAuth2Provider`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::OAuth2Provider`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Get a list of all objects that use this object -pub async fn providers_oauth2_used_by_list( - configuration: &configuration::Configuration, - id: i32, -) -> Result, Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_id = id; - - let uri_str = format!( - "{}/providers/oauth2/{id}/used_by/", - configuration.base_path, - id = p_path_id - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `Vec<models::UsedBy>`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `Vec<models::UsedBy>`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// ProxyProvider Viewset -pub async fn providers_proxy_create( - configuration: &configuration::Configuration, - proxy_provider_request: models::ProxyProviderRequest, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_body_proxy_provider_request = proxy_provider_request; - - let uri_str = format!("{}/providers/proxy/", configuration.base_path); - let mut req_builder = configuration - .client - .request(reqwest::Method::POST, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - req_builder = req_builder.json(&p_body_proxy_provider_request); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::ProxyProvider`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::ProxyProvider`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// ProxyProvider Viewset -pub async fn providers_proxy_destroy( - configuration: &configuration::Configuration, - id: i32, -) -> Result<(), Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_id = id; - - let uri_str = format!( - "{}/providers/proxy/{id}/", - configuration.base_path, - id = p_path_id - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::DELETE, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - - if !status.is_client_error() && !status.is_server_error() { - Ok(()) - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// ProxyProvider Viewset -pub async fn providers_proxy_list( - configuration: &configuration::Configuration, - application__isnull: Option, - authorization_flow__slug__iexact: Option<&str>, - basic_auth_enabled__iexact: Option, - basic_auth_password_attribute__iexact: Option<&str>, - basic_auth_user_attribute__iexact: Option<&str>, - certificate__kp_uuid__iexact: Option<&str>, - certificate__name__iexact: Option<&str>, - cookie_domain__iexact: Option<&str>, - external_host__iexact: Option<&str>, - internal_host__iexact: Option<&str>, - internal_host_ssl_validation__iexact: Option, - mode__iexact: Option<&str>, - name__iexact: Option<&str>, - ordering: Option<&str>, - page: Option, - page_size: Option, - property_mappings__iexact: Option>, - search: Option<&str>, - skip_path_regex__iexact: Option<&str>, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_query_application__isnull = application__isnull; - let p_query_authorization_flow__slug__iexact = authorization_flow__slug__iexact; - let p_query_basic_auth_enabled__iexact = basic_auth_enabled__iexact; - let p_query_basic_auth_password_attribute__iexact = basic_auth_password_attribute__iexact; - let p_query_basic_auth_user_attribute__iexact = basic_auth_user_attribute__iexact; - let p_query_certificate__kp_uuid__iexact = certificate__kp_uuid__iexact; - let p_query_certificate__name__iexact = certificate__name__iexact; - let p_query_cookie_domain__iexact = cookie_domain__iexact; - let p_query_external_host__iexact = external_host__iexact; - let p_query_internal_host__iexact = internal_host__iexact; - let p_query_internal_host_ssl_validation__iexact = internal_host_ssl_validation__iexact; - let p_query_mode__iexact = mode__iexact; - let p_query_name__iexact = name__iexact; - let p_query_ordering = ordering; - let p_query_page = page; - let p_query_page_size = page_size; - let p_query_property_mappings__iexact = property_mappings__iexact; - let p_query_search = search; - let p_query_skip_path_regex__iexact = skip_path_regex__iexact; - - let uri_str = format!("{}/providers/proxy/", configuration.base_path); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref param_value) = p_query_application__isnull { - req_builder = req_builder.query(&[("application__isnull", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_authorization_flow__slug__iexact { - req_builder = - req_builder.query(&[("authorization_flow__slug__iexact", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_basic_auth_enabled__iexact { - req_builder = - req_builder.query(&[("basic_auth_enabled__iexact", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_basic_auth_password_attribute__iexact { - req_builder = req_builder.query(&[( - "basic_auth_password_attribute__iexact", - ¶m_value.to_string(), - )]); - } - if let Some(ref param_value) = p_query_basic_auth_user_attribute__iexact { - req_builder = req_builder.query(&[( - "basic_auth_user_attribute__iexact", - ¶m_value.to_string(), - )]); - } - if let Some(ref param_value) = p_query_certificate__kp_uuid__iexact { - req_builder = - req_builder.query(&[("certificate__kp_uuid__iexact", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_certificate__name__iexact { - req_builder = req_builder.query(&[("certificate__name__iexact", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_cookie_domain__iexact { - req_builder = req_builder.query(&[("cookie_domain__iexact", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_external_host__iexact { - req_builder = req_builder.query(&[("external_host__iexact", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_internal_host__iexact { - req_builder = req_builder.query(&[("internal_host__iexact", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_internal_host_ssl_validation__iexact { - req_builder = req_builder.query(&[( - "internal_host_ssl_validation__iexact", - ¶m_value.to_string(), - )]); - } - if let Some(ref param_value) = p_query_mode__iexact { - req_builder = req_builder.query(&[("mode__iexact", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_name__iexact { - req_builder = req_builder.query(&[("name__iexact", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_ordering { - req_builder = req_builder.query(&[("ordering", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_page { - req_builder = req_builder.query(&[("page", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_page_size { - req_builder = req_builder.query(&[("page_size", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_property_mappings__iexact { - req_builder = match "multi" { - "multi" => req_builder.query( - ¶m_value - .into_iter() - .map(|p| ("property_mappings__iexact".to_owned(), p.to_string())) - .collect::>(), - ), - _ => req_builder.query(&[( - "property_mappings__iexact", - ¶m_value - .into_iter() - .map(|p| p.to_string()) - .collect::>() - .join(",") - .to_string(), - )]), - }; - } - if let Some(ref param_value) = p_query_search { - req_builder = req_builder.query(&[("search", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_skip_path_regex__iexact { - req_builder = req_builder.query(&[("skip_path_regex__iexact", ¶m_value.to_string())]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::PaginatedProxyProviderList`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::PaginatedProxyProviderList`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// ProxyProvider Viewset -pub async fn providers_proxy_partial_update( - configuration: &configuration::Configuration, - id: i32, - patched_proxy_provider_request: Option, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_id = id; - let p_body_patched_proxy_provider_request = patched_proxy_provider_request; - - let uri_str = format!( - "{}/providers/proxy/{id}/", - configuration.base_path, - id = p_path_id - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::PATCH, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - req_builder = req_builder.json(&p_body_patched_proxy_provider_request); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::ProxyProvider`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::ProxyProvider`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// ProxyProvider Viewset -pub async fn providers_proxy_retrieve( - configuration: &configuration::Configuration, - id: i32, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_id = id; - - let uri_str = format!( - "{}/providers/proxy/{id}/", - configuration.base_path, - id = p_path_id - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::ProxyProvider`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::ProxyProvider`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// ProxyProvider Viewset -pub async fn providers_proxy_update( - configuration: &configuration::Configuration, - id: i32, - proxy_provider_request: models::ProxyProviderRequest, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_id = id; - let p_body_proxy_provider_request = proxy_provider_request; - - let uri_str = format!( - "{}/providers/proxy/{id}/", - configuration.base_path, - id = p_path_id - ); - let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - req_builder = req_builder.json(&p_body_proxy_provider_request); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::ProxyProvider`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::ProxyProvider`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Get a list of all objects that use this object -pub async fn providers_proxy_used_by_list( - configuration: &configuration::Configuration, - id: i32, -) -> Result, Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_id = id; - - let uri_str = format!( - "{}/providers/proxy/{id}/used_by/", - configuration.base_path, - id = p_path_id - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `Vec<models::UsedBy>`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `Vec<models::UsedBy>`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// RACProvider Viewset -pub async fn providers_rac_create( - configuration: &configuration::Configuration, - rac_provider_request: models::RacProviderRequest, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_body_rac_provider_request = rac_provider_request; - - let uri_str = format!("{}/providers/rac/", configuration.base_path); - let mut req_builder = configuration - .client - .request(reqwest::Method::POST, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - req_builder = req_builder.json(&p_body_rac_provider_request); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::RacProvider`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::RacProvider`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// RACProvider Viewset -pub async fn providers_rac_destroy( - configuration: &configuration::Configuration, - id: i32, -) -> Result<(), Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_id = id; - - let uri_str = format!( - "{}/providers/rac/{id}/", - configuration.base_path, - id = p_path_id - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::DELETE, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - - if !status.is_client_error() && !status.is_server_error() { - Ok(()) - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// RACProvider Viewset -pub async fn providers_rac_list( - configuration: &configuration::Configuration, - application__isnull: Option, - name__iexact: Option<&str>, - ordering: Option<&str>, - page: Option, - page_size: Option, - search: Option<&str>, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_query_application__isnull = application__isnull; - let p_query_name__iexact = name__iexact; - let p_query_ordering = ordering; - let p_query_page = page; - let p_query_page_size = page_size; - let p_query_search = search; - - let uri_str = format!("{}/providers/rac/", configuration.base_path); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref param_value) = p_query_application__isnull { - req_builder = req_builder.query(&[("application__isnull", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_name__iexact { - req_builder = req_builder.query(&[("name__iexact", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_ordering { - req_builder = req_builder.query(&[("ordering", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_page { - req_builder = req_builder.query(&[("page", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_page_size { - req_builder = req_builder.query(&[("page_size", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_search { - req_builder = req_builder.query(&[("search", ¶m_value.to_string())]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::PaginatedRacProviderList`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::PaginatedRacProviderList`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// RACProvider Viewset -pub async fn providers_rac_partial_update( - configuration: &configuration::Configuration, - id: i32, - patched_rac_provider_request: Option, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_id = id; - let p_body_patched_rac_provider_request = patched_rac_provider_request; - - let uri_str = format!( - "{}/providers/rac/{id}/", - configuration.base_path, - id = p_path_id - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::PATCH, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - req_builder = req_builder.json(&p_body_patched_rac_provider_request); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::RacProvider`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::RacProvider`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// RACProvider Viewset -pub async fn providers_rac_retrieve( - configuration: &configuration::Configuration, - id: i32, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_id = id; - - let uri_str = format!( - "{}/providers/rac/{id}/", - configuration.base_path, - id = p_path_id - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::RacProvider`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::RacProvider`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// RACProvider Viewset -pub async fn providers_rac_update( - configuration: &configuration::Configuration, - id: i32, - rac_provider_request: models::RacProviderRequest, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_id = id; - let p_body_rac_provider_request = rac_provider_request; - - let uri_str = format!( - "{}/providers/rac/{id}/", - configuration.base_path, - id = p_path_id - ); - let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - req_builder = req_builder.json(&p_body_rac_provider_request); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::RacProvider`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::RacProvider`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Get a list of all objects that use this object -pub async fn providers_rac_used_by_list( - configuration: &configuration::Configuration, - id: i32, -) -> Result, Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_id = id; - - let uri_str = format!( - "{}/providers/rac/{id}/used_by/", - configuration.base_path, - id = p_path_id - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `Vec<models::UsedBy>`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `Vec<models::UsedBy>`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// RadiusProvider Viewset -pub async fn providers_radius_create( - configuration: &configuration::Configuration, - radius_provider_request: models::RadiusProviderRequest, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_body_radius_provider_request = radius_provider_request; - - let uri_str = format!("{}/providers/radius/", configuration.base_path); - let mut req_builder = configuration - .client - .request(reqwest::Method::POST, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - req_builder = req_builder.json(&p_body_radius_provider_request); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::RadiusProvider`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::RadiusProvider`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// RadiusProvider Viewset -pub async fn providers_radius_destroy( - configuration: &configuration::Configuration, - id: i32, -) -> Result<(), Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_id = id; - - let uri_str = format!( - "{}/providers/radius/{id}/", - configuration.base_path, - id = p_path_id - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::DELETE, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - - if !status.is_client_error() && !status.is_server_error() { - Ok(()) - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// RadiusProvider Viewset -pub async fn providers_radius_list( - configuration: &configuration::Configuration, - application__isnull: Option, - authorization_flow__slug__iexact: Option<&str>, - client_networks__iexact: Option<&str>, - name__iexact: Option<&str>, - ordering: Option<&str>, - page: Option, - page_size: Option, - search: Option<&str>, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_query_application__isnull = application__isnull; - let p_query_authorization_flow__slug__iexact = authorization_flow__slug__iexact; - let p_query_client_networks__iexact = client_networks__iexact; - let p_query_name__iexact = name__iexact; - let p_query_ordering = ordering; - let p_query_page = page; - let p_query_page_size = page_size; - let p_query_search = search; - - let uri_str = format!("{}/providers/radius/", configuration.base_path); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref param_value) = p_query_application__isnull { - req_builder = req_builder.query(&[("application__isnull", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_authorization_flow__slug__iexact { - req_builder = - req_builder.query(&[("authorization_flow__slug__iexact", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_client_networks__iexact { - req_builder = req_builder.query(&[("client_networks__iexact", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_name__iexact { - req_builder = req_builder.query(&[("name__iexact", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_ordering { - req_builder = req_builder.query(&[("ordering", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_page { - req_builder = req_builder.query(&[("page", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_page_size { - req_builder = req_builder.query(&[("page_size", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_search { - req_builder = req_builder.query(&[("search", ¶m_value.to_string())]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::PaginatedRadiusProviderList`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::PaginatedRadiusProviderList`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// RadiusProvider Viewset -pub async fn providers_radius_partial_update( - configuration: &configuration::Configuration, - id: i32, - patched_radius_provider_request: Option, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_id = id; - let p_body_patched_radius_provider_request = patched_radius_provider_request; - - let uri_str = format!( - "{}/providers/radius/{id}/", - configuration.base_path, - id = p_path_id - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::PATCH, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - req_builder = req_builder.json(&p_body_patched_radius_provider_request); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::RadiusProvider`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::RadiusProvider`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// RadiusProvider Viewset -pub async fn providers_radius_retrieve( - configuration: &configuration::Configuration, - id: i32, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_id = id; - - let uri_str = format!( - "{}/providers/radius/{id}/", - configuration.base_path, - id = p_path_id - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::RadiusProvider`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::RadiusProvider`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// RadiusProvider Viewset -pub async fn providers_radius_update( - configuration: &configuration::Configuration, - id: i32, - radius_provider_request: models::RadiusProviderRequest, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_id = id; - let p_body_radius_provider_request = radius_provider_request; - - let uri_str = format!( - "{}/providers/radius/{id}/", - configuration.base_path, - id = p_path_id - ); - let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - req_builder = req_builder.json(&p_body_radius_provider_request); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::RadiusProvider`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::RadiusProvider`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Get a list of all objects that use this object -pub async fn providers_radius_used_by_list( - configuration: &configuration::Configuration, - id: i32, -) -> Result, Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_id = id; - - let uri_str = format!( - "{}/providers/radius/{id}/used_by/", - configuration.base_path, - id = p_path_id - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `Vec<models::UsedBy>`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `Vec<models::UsedBy>`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// SAMLProvider Viewset -pub async fn providers_saml_create( - configuration: &configuration::Configuration, - saml_provider_request: models::SamlProviderRequest, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_body_saml_provider_request = saml_provider_request; - - let uri_str = format!("{}/providers/saml/", configuration.base_path); - let mut req_builder = configuration - .client - .request(reqwest::Method::POST, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - req_builder = req_builder.json(&p_body_saml_provider_request); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::SamlProvider`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::SamlProvider`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// SAMLProvider Viewset -pub async fn providers_saml_destroy( - configuration: &configuration::Configuration, - id: i32, -) -> Result<(), Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_id = id; - - let uri_str = format!( - "{}/providers/saml/{id}/", - configuration.base_path, - id = p_path_id - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::DELETE, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - - if !status.is_client_error() && !status.is_server_error() { - Ok(()) - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Create provider from SAML Metadata -pub async fn providers_saml_import_metadata_create( - configuration: &configuration::Configuration, - name: &str, - authorization_flow: &str, - invalidation_flow: &str, - file: std::path::PathBuf, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_form_name = name; - let p_form_authorization_flow = authorization_flow; - let p_form_invalidation_flow = invalidation_flow; - let p_form_file = file; - - let uri_str = format!( - "{}/providers/saml/import_metadata/", - configuration.base_path - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::POST, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - let mut multipart_form = reqwest::multipart::Form::new(); - multipart_form = multipart_form.text("name", p_form_name.to_string()); - multipart_form = - multipart_form.text("authorization_flow", p_form_authorization_flow.to_string()); - multipart_form = multipart_form.text("invalidation_flow", p_form_invalidation_flow.to_string()); - let file = TokioFile::open(&p_form_file).await?; - let stream = FramedRead::new(file, BytesCodec::new()); - let file_name = p_form_file - .file_name() - .map(|n| n.to_string_lossy().to_string()) - .unwrap_or_default(); - let file_part = - reqwest::multipart::Part::stream(reqwest::Body::wrap_stream(stream)).file_name(file_name); - multipart_form = multipart_form.part("file", file_part); - req_builder = req_builder.multipart(multipart_form); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::SamlProvider`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::SamlProvider`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// SAMLProvider Viewset -pub async fn providers_saml_list( - configuration: &configuration::Configuration, - acs_url: Option<&str>, - assertion_valid_not_before: Option<&str>, - assertion_valid_not_on_or_after: Option<&str>, - audience: Option<&str>, - authentication_flow: Option<&str>, - authn_context_class_ref_mapping: Option<&str>, - authorization_flow: Option<&str>, - backchannel_application: Option<&str>, - default_name_id_policy: Option, - default_relay_state: Option<&str>, - digest_algorithm: Option, - encryption_kp: Option<&str>, - invalidation_flow: Option<&str>, - is_backchannel: Option, - issuer: Option<&str>, - logout_method: Option, - name: Option<&str>, - name_id_mapping: Option<&str>, - ordering: Option<&str>, - page: Option, - page_size: Option, - property_mappings: Option>, - search: Option<&str>, - session_valid_not_on_or_after: Option<&str>, - sign_assertion: Option, - sign_logout_request: Option, - sign_logout_response: Option, - sign_response: Option, - signature_algorithm: Option, - signing_kp: Option<&str>, - sls_binding: Option, - sls_url: Option<&str>, - sp_binding: Option, - verification_kp: Option<&str>, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_query_acs_url = acs_url; - let p_query_assertion_valid_not_before = assertion_valid_not_before; - let p_query_assertion_valid_not_on_or_after = assertion_valid_not_on_or_after; - let p_query_audience = audience; - let p_query_authentication_flow = authentication_flow; - let p_query_authn_context_class_ref_mapping = authn_context_class_ref_mapping; - let p_query_authorization_flow = authorization_flow; - let p_query_backchannel_application = backchannel_application; - let p_query_default_name_id_policy = default_name_id_policy; - let p_query_default_relay_state = default_relay_state; - let p_query_digest_algorithm = digest_algorithm; - let p_query_encryption_kp = encryption_kp; - let p_query_invalidation_flow = invalidation_flow; - let p_query_is_backchannel = is_backchannel; - let p_query_issuer = issuer; - let p_query_logout_method = logout_method; - let p_query_name = name; - let p_query_name_id_mapping = name_id_mapping; - let p_query_ordering = ordering; - let p_query_page = page; - let p_query_page_size = page_size; - let p_query_property_mappings = property_mappings; - let p_query_search = search; - let p_query_session_valid_not_on_or_after = session_valid_not_on_or_after; - let p_query_sign_assertion = sign_assertion; - let p_query_sign_logout_request = sign_logout_request; - let p_query_sign_logout_response = sign_logout_response; - let p_query_sign_response = sign_response; - let p_query_signature_algorithm = signature_algorithm; - let p_query_signing_kp = signing_kp; - let p_query_sls_binding = sls_binding; - let p_query_sls_url = sls_url; - let p_query_sp_binding = sp_binding; - let p_query_verification_kp = verification_kp; - - let uri_str = format!("{}/providers/saml/", configuration.base_path); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref param_value) = p_query_acs_url { - req_builder = req_builder.query(&[("acs_url", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_assertion_valid_not_before { - req_builder = - req_builder.query(&[("assertion_valid_not_before", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_assertion_valid_not_on_or_after { - req_builder = - req_builder.query(&[("assertion_valid_not_on_or_after", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_audience { - req_builder = req_builder.query(&[("audience", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_authentication_flow { - req_builder = req_builder.query(&[("authentication_flow", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_authn_context_class_ref_mapping { - req_builder = - req_builder.query(&[("authn_context_class_ref_mapping", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_authorization_flow { - req_builder = req_builder.query(&[("authorization_flow", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_backchannel_application { - req_builder = req_builder.query(&[("backchannel_application", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_default_name_id_policy { - req_builder = req_builder.query(&[("default_name_id_policy", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_default_relay_state { - req_builder = req_builder.query(&[("default_relay_state", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_digest_algorithm { - req_builder = req_builder.query(&[("digest_algorithm", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_encryption_kp { - req_builder = req_builder.query(&[("encryption_kp", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_invalidation_flow { - req_builder = req_builder.query(&[("invalidation_flow", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_is_backchannel { - req_builder = req_builder.query(&[("is_backchannel", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_issuer { - req_builder = req_builder.query(&[("issuer", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_logout_method { - req_builder = req_builder.query(&[("logout_method", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_name { - req_builder = req_builder.query(&[("name", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_name_id_mapping { - req_builder = req_builder.query(&[("name_id_mapping", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_ordering { - req_builder = req_builder.query(&[("ordering", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_page { - req_builder = req_builder.query(&[("page", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_page_size { - req_builder = req_builder.query(&[("page_size", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_property_mappings { - req_builder = match "multi" { - "multi" => req_builder.query( - ¶m_value - .into_iter() - .map(|p| ("property_mappings".to_owned(), p.to_string())) - .collect::>(), - ), - _ => req_builder.query(&[( - "property_mappings", - ¶m_value - .into_iter() - .map(|p| p.to_string()) - .collect::>() - .join(",") - .to_string(), - )]), - }; - } - if let Some(ref param_value) = p_query_search { - req_builder = req_builder.query(&[("search", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_session_valid_not_on_or_after { - req_builder = - req_builder.query(&[("session_valid_not_on_or_after", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_sign_assertion { - req_builder = req_builder.query(&[("sign_assertion", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_sign_logout_request { - req_builder = req_builder.query(&[("sign_logout_request", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_sign_logout_response { - req_builder = req_builder.query(&[("sign_logout_response", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_sign_response { - req_builder = req_builder.query(&[("sign_response", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_signature_algorithm { - req_builder = req_builder.query(&[("signature_algorithm", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_signing_kp { - req_builder = req_builder.query(&[("signing_kp", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_sls_binding { - req_builder = req_builder.query(&[("sls_binding", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_sls_url { - req_builder = req_builder.query(&[("sls_url", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_sp_binding { - req_builder = req_builder.query(&[("sp_binding", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_verification_kp { - req_builder = req_builder.query(&[("verification_kp", ¶m_value.to_string())]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::PaginatedSamlProviderList`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::PaginatedSamlProviderList`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Return metadata as XML string -pub async fn providers_saml_metadata_retrieve( - configuration: &configuration::Configuration, - id: i32, - download: Option, - force_binding: Option<&str>, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_id = id; - let p_query_download = download; - let p_query_force_binding = force_binding; - - let uri_str = format!( - "{}/providers/saml/{id}/metadata/", - configuration.base_path, - id = p_path_id - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref param_value) = p_query_download { - req_builder = req_builder.query(&[("download", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_force_binding { - req_builder = req_builder.query(&[("force_binding", ¶m_value.to_string())]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::SamlMetadata`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::SamlMetadata`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// SAMLProvider Viewset -pub async fn providers_saml_partial_update( - configuration: &configuration::Configuration, - id: i32, - patched_saml_provider_request: Option, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_id = id; - let p_body_patched_saml_provider_request = patched_saml_provider_request; - - let uri_str = format!( - "{}/providers/saml/{id}/", - configuration.base_path, - id = p_path_id - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::PATCH, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - req_builder = req_builder.json(&p_body_patched_saml_provider_request); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::SamlProvider`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::SamlProvider`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Preview user data for provider -pub async fn providers_saml_preview_user_retrieve( - configuration: &configuration::Configuration, - id: i32, - for_user: Option, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_id = id; - let p_query_for_user = for_user; - - let uri_str = format!( - "{}/providers/saml/{id}/preview_user/", - configuration.base_path, - id = p_path_id - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref param_value) = p_query_for_user { - req_builder = req_builder.query(&[("for_user", ¶m_value.to_string())]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::PropertyMappingPreview`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::PropertyMappingPreview`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// SAMLProvider Viewset -pub async fn providers_saml_retrieve( - configuration: &configuration::Configuration, - id: i32, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_id = id; - - let uri_str = format!( - "{}/providers/saml/{id}/", - configuration.base_path, - id = p_path_id - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::SamlProvider`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::SamlProvider`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// SAMLProvider Viewset -pub async fn providers_saml_update( - configuration: &configuration::Configuration, - id: i32, - saml_provider_request: models::SamlProviderRequest, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_id = id; - let p_body_saml_provider_request = saml_provider_request; - - let uri_str = format!( - "{}/providers/saml/{id}/", - configuration.base_path, - id = p_path_id - ); - let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - req_builder = req_builder.json(&p_body_saml_provider_request); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::SamlProvider`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::SamlProvider`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Get a list of all objects that use this object -pub async fn providers_saml_used_by_list( - configuration: &configuration::Configuration, - id: i32, -) -> Result, Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_id = id; - - let uri_str = format!( - "{}/providers/saml/{id}/used_by/", - configuration.base_path, - id = p_path_id - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `Vec<models::UsedBy>`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `Vec<models::UsedBy>`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// SCIMProvider Viewset -pub async fn providers_scim_create( - configuration: &configuration::Configuration, - scim_provider_request: models::ScimProviderRequest, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_body_scim_provider_request = scim_provider_request; - - let uri_str = format!("{}/providers/scim/", configuration.base_path); - let mut req_builder = configuration - .client - .request(reqwest::Method::POST, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - req_builder = req_builder.json(&p_body_scim_provider_request); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::ScimProvider`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::ScimProvider`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// SCIMProvider Viewset -pub async fn providers_scim_destroy( - configuration: &configuration::Configuration, - id: i32, -) -> Result<(), Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_id = id; - - let uri_str = format!( - "{}/providers/scim/{id}/", - configuration.base_path, - id = p_path_id - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::DELETE, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - - if !status.is_client_error() && !status.is_server_error() { - Ok(()) - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// SCIMProviderGroup Viewset -pub async fn providers_scim_groups_create( - configuration: &configuration::Configuration, - scim_provider_group_request: models::ScimProviderGroupRequest, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_body_scim_provider_group_request = scim_provider_group_request; - - let uri_str = format!("{}/providers/scim_groups/", configuration.base_path); - let mut req_builder = configuration - .client - .request(reqwest::Method::POST, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - req_builder = req_builder.json(&p_body_scim_provider_group_request); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::ScimProviderGroup`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::ScimProviderGroup`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// SCIMProviderGroup Viewset -pub async fn providers_scim_groups_destroy( - configuration: &configuration::Configuration, - id: &str, -) -> Result<(), Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_id = id; - - let uri_str = format!( - "{}/providers/scim_groups/{id}/", - configuration.base_path, - id = crate::apis::urlencode(p_path_id) - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::DELETE, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - - if !status.is_client_error() && !status.is_server_error() { - Ok(()) - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// SCIMProviderGroup Viewset -pub async fn providers_scim_groups_list( - configuration: &configuration::Configuration, - group__group_uuid: Option<&str>, - group__name: Option<&str>, - ordering: Option<&str>, - page: Option, - page_size: Option, - provider__id: Option, - search: Option<&str>, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_query_group__group_uuid = group__group_uuid; - let p_query_group__name = group__name; - let p_query_ordering = ordering; - let p_query_page = page; - let p_query_page_size = page_size; - let p_query_provider__id = provider__id; - let p_query_search = search; - - let uri_str = format!("{}/providers/scim_groups/", configuration.base_path); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref param_value) = p_query_group__group_uuid { - req_builder = req_builder.query(&[("group__group_uuid", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_group__name { - req_builder = req_builder.query(&[("group__name", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_ordering { - req_builder = req_builder.query(&[("ordering", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_page { - req_builder = req_builder.query(&[("page", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_page_size { - req_builder = req_builder.query(&[("page_size", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_provider__id { - req_builder = req_builder.query(&[("provider__id", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_search { - req_builder = req_builder.query(&[("search", ¶m_value.to_string())]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::PaginatedScimProviderGroupList`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::PaginatedScimProviderGroupList`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// SCIMProviderGroup Viewset -pub async fn providers_scim_groups_retrieve( - configuration: &configuration::Configuration, - id: &str, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_id = id; - - let uri_str = format!( - "{}/providers/scim_groups/{id}/", - configuration.base_path, - id = crate::apis::urlencode(p_path_id) - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::ScimProviderGroup`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::ScimProviderGroup`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Get a list of all objects that use this object -pub async fn providers_scim_groups_used_by_list( - configuration: &configuration::Configuration, - id: &str, -) -> Result, Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_id = id; - - let uri_str = format!( - "{}/providers/scim_groups/{id}/used_by/", - configuration.base_path, - id = crate::apis::urlencode(p_path_id) - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `Vec<models::UsedBy>`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `Vec<models::UsedBy>`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// SCIMProvider Viewset -pub async fn providers_scim_list( - configuration: &configuration::Configuration, - exclude_users_service_account: Option, - group_filters: Option>, - name: Option<&str>, - ordering: Option<&str>, - page: Option, - page_size: Option, - search: Option<&str>, - url: Option<&str>, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_query_exclude_users_service_account = exclude_users_service_account; - let p_query_group_filters = group_filters; - let p_query_name = name; - let p_query_ordering = ordering; - let p_query_page = page; - let p_query_page_size = page_size; - let p_query_search = search; - let p_query_url = url; - - let uri_str = format!("{}/providers/scim/", configuration.base_path); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref param_value) = p_query_exclude_users_service_account { - req_builder = - req_builder.query(&[("exclude_users_service_account", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_group_filters { - req_builder = match "multi" { - "multi" => req_builder.query( - ¶m_value - .into_iter() - .map(|p| ("group_filters".to_owned(), p.to_string())) - .collect::>(), - ), - _ => req_builder.query(&[( - "group_filters", - ¶m_value - .into_iter() - .map(|p| p.to_string()) - .collect::>() - .join(",") - .to_string(), - )]), - }; - } - if let Some(ref param_value) = p_query_name { - req_builder = req_builder.query(&[("name", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_ordering { - req_builder = req_builder.query(&[("ordering", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_page { - req_builder = req_builder.query(&[("page", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_page_size { - req_builder = req_builder.query(&[("page_size", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_search { - req_builder = req_builder.query(&[("search", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_url { - req_builder = req_builder.query(&[("url", ¶m_value.to_string())]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::PaginatedScimProviderList`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::PaginatedScimProviderList`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// SCIMProvider Viewset -pub async fn providers_scim_partial_update( - configuration: &configuration::Configuration, - id: i32, - patched_scim_provider_request: Option, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_id = id; - let p_body_patched_scim_provider_request = patched_scim_provider_request; - - let uri_str = format!( - "{}/providers/scim/{id}/", - configuration.base_path, - id = p_path_id - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::PATCH, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - req_builder = req_builder.json(&p_body_patched_scim_provider_request); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::ScimProvider`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::ScimProvider`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// SCIMProvider Viewset -pub async fn providers_scim_retrieve( - configuration: &configuration::Configuration, - id: i32, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_id = id; - - let uri_str = format!( - "{}/providers/scim/{id}/", - configuration.base_path, - id = p_path_id - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::ScimProvider`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::ScimProvider`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Sync/Re-sync a single user/group object -pub async fn providers_scim_sync_object_create( - configuration: &configuration::Configuration, - id: i32, - sync_object_request: models::SyncObjectRequest, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_id = id; - let p_body_sync_object_request = sync_object_request; - - let uri_str = format!( - "{}/providers/scim/{id}/sync/object/", - configuration.base_path, - id = p_path_id - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::POST, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - req_builder = req_builder.json(&p_body_sync_object_request); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::SyncObjectResult`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::SyncObjectResult`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Get provider's sync status -pub async fn providers_scim_sync_status_retrieve( - configuration: &configuration::Configuration, - id: i32, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_id = id; - - let uri_str = format!( - "{}/providers/scim/{id}/sync/status/", - configuration.base_path, - id = p_path_id - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::SyncStatus`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::SyncStatus`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// SCIMProvider Viewset -pub async fn providers_scim_update( - configuration: &configuration::Configuration, - id: i32, - scim_provider_request: models::ScimProviderRequest, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_id = id; - let p_body_scim_provider_request = scim_provider_request; - - let uri_str = format!( - "{}/providers/scim/{id}/", - configuration.base_path, - id = p_path_id - ); - let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - req_builder = req_builder.json(&p_body_scim_provider_request); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::ScimProvider`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::ScimProvider`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Get a list of all objects that use this object -pub async fn providers_scim_used_by_list( - configuration: &configuration::Configuration, - id: i32, -) -> Result, Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_id = id; - - let uri_str = format!( - "{}/providers/scim/{id}/used_by/", - configuration.base_path, - id = p_path_id - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `Vec<models::UsedBy>`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `Vec<models::UsedBy>`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// SCIMProviderUser Viewset -pub async fn providers_scim_users_create( - configuration: &configuration::Configuration, - scim_provider_user_request: models::ScimProviderUserRequest, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_body_scim_provider_user_request = scim_provider_user_request; - - let uri_str = format!("{}/providers/scim_users/", configuration.base_path); - let mut req_builder = configuration - .client - .request(reqwest::Method::POST, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - req_builder = req_builder.json(&p_body_scim_provider_user_request); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::ScimProviderUser`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::ScimProviderUser`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// SCIMProviderUser Viewset -pub async fn providers_scim_users_destroy( - configuration: &configuration::Configuration, - id: &str, -) -> Result<(), Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_id = id; - - let uri_str = format!( - "{}/providers/scim_users/{id}/", - configuration.base_path, - id = crate::apis::urlencode(p_path_id) - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::DELETE, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - - if !status.is_client_error() && !status.is_server_error() { - Ok(()) - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// SCIMProviderUser Viewset -pub async fn providers_scim_users_list( - configuration: &configuration::Configuration, - ordering: Option<&str>, - page: Option, - page_size: Option, - provider__id: Option, - search: Option<&str>, - user__id: Option, - user__username: Option<&str>, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_query_ordering = ordering; - let p_query_page = page; - let p_query_page_size = page_size; - let p_query_provider__id = provider__id; - let p_query_search = search; - let p_query_user__id = user__id; - let p_query_user__username = user__username; - - let uri_str = format!("{}/providers/scim_users/", configuration.base_path); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref param_value) = p_query_ordering { - req_builder = req_builder.query(&[("ordering", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_page { - req_builder = req_builder.query(&[("page", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_page_size { - req_builder = req_builder.query(&[("page_size", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_provider__id { - req_builder = req_builder.query(&[("provider__id", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_search { - req_builder = req_builder.query(&[("search", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_user__id { - req_builder = req_builder.query(&[("user__id", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_user__username { - req_builder = req_builder.query(&[("user__username", ¶m_value.to_string())]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::PaginatedScimProviderUserList`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::PaginatedScimProviderUserList`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// SCIMProviderUser Viewset -pub async fn providers_scim_users_retrieve( - configuration: &configuration::Configuration, - id: &str, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_id = id; - - let uri_str = format!( - "{}/providers/scim_users/{id}/", - configuration.base_path, - id = crate::apis::urlencode(p_path_id) - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::ScimProviderUser`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::ScimProviderUser`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Get a list of all objects that use this object -pub async fn providers_scim_users_used_by_list( - configuration: &configuration::Configuration, - id: &str, -) -> Result, Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_id = id; - - let uri_str = format!( - "{}/providers/scim_users/{id}/used_by/", - configuration.base_path, - id = crate::apis::urlencode(p_path_id) - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `Vec<models::UsedBy>`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `Vec<models::UsedBy>`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// SSFProvider Viewset -pub async fn providers_ssf_create( - configuration: &configuration::Configuration, - ssf_provider_request: models::SsfProviderRequest, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_body_ssf_provider_request = ssf_provider_request; - - let uri_str = format!("{}/providers/ssf/", configuration.base_path); - let mut req_builder = configuration - .client - .request(reqwest::Method::POST, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - req_builder = req_builder.json(&p_body_ssf_provider_request); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::SsfProvider`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::SsfProvider`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// SSFProvider Viewset -pub async fn providers_ssf_destroy( - configuration: &configuration::Configuration, - id: i32, -) -> Result<(), Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_id = id; - - let uri_str = format!( - "{}/providers/ssf/{id}/", - configuration.base_path, - id = p_path_id - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::DELETE, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - - if !status.is_client_error() && !status.is_server_error() { - Ok(()) - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// SSFProvider Viewset -pub async fn providers_ssf_list( - configuration: &configuration::Configuration, - application__isnull: Option, - name__iexact: Option<&str>, - ordering: Option<&str>, - page: Option, - page_size: Option, - search: Option<&str>, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_query_application__isnull = application__isnull; - let p_query_name__iexact = name__iexact; - let p_query_ordering = ordering; - let p_query_page = page; - let p_query_page_size = page_size; - let p_query_search = search; - - let uri_str = format!("{}/providers/ssf/", configuration.base_path); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref param_value) = p_query_application__isnull { - req_builder = req_builder.query(&[("application__isnull", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_name__iexact { - req_builder = req_builder.query(&[("name__iexact", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_ordering { - req_builder = req_builder.query(&[("ordering", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_page { - req_builder = req_builder.query(&[("page", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_page_size { - req_builder = req_builder.query(&[("page_size", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_search { - req_builder = req_builder.query(&[("search", ¶m_value.to_string())]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::PaginatedSsfProviderList`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::PaginatedSsfProviderList`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// SSFProvider Viewset -pub async fn providers_ssf_partial_update( - configuration: &configuration::Configuration, - id: i32, - patched_ssf_provider_request: Option, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_id = id; - let p_body_patched_ssf_provider_request = patched_ssf_provider_request; - - let uri_str = format!( - "{}/providers/ssf/{id}/", - configuration.base_path, - id = p_path_id - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::PATCH, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - req_builder = req_builder.json(&p_body_patched_ssf_provider_request); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::SsfProvider`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::SsfProvider`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// SSFProvider Viewset -pub async fn providers_ssf_retrieve( - configuration: &configuration::Configuration, - id: i32, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_id = id; - - let uri_str = format!( - "{}/providers/ssf/{id}/", - configuration.base_path, - id = p_path_id - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::SsfProvider`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::SsfProvider`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// SSFProvider Viewset -pub async fn providers_ssf_update( - configuration: &configuration::Configuration, - id: i32, - ssf_provider_request: models::SsfProviderRequest, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_id = id; - let p_body_ssf_provider_request = ssf_provider_request; - - let uri_str = format!( - "{}/providers/ssf/{id}/", - configuration.base_path, - id = p_path_id - ); - let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - req_builder = req_builder.json(&p_body_ssf_provider_request); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::SsfProvider`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::SsfProvider`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Get a list of all objects that use this object -pub async fn providers_ssf_used_by_list( - configuration: &configuration::Configuration, - id: i32, -) -> Result, Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_id = id; - - let uri_str = format!( - "{}/providers/ssf/{id}/used_by/", - configuration.base_path, - id = p_path_id - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `Vec<models::UsedBy>`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `Vec<models::UsedBy>`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// WSFederationProvider Viewset -pub async fn providers_wsfed_create( - configuration: &configuration::Configuration, - ws_federation_provider_request: models::WsFederationProviderRequest, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_body_ws_federation_provider_request = ws_federation_provider_request; - - let uri_str = format!("{}/providers/wsfed/", configuration.base_path); - let mut req_builder = configuration - .client - .request(reqwest::Method::POST, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - req_builder = req_builder.json(&p_body_ws_federation_provider_request); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::WsFederationProvider`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::WsFederationProvider`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// WSFederationProvider Viewset -pub async fn providers_wsfed_destroy( - configuration: &configuration::Configuration, - id: i32, -) -> Result<(), Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_id = id; - - let uri_str = format!( - "{}/providers/wsfed/{id}/", - configuration.base_path, - id = p_path_id - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::DELETE, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - - if !status.is_client_error() && !status.is_server_error() { - Ok(()) - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// WSFederationProvider Viewset -pub async fn providers_wsfed_list( - configuration: &configuration::Configuration, - acs_url: Option<&str>, - assertion_valid_not_before: Option<&str>, - assertion_valid_not_on_or_after: Option<&str>, - audience: Option<&str>, - authentication_flow: Option<&str>, - authn_context_class_ref_mapping: Option<&str>, - authorization_flow: Option<&str>, - backchannel_application: Option<&str>, - default_name_id_policy: Option, - default_relay_state: Option<&str>, - digest_algorithm: Option, - encryption_kp: Option<&str>, - invalidation_flow: Option<&str>, - is_backchannel: Option, - issuer: Option<&str>, - logout_method: Option, - name: Option<&str>, - name_id_mapping: Option<&str>, - ordering: Option<&str>, - page: Option, - page_size: Option, - property_mappings: Option>, - search: Option<&str>, - session_valid_not_on_or_after: Option<&str>, - sign_assertion: Option, - sign_logout_request: Option, - sign_logout_response: Option, - sign_response: Option, - signature_algorithm: Option, - signing_kp: Option<&str>, - sls_binding: Option, - sls_url: Option<&str>, - sp_binding: Option, - verification_kp: Option<&str>, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_query_acs_url = acs_url; - let p_query_assertion_valid_not_before = assertion_valid_not_before; - let p_query_assertion_valid_not_on_or_after = assertion_valid_not_on_or_after; - let p_query_audience = audience; - let p_query_authentication_flow = authentication_flow; - let p_query_authn_context_class_ref_mapping = authn_context_class_ref_mapping; - let p_query_authorization_flow = authorization_flow; - let p_query_backchannel_application = backchannel_application; - let p_query_default_name_id_policy = default_name_id_policy; - let p_query_default_relay_state = default_relay_state; - let p_query_digest_algorithm = digest_algorithm; - let p_query_encryption_kp = encryption_kp; - let p_query_invalidation_flow = invalidation_flow; - let p_query_is_backchannel = is_backchannel; - let p_query_issuer = issuer; - let p_query_logout_method = logout_method; - let p_query_name = name; - let p_query_name_id_mapping = name_id_mapping; - let p_query_ordering = ordering; - let p_query_page = page; - let p_query_page_size = page_size; - let p_query_property_mappings = property_mappings; - let p_query_search = search; - let p_query_session_valid_not_on_or_after = session_valid_not_on_or_after; - let p_query_sign_assertion = sign_assertion; - let p_query_sign_logout_request = sign_logout_request; - let p_query_sign_logout_response = sign_logout_response; - let p_query_sign_response = sign_response; - let p_query_signature_algorithm = signature_algorithm; - let p_query_signing_kp = signing_kp; - let p_query_sls_binding = sls_binding; - let p_query_sls_url = sls_url; - let p_query_sp_binding = sp_binding; - let p_query_verification_kp = verification_kp; - - let uri_str = format!("{}/providers/wsfed/", configuration.base_path); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref param_value) = p_query_acs_url { - req_builder = req_builder.query(&[("acs_url", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_assertion_valid_not_before { - req_builder = - req_builder.query(&[("assertion_valid_not_before", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_assertion_valid_not_on_or_after { - req_builder = - req_builder.query(&[("assertion_valid_not_on_or_after", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_audience { - req_builder = req_builder.query(&[("audience", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_authentication_flow { - req_builder = req_builder.query(&[("authentication_flow", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_authn_context_class_ref_mapping { - req_builder = - req_builder.query(&[("authn_context_class_ref_mapping", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_authorization_flow { - req_builder = req_builder.query(&[("authorization_flow", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_backchannel_application { - req_builder = req_builder.query(&[("backchannel_application", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_default_name_id_policy { - req_builder = req_builder.query(&[("default_name_id_policy", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_default_relay_state { - req_builder = req_builder.query(&[("default_relay_state", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_digest_algorithm { - req_builder = req_builder.query(&[("digest_algorithm", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_encryption_kp { - req_builder = req_builder.query(&[("encryption_kp", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_invalidation_flow { - req_builder = req_builder.query(&[("invalidation_flow", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_is_backchannel { - req_builder = req_builder.query(&[("is_backchannel", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_issuer { - req_builder = req_builder.query(&[("issuer", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_logout_method { - req_builder = req_builder.query(&[("logout_method", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_name { - req_builder = req_builder.query(&[("name", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_name_id_mapping { - req_builder = req_builder.query(&[("name_id_mapping", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_ordering { - req_builder = req_builder.query(&[("ordering", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_page { - req_builder = req_builder.query(&[("page", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_page_size { - req_builder = req_builder.query(&[("page_size", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_property_mappings { - req_builder = match "multi" { - "multi" => req_builder.query( - ¶m_value - .into_iter() - .map(|p| ("property_mappings".to_owned(), p.to_string())) - .collect::>(), - ), - _ => req_builder.query(&[( - "property_mappings", - ¶m_value - .into_iter() - .map(|p| p.to_string()) - .collect::>() - .join(",") - .to_string(), - )]), - }; - } - if let Some(ref param_value) = p_query_search { - req_builder = req_builder.query(&[("search", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_session_valid_not_on_or_after { - req_builder = - req_builder.query(&[("session_valid_not_on_or_after", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_sign_assertion { - req_builder = req_builder.query(&[("sign_assertion", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_sign_logout_request { - req_builder = req_builder.query(&[("sign_logout_request", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_sign_logout_response { - req_builder = req_builder.query(&[("sign_logout_response", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_sign_response { - req_builder = req_builder.query(&[("sign_response", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_signature_algorithm { - req_builder = req_builder.query(&[("signature_algorithm", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_signing_kp { - req_builder = req_builder.query(&[("signing_kp", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_sls_binding { - req_builder = req_builder.query(&[("sls_binding", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_sls_url { - req_builder = req_builder.query(&[("sls_url", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_sp_binding { - req_builder = req_builder.query(&[("sp_binding", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_verification_kp { - req_builder = req_builder.query(&[("verification_kp", ¶m_value.to_string())]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::PaginatedWsFederationProviderList`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::PaginatedWsFederationProviderList`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Return metadata as XML string -pub async fn providers_wsfed_metadata_retrieve( - configuration: &configuration::Configuration, - id: i32, - download: Option, - force_binding: Option<&str>, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_id = id; - let p_query_download = download; - let p_query_force_binding = force_binding; - - let uri_str = format!( - "{}/providers/wsfed/{id}/metadata/", - configuration.base_path, - id = p_path_id - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref param_value) = p_query_download { - req_builder = req_builder.query(&[("download", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_force_binding { - req_builder = req_builder.query(&[("force_binding", ¶m_value.to_string())]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::SamlMetadata`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::SamlMetadata`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// WSFederationProvider Viewset -pub async fn providers_wsfed_partial_update( - configuration: &configuration::Configuration, - id: i32, - patched_ws_federation_provider_request: Option, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_id = id; - let p_body_patched_ws_federation_provider_request = patched_ws_federation_provider_request; - - let uri_str = format!( - "{}/providers/wsfed/{id}/", - configuration.base_path, - id = p_path_id - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::PATCH, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - req_builder = req_builder.json(&p_body_patched_ws_federation_provider_request); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::WsFederationProvider`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::WsFederationProvider`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Preview user data for provider -pub async fn providers_wsfed_preview_user_retrieve( - configuration: &configuration::Configuration, - id: i32, - for_user: Option, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_id = id; - let p_query_for_user = for_user; - - let uri_str = format!( - "{}/providers/wsfed/{id}/preview_user/", - configuration.base_path, - id = p_path_id - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref param_value) = p_query_for_user { - req_builder = req_builder.query(&[("for_user", ¶m_value.to_string())]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::PropertyMappingPreview`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::PropertyMappingPreview`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// WSFederationProvider Viewset -pub async fn providers_wsfed_retrieve( - configuration: &configuration::Configuration, - id: i32, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_id = id; - - let uri_str = format!( - "{}/providers/wsfed/{id}/", - configuration.base_path, - id = p_path_id - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::WsFederationProvider`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::WsFederationProvider`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// WSFederationProvider Viewset -pub async fn providers_wsfed_update( - configuration: &configuration::Configuration, - id: i32, - ws_federation_provider_request: models::WsFederationProviderRequest, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_id = id; - let p_body_ws_federation_provider_request = ws_federation_provider_request; - - let uri_str = format!( - "{}/providers/wsfed/{id}/", - configuration.base_path, - id = p_path_id - ); - let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - req_builder = req_builder.json(&p_body_ws_federation_provider_request); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::WsFederationProvider`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::WsFederationProvider`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Get a list of all objects that use this object -pub async fn providers_wsfed_used_by_list( - configuration: &configuration::Configuration, - id: i32, -) -> Result, Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_id = id; - - let uri_str = format!( - "{}/providers/wsfed/{id}/used_by/", - configuration.base_path, - id = p_path_id - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `Vec<models::UsedBy>`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `Vec<models::UsedBy>`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} diff --git a/packages/client-rust/src/apis/rac_api.rs b/packages/client-rust/src/apis/rac_api.rs deleted file mode 100644 index f7b51e46f3..0000000000 --- a/packages/client-rust/src/apis/rac_api.rs +++ /dev/null @@ -1,960 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use reqwest; -use serde::{Deserialize, Serialize, de::Error as _}; - -use super::{ContentType, Error, configuration}; -use crate::{apis::ResponseContent, models}; - -/// struct for typed errors of method [`rac_connection_tokens_destroy`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum RacConnectionTokensDestroyError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`rac_connection_tokens_list`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum RacConnectionTokensListError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`rac_connection_tokens_partial_update`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum RacConnectionTokensPartialUpdateError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`rac_connection_tokens_retrieve`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum RacConnectionTokensRetrieveError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`rac_connection_tokens_update`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum RacConnectionTokensUpdateError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`rac_connection_tokens_used_by_list`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum RacConnectionTokensUsedByListError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`rac_endpoints_create`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum RacEndpointsCreateError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`rac_endpoints_destroy`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum RacEndpointsDestroyError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`rac_endpoints_list`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum RacEndpointsListError { - Status400(), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`rac_endpoints_partial_update`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum RacEndpointsPartialUpdateError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`rac_endpoints_retrieve`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum RacEndpointsRetrieveError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`rac_endpoints_update`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum RacEndpointsUpdateError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`rac_endpoints_used_by_list`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum RacEndpointsUsedByListError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// ConnectionToken Viewset -pub async fn rac_connection_tokens_destroy( - configuration: &configuration::Configuration, - connection_token_uuid: &str, -) -> Result<(), Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_connection_token_uuid = connection_token_uuid; - - let uri_str = format!( - "{}/rac/connection_tokens/{connection_token_uuid}/", - configuration.base_path, - connection_token_uuid = crate::apis::urlencode(p_path_connection_token_uuid) - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::DELETE, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - - if !status.is_client_error() && !status.is_server_error() { - Ok(()) - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// ConnectionToken Viewset -pub async fn rac_connection_tokens_list( - configuration: &configuration::Configuration, - endpoint: Option<&str>, - ordering: Option<&str>, - page: Option, - page_size: Option, - provider: Option, - search: Option<&str>, - session__user: Option, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_query_endpoint = endpoint; - let p_query_ordering = ordering; - let p_query_page = page; - let p_query_page_size = page_size; - let p_query_provider = provider; - let p_query_search = search; - let p_query_session__user = session__user; - - let uri_str = format!("{}/rac/connection_tokens/", configuration.base_path); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref param_value) = p_query_endpoint { - req_builder = req_builder.query(&[("endpoint", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_ordering { - req_builder = req_builder.query(&[("ordering", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_page { - req_builder = req_builder.query(&[("page", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_page_size { - req_builder = req_builder.query(&[("page_size", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_provider { - req_builder = req_builder.query(&[("provider", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_search { - req_builder = req_builder.query(&[("search", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_session__user { - req_builder = req_builder.query(&[("session__user", ¶m_value.to_string())]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::PaginatedConnectionTokenList`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::PaginatedConnectionTokenList`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// ConnectionToken Viewset -pub async fn rac_connection_tokens_partial_update( - configuration: &configuration::Configuration, - connection_token_uuid: &str, - patched_connection_token_request: Option, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_connection_token_uuid = connection_token_uuid; - let p_body_patched_connection_token_request = patched_connection_token_request; - - let uri_str = format!( - "{}/rac/connection_tokens/{connection_token_uuid}/", - configuration.base_path, - connection_token_uuid = crate::apis::urlencode(p_path_connection_token_uuid) - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::PATCH, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - req_builder = req_builder.json(&p_body_patched_connection_token_request); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::ConnectionToken`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::ConnectionToken`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// ConnectionToken Viewset -pub async fn rac_connection_tokens_retrieve( - configuration: &configuration::Configuration, - connection_token_uuid: &str, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_connection_token_uuid = connection_token_uuid; - - let uri_str = format!( - "{}/rac/connection_tokens/{connection_token_uuid}/", - configuration.base_path, - connection_token_uuid = crate::apis::urlencode(p_path_connection_token_uuid) - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::ConnectionToken`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::ConnectionToken`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// ConnectionToken Viewset -pub async fn rac_connection_tokens_update( - configuration: &configuration::Configuration, - connection_token_uuid: &str, - connection_token_request: models::ConnectionTokenRequest, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_connection_token_uuid = connection_token_uuid; - let p_body_connection_token_request = connection_token_request; - - let uri_str = format!( - "{}/rac/connection_tokens/{connection_token_uuid}/", - configuration.base_path, - connection_token_uuid = crate::apis::urlencode(p_path_connection_token_uuid) - ); - let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - req_builder = req_builder.json(&p_body_connection_token_request); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::ConnectionToken`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::ConnectionToken`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Get a list of all objects that use this object -pub async fn rac_connection_tokens_used_by_list( - configuration: &configuration::Configuration, - connection_token_uuid: &str, -) -> Result, Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_connection_token_uuid = connection_token_uuid; - - let uri_str = format!( - "{}/rac/connection_tokens/{connection_token_uuid}/used_by/", - configuration.base_path, - connection_token_uuid = crate::apis::urlencode(p_path_connection_token_uuid) - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `Vec<models::UsedBy>`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `Vec<models::UsedBy>`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Endpoint Viewset -pub async fn rac_endpoints_create( - configuration: &configuration::Configuration, - endpoint_request: models::EndpointRequest, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_body_endpoint_request = endpoint_request; - - let uri_str = format!("{}/rac/endpoints/", configuration.base_path); - let mut req_builder = configuration - .client - .request(reqwest::Method::POST, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - req_builder = req_builder.json(&p_body_endpoint_request); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::Endpoint`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::Endpoint`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Endpoint Viewset -pub async fn rac_endpoints_destroy( - configuration: &configuration::Configuration, - pbm_uuid: &str, -) -> Result<(), Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_pbm_uuid = pbm_uuid; - - let uri_str = format!( - "{}/rac/endpoints/{pbm_uuid}/", - configuration.base_path, - pbm_uuid = crate::apis::urlencode(p_path_pbm_uuid) - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::DELETE, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - - if !status.is_client_error() && !status.is_server_error() { - Ok(()) - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// List accessible endpoints -pub async fn rac_endpoints_list( - configuration: &configuration::Configuration, - name: Option<&str>, - ordering: Option<&str>, - page: Option, - page_size: Option, - provider: Option, - search: Option<&str>, - superuser_full_list: Option, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_query_name = name; - let p_query_ordering = ordering; - let p_query_page = page; - let p_query_page_size = page_size; - let p_query_provider = provider; - let p_query_search = search; - let p_query_superuser_full_list = superuser_full_list; - - let uri_str = format!("{}/rac/endpoints/", configuration.base_path); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref param_value) = p_query_name { - req_builder = req_builder.query(&[("name", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_ordering { - req_builder = req_builder.query(&[("ordering", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_page { - req_builder = req_builder.query(&[("page", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_page_size { - req_builder = req_builder.query(&[("page_size", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_provider { - req_builder = req_builder.query(&[("provider", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_search { - req_builder = req_builder.query(&[("search", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_superuser_full_list { - req_builder = req_builder.query(&[("superuser_full_list", ¶m_value.to_string())]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::PaginatedEndpointList`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::PaginatedEndpointList`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Endpoint Viewset -pub async fn rac_endpoints_partial_update( - configuration: &configuration::Configuration, - pbm_uuid: &str, - patched_endpoint_request: Option, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_pbm_uuid = pbm_uuid; - let p_body_patched_endpoint_request = patched_endpoint_request; - - let uri_str = format!( - "{}/rac/endpoints/{pbm_uuid}/", - configuration.base_path, - pbm_uuid = crate::apis::urlencode(p_path_pbm_uuid) - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::PATCH, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - req_builder = req_builder.json(&p_body_patched_endpoint_request); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::Endpoint`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::Endpoint`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Endpoint Viewset -pub async fn rac_endpoints_retrieve( - configuration: &configuration::Configuration, - pbm_uuid: &str, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_pbm_uuid = pbm_uuid; - - let uri_str = format!( - "{}/rac/endpoints/{pbm_uuid}/", - configuration.base_path, - pbm_uuid = crate::apis::urlencode(p_path_pbm_uuid) - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::Endpoint`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::Endpoint`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Endpoint Viewset -pub async fn rac_endpoints_update( - configuration: &configuration::Configuration, - pbm_uuid: &str, - endpoint_request: models::EndpointRequest, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_pbm_uuid = pbm_uuid; - let p_body_endpoint_request = endpoint_request; - - let uri_str = format!( - "{}/rac/endpoints/{pbm_uuid}/", - configuration.base_path, - pbm_uuid = crate::apis::urlencode(p_path_pbm_uuid) - ); - let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - req_builder = req_builder.json(&p_body_endpoint_request); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::Endpoint`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::Endpoint`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Get a list of all objects that use this object -pub async fn rac_endpoints_used_by_list( - configuration: &configuration::Configuration, - pbm_uuid: &str, -) -> Result, Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_pbm_uuid = pbm_uuid; - - let uri_str = format!( - "{}/rac/endpoints/{pbm_uuid}/used_by/", - configuration.base_path, - pbm_uuid = crate::apis::urlencode(p_path_pbm_uuid) - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `Vec<models::UsedBy>`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `Vec<models::UsedBy>`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} diff --git a/packages/client-rust/src/apis/rbac_api.rs b/packages/client-rust/src/apis/rbac_api.rs deleted file mode 100644 index 3a93dc9f78..0000000000 --- a/packages/client-rust/src/apis/rbac_api.rs +++ /dev/null @@ -1,1657 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use reqwest; -use serde::{Deserialize, Serialize, de::Error as _}; - -use super::{ContentType, Error, configuration}; -use crate::{apis::ResponseContent, models}; - -/// struct for typed errors of method [`rbac_initial_permissions_create`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum RbacInitialPermissionsCreateError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`rbac_initial_permissions_destroy`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum RbacInitialPermissionsDestroyError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`rbac_initial_permissions_list`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum RbacInitialPermissionsListError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`rbac_initial_permissions_partial_update`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum RbacInitialPermissionsPartialUpdateError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`rbac_initial_permissions_retrieve`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum RbacInitialPermissionsRetrieveError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`rbac_initial_permissions_update`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum RbacInitialPermissionsUpdateError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`rbac_initial_permissions_used_by_list`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum RbacInitialPermissionsUsedByListError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`rbac_permissions_assigned_by_roles_assign`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum RbacPermissionsAssignedByRolesAssignError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`rbac_permissions_assigned_by_roles_list`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum RbacPermissionsAssignedByRolesListError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`rbac_permissions_assigned_by_roles_unassign_partial_update`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum RbacPermissionsAssignedByRolesUnassignPartialUpdateError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`rbac_permissions_list`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum RbacPermissionsListError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`rbac_permissions_retrieve`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum RbacPermissionsRetrieveError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`rbac_permissions_roles_list`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum RbacPermissionsRolesListError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`rbac_roles_add_user_create`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum RbacRolesAddUserCreateError { - Status404(), - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`rbac_roles_create`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum RbacRolesCreateError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`rbac_roles_destroy`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum RbacRolesDestroyError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`rbac_roles_list`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum RbacRolesListError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`rbac_roles_partial_update`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum RbacRolesPartialUpdateError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`rbac_roles_remove_user_create`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum RbacRolesRemoveUserCreateError { - Status404(), - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`rbac_roles_retrieve`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum RbacRolesRetrieveError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`rbac_roles_update`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum RbacRolesUpdateError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`rbac_roles_used_by_list`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum RbacRolesUsedByListError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// InitialPermissions viewset -pub async fn rbac_initial_permissions_create( - configuration: &configuration::Configuration, - initial_permissions_request: models::InitialPermissionsRequest, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_body_initial_permissions_request = initial_permissions_request; - - let uri_str = format!("{}/rbac/initial_permissions/", configuration.base_path); - let mut req_builder = configuration - .client - .request(reqwest::Method::POST, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - req_builder = req_builder.json(&p_body_initial_permissions_request); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::InitialPermissions`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::InitialPermissions`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// InitialPermissions viewset -pub async fn rbac_initial_permissions_destroy( - configuration: &configuration::Configuration, - id: i32, -) -> Result<(), Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_id = id; - - let uri_str = format!( - "{}/rbac/initial_permissions/{id}/", - configuration.base_path, - id = p_path_id - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::DELETE, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - - if !status.is_client_error() && !status.is_server_error() { - Ok(()) - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// InitialPermissions viewset -pub async fn rbac_initial_permissions_list( - configuration: &configuration::Configuration, - name: Option<&str>, - ordering: Option<&str>, - page: Option, - page_size: Option, - search: Option<&str>, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_query_name = name; - let p_query_ordering = ordering; - let p_query_page = page; - let p_query_page_size = page_size; - let p_query_search = search; - - let uri_str = format!("{}/rbac/initial_permissions/", configuration.base_path); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref param_value) = p_query_name { - req_builder = req_builder.query(&[("name", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_ordering { - req_builder = req_builder.query(&[("ordering", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_page { - req_builder = req_builder.query(&[("page", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_page_size { - req_builder = req_builder.query(&[("page_size", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_search { - req_builder = req_builder.query(&[("search", ¶m_value.to_string())]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::PaginatedInitialPermissionsList`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::PaginatedInitialPermissionsList`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// InitialPermissions viewset -pub async fn rbac_initial_permissions_partial_update( - configuration: &configuration::Configuration, - id: i32, - patched_initial_permissions_request: Option, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_id = id; - let p_body_patched_initial_permissions_request = patched_initial_permissions_request; - - let uri_str = format!( - "{}/rbac/initial_permissions/{id}/", - configuration.base_path, - id = p_path_id - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::PATCH, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - req_builder = req_builder.json(&p_body_patched_initial_permissions_request); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::InitialPermissions`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::InitialPermissions`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// InitialPermissions viewset -pub async fn rbac_initial_permissions_retrieve( - configuration: &configuration::Configuration, - id: i32, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_id = id; - - let uri_str = format!( - "{}/rbac/initial_permissions/{id}/", - configuration.base_path, - id = p_path_id - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::InitialPermissions`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::InitialPermissions`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// InitialPermissions viewset -pub async fn rbac_initial_permissions_update( - configuration: &configuration::Configuration, - id: i32, - initial_permissions_request: models::InitialPermissionsRequest, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_id = id; - let p_body_initial_permissions_request = initial_permissions_request; - - let uri_str = format!( - "{}/rbac/initial_permissions/{id}/", - configuration.base_path, - id = p_path_id - ); - let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - req_builder = req_builder.json(&p_body_initial_permissions_request); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::InitialPermissions`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::InitialPermissions`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Get a list of all objects that use this object -pub async fn rbac_initial_permissions_used_by_list( - configuration: &configuration::Configuration, - id: i32, -) -> Result, Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_id = id; - - let uri_str = format!( - "{}/rbac/initial_permissions/{id}/used_by/", - configuration.base_path, - id = p_path_id - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `Vec<models::UsedBy>`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `Vec<models::UsedBy>`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Assign permission(s) to role. When `object_pk` is set, the permissions are only assigned to the -/// specific object, otherwise they are assigned globally. -pub async fn rbac_permissions_assigned_by_roles_assign( - configuration: &configuration::Configuration, - uuid: &str, - permission_assign_request: models::PermissionAssignRequest, -) -> Result, Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_uuid = uuid; - let p_body_permission_assign_request = permission_assign_request; - - let uri_str = format!( - "{}/rbac/permissions/assigned_by_roles/{uuid}/assign/", - configuration.base_path, - uuid = crate::apis::urlencode(p_path_uuid) - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::POST, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - req_builder = req_builder.json(&p_body_permission_assign_request); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `Vec<models::PermissionAssignResult>`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `Vec<models::PermissionAssignResult>`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Get assigned object permissions for a single object -pub async fn rbac_permissions_assigned_by_roles_list( - configuration: &configuration::Configuration, - model: &str, - object_pk: Option<&str>, - ordering: Option<&str>, - page: Option, - page_size: Option, - search: Option<&str>, -) -> Result< - models::PaginatedRoleAssignedObjectPermissionList, - Error, -> { - // add a prefix to parameters to efficiently prevent name collisions - let p_query_model = model; - let p_query_object_pk = object_pk; - let p_query_ordering = ordering; - let p_query_page = page; - let p_query_page_size = page_size; - let p_query_search = search; - - let uri_str = format!( - "{}/rbac/permissions/assigned_by_roles/", - configuration.base_path - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - req_builder = req_builder.query(&[("model", &p_query_model.to_string())]); - if let Some(ref param_value) = p_query_object_pk { - req_builder = req_builder.query(&[("object_pk", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_ordering { - req_builder = req_builder.query(&[("ordering", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_page { - req_builder = req_builder.query(&[("page", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_page_size { - req_builder = req_builder.query(&[("page_size", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_search { - req_builder = req_builder.query(&[("search", ¶m_value.to_string())]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::PaginatedRoleAssignedObjectPermissionList`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::PaginatedRoleAssignedObjectPermissionList`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Unassign permission(s) to role. When `object_pk` is set, the permissions are only assigned to -/// the specific object, otherwise they are assigned globally. -pub async fn rbac_permissions_assigned_by_roles_unassign_partial_update( - configuration: &configuration::Configuration, - uuid: &str, - patched_permission_assign_request: Option, -) -> Result<(), Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_uuid = uuid; - let p_body_patched_permission_assign_request = patched_permission_assign_request; - - let uri_str = format!( - "{}/rbac/permissions/assigned_by_roles/{uuid}/unassign/", - configuration.base_path, - uuid = crate::apis::urlencode(p_path_uuid) - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::PATCH, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - req_builder = req_builder.json(&p_body_patched_permission_assign_request); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - - if !status.is_client_error() && !status.is_server_error() { - Ok(()) - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Read-only list of all permissions, filterable by model and app -pub async fn rbac_permissions_list( - configuration: &configuration::Configuration, - codename: Option<&str>, - content_type__app_label: Option<&str>, - content_type__model: Option<&str>, - ordering: Option<&str>, - page: Option, - page_size: Option, - role: Option<&str>, - search: Option<&str>, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_query_codename = codename; - let p_query_content_type__app_label = content_type__app_label; - let p_query_content_type__model = content_type__model; - let p_query_ordering = ordering; - let p_query_page = page; - let p_query_page_size = page_size; - let p_query_role = role; - let p_query_search = search; - - let uri_str = format!("{}/rbac/permissions/", configuration.base_path); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref param_value) = p_query_codename { - req_builder = req_builder.query(&[("codename", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_content_type__app_label { - req_builder = req_builder.query(&[("content_type__app_label", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_content_type__model { - req_builder = req_builder.query(&[("content_type__model", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_ordering { - req_builder = req_builder.query(&[("ordering", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_page { - req_builder = req_builder.query(&[("page", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_page_size { - req_builder = req_builder.query(&[("page_size", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_role { - req_builder = req_builder.query(&[("role", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_search { - req_builder = req_builder.query(&[("search", ¶m_value.to_string())]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::PaginatedPermissionList`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::PaginatedPermissionList`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Read-only list of all permissions, filterable by model and app -pub async fn rbac_permissions_retrieve( - configuration: &configuration::Configuration, - id: i32, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_id = id; - - let uri_str = format!( - "{}/rbac/permissions/{id}/", - configuration.base_path, - id = p_path_id - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::Permission`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::Permission`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Get a role's assigned object permissions -pub async fn rbac_permissions_roles_list( - configuration: &configuration::Configuration, - ordering: Option<&str>, - page: Option, - page_size: Option, - search: Option<&str>, - uuid: Option<&str>, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_query_ordering = ordering; - let p_query_page = page; - let p_query_page_size = page_size; - let p_query_search = search; - let p_query_uuid = uuid; - - let uri_str = format!("{}/rbac/permissions/roles/", configuration.base_path); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref param_value) = p_query_ordering { - req_builder = req_builder.query(&[("ordering", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_page { - req_builder = req_builder.query(&[("page", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_page_size { - req_builder = req_builder.query(&[("page_size", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_search { - req_builder = req_builder.query(&[("search", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_uuid { - req_builder = req_builder.query(&[("uuid", ¶m_value.to_string())]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::PaginatedExtraRoleObjectPermissionList`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::PaginatedExtraRoleObjectPermissionList`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Add user to role -pub async fn rbac_roles_add_user_create( - configuration: &configuration::Configuration, - uuid: &str, - user_account_serializer_for_role_request: models::UserAccountSerializerForRoleRequest, -) -> Result<(), Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_uuid = uuid; - let p_body_user_account_serializer_for_role_request = user_account_serializer_for_role_request; - - let uri_str = format!( - "{}/rbac/roles/{uuid}/add_user/", - configuration.base_path, - uuid = crate::apis::urlencode(p_path_uuid) - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::POST, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - req_builder = req_builder.json(&p_body_user_account_serializer_for_role_request); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - - if !status.is_client_error() && !status.is_server_error() { - Ok(()) - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Role viewset -pub async fn rbac_roles_create( - configuration: &configuration::Configuration, - role_request: models::RoleRequest, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_body_role_request = role_request; - - let uri_str = format!("{}/rbac/roles/", configuration.base_path); - let mut req_builder = configuration - .client - .request(reqwest::Method::POST, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - req_builder = req_builder.json(&p_body_role_request); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::Role`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::Role`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Role viewset -pub async fn rbac_roles_destroy( - configuration: &configuration::Configuration, - uuid: &str, -) -> Result<(), Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_uuid = uuid; - - let uri_str = format!( - "{}/rbac/roles/{uuid}/", - configuration.base_path, - uuid = crate::apis::urlencode(p_path_uuid) - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::DELETE, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - - if !status.is_client_error() && !status.is_server_error() { - Ok(()) - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Role viewset -pub async fn rbac_roles_list( - configuration: &configuration::Configuration, - groups: Option<&str>, - inherited: Option, - managed: Option>, - managed__isnull: Option, - name: Option<&str>, - ordering: Option<&str>, - page: Option, - page_size: Option, - search: Option<&str>, - users: Option, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_query_groups = groups; - let p_query_inherited = inherited; - let p_query_managed = managed; - let p_query_managed__isnull = managed__isnull; - let p_query_name = name; - let p_query_ordering = ordering; - let p_query_page = page; - let p_query_page_size = page_size; - let p_query_search = search; - let p_query_users = users; - - let uri_str = format!("{}/rbac/roles/", configuration.base_path); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref param_value) = p_query_groups { - req_builder = req_builder.query(&[("groups", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_inherited { - req_builder = req_builder.query(&[("inherited", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_managed { - req_builder = match "multi" { - "multi" => req_builder.query( - ¶m_value - .into_iter() - .map(|p| ("managed".to_owned(), p.to_string())) - .collect::>(), - ), - _ => req_builder.query(&[( - "managed", - ¶m_value - .into_iter() - .map(|p| p.to_string()) - .collect::>() - .join(",") - .to_string(), - )]), - }; - } - if let Some(ref param_value) = p_query_managed__isnull { - req_builder = req_builder.query(&[("managed__isnull", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_name { - req_builder = req_builder.query(&[("name", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_ordering { - req_builder = req_builder.query(&[("ordering", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_page { - req_builder = req_builder.query(&[("page", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_page_size { - req_builder = req_builder.query(&[("page_size", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_search { - req_builder = req_builder.query(&[("search", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_users { - req_builder = req_builder.query(&[("users", ¶m_value.to_string())]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::PaginatedRoleList`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::PaginatedRoleList`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Role viewset -pub async fn rbac_roles_partial_update( - configuration: &configuration::Configuration, - uuid: &str, - patched_role_request: Option, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_uuid = uuid; - let p_body_patched_role_request = patched_role_request; - - let uri_str = format!( - "{}/rbac/roles/{uuid}/", - configuration.base_path, - uuid = crate::apis::urlencode(p_path_uuid) - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::PATCH, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - req_builder = req_builder.json(&p_body_patched_role_request); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::Role`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::Role`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Remove user from role -pub async fn rbac_roles_remove_user_create( - configuration: &configuration::Configuration, - uuid: &str, - user_account_serializer_for_role_request: models::UserAccountSerializerForRoleRequest, -) -> Result<(), Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_uuid = uuid; - let p_body_user_account_serializer_for_role_request = user_account_serializer_for_role_request; - - let uri_str = format!( - "{}/rbac/roles/{uuid}/remove_user/", - configuration.base_path, - uuid = crate::apis::urlencode(p_path_uuid) - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::POST, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - req_builder = req_builder.json(&p_body_user_account_serializer_for_role_request); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - - if !status.is_client_error() && !status.is_server_error() { - Ok(()) - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Role viewset -pub async fn rbac_roles_retrieve( - configuration: &configuration::Configuration, - uuid: &str, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_uuid = uuid; - - let uri_str = format!( - "{}/rbac/roles/{uuid}/", - configuration.base_path, - uuid = crate::apis::urlencode(p_path_uuid) - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::Role`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::Role`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Role viewset -pub async fn rbac_roles_update( - configuration: &configuration::Configuration, - uuid: &str, - role_request: models::RoleRequest, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_uuid = uuid; - let p_body_role_request = role_request; - - let uri_str = format!( - "{}/rbac/roles/{uuid}/", - configuration.base_path, - uuid = crate::apis::urlencode(p_path_uuid) - ); - let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - req_builder = req_builder.json(&p_body_role_request); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::Role`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::Role`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Get a list of all objects that use this object -pub async fn rbac_roles_used_by_list( - configuration: &configuration::Configuration, - uuid: &str, -) -> Result, Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_uuid = uuid; - - let uri_str = format!( - "{}/rbac/roles/{uuid}/used_by/", - configuration.base_path, - uuid = crate::apis::urlencode(p_path_uuid) - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `Vec<models::UsedBy>`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `Vec<models::UsedBy>`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} diff --git a/packages/client-rust/src/apis/reports_api.rs b/packages/client-rust/src/apis/reports_api.rs deleted file mode 100644 index 0655cb3210..0000000000 --- a/packages/client-rust/src/apis/reports_api.rs +++ /dev/null @@ -1,215 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use reqwest; -use serde::{Deserialize, Serialize, de::Error as _}; - -use super::{ContentType, Error, configuration}; -use crate::{apis::ResponseContent, models}; - -/// struct for typed errors of method [`reports_exports_destroy`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum ReportsExportsDestroyError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`reports_exports_list`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum ReportsExportsListError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`reports_exports_retrieve`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum ReportsExportsRetrieveError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -pub async fn reports_exports_destroy( - configuration: &configuration::Configuration, - id: &str, -) -> Result<(), Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_id = id; - - let uri_str = format!( - "{}/reports/exports/{id}/", - configuration.base_path, - id = crate::apis::urlencode(p_path_id) - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::DELETE, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - - if !status.is_client_error() && !status.is_server_error() { - Ok(()) - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -pub async fn reports_exports_list( - configuration: &configuration::Configuration, - ordering: Option<&str>, - page: Option, - page_size: Option, - search: Option<&str>, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_query_ordering = ordering; - let p_query_page = page; - let p_query_page_size = page_size; - let p_query_search = search; - - let uri_str = format!("{}/reports/exports/", configuration.base_path); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref param_value) = p_query_ordering { - req_builder = req_builder.query(&[("ordering", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_page { - req_builder = req_builder.query(&[("page", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_page_size { - req_builder = req_builder.query(&[("page_size", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_search { - req_builder = req_builder.query(&[("search", ¶m_value.to_string())]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::PaginatedDataExportList`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::PaginatedDataExportList`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -pub async fn reports_exports_retrieve( - configuration: &configuration::Configuration, - id: &str, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_id = id; - - let uri_str = format!( - "{}/reports/exports/{id}/", - configuration.base_path, - id = crate::apis::urlencode(p_path_id) - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::DataExport`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::DataExport`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} diff --git a/packages/client-rust/src/apis/root_api.rs b/packages/client-rust/src/apis/root_api.rs index 1cf2a03057..98951a30f4 100644 --- a/packages/client-rust/src/apis/root_api.rs +++ b/packages/client-rust/src/apis/root_api.rs @@ -31,9 +31,6 @@ pub async fn root_config_retrieve( if let Some(ref user_agent) = configuration.user_agent { req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; let req = req_builder.build()?; let resp = configuration.client.execute(req).await?; diff --git a/packages/client-rust/src/apis/schema_api.rs b/packages/client-rust/src/apis/schema_api.rs deleted file mode 100644 index 9c3582385b..0000000000 --- a/packages/client-rust/src/apis/schema_api.rs +++ /dev/null @@ -1,88 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use reqwest; -use serde::{Deserialize, Serialize, de::Error as _}; - -use super::{ContentType, Error, configuration}; -use crate::{apis::ResponseContent, models}; - -/// struct for typed errors of method [`schema_retrieve`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum SchemaRetrieveError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// OpenApi3 schema for this API. Format can be selected via content negotiation. - YAML: -/// application/vnd.oai.openapi - JSON: application/vnd.oai.openapi+json -pub async fn schema_retrieve( - configuration: &configuration::Configuration, - format: Option, - lang: Option, -) -> Result, Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_query_format = format; - let p_query_lang = lang; - - let uri_str = format!("{}/schema/", configuration.base_path); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref param_value) = p_query_format { - req_builder = req_builder.query(&[("format", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_lang { - req_builder = req_builder.query(&[("lang", ¶m_value.to_string())]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `std::collections::HashMap<String, serde_json::Value>`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `std::collections::HashMap<String, serde_json::Value>`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} diff --git a/packages/client-rust/src/apis/sources_api.rs b/packages/client-rust/src/apis/sources_api.rs deleted file mode 100644 index 1d72369b33..0000000000 --- a/packages/client-rust/src/apis/sources_api.rs +++ /dev/null @@ -1,13151 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use reqwest; -use serde::{Deserialize, Serialize, de::Error as _}; - -use super::{ContentType, Error, configuration}; -use crate::{apis::ResponseContent, models}; - -/// struct for typed errors of method [`sources_all_destroy`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum SourcesAllDestroyError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`sources_all_list`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum SourcesAllListError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`sources_all_retrieve`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum SourcesAllRetrieveError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`sources_all_types_list`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum SourcesAllTypesListError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`sources_all_used_by_list`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum SourcesAllUsedByListError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`sources_all_user_settings_list`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum SourcesAllUserSettingsListError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`sources_group_connections_all_destroy`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum SourcesGroupConnectionsAllDestroyError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`sources_group_connections_all_list`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum SourcesGroupConnectionsAllListError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`sources_group_connections_all_partial_update`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum SourcesGroupConnectionsAllPartialUpdateError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`sources_group_connections_all_retrieve`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum SourcesGroupConnectionsAllRetrieveError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`sources_group_connections_all_update`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum SourcesGroupConnectionsAllUpdateError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`sources_group_connections_all_used_by_list`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum SourcesGroupConnectionsAllUsedByListError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`sources_group_connections_kerberos_create`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum SourcesGroupConnectionsKerberosCreateError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`sources_group_connections_kerberos_destroy`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum SourcesGroupConnectionsKerberosDestroyError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`sources_group_connections_kerberos_list`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum SourcesGroupConnectionsKerberosListError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`sources_group_connections_kerberos_partial_update`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum SourcesGroupConnectionsKerberosPartialUpdateError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`sources_group_connections_kerberos_retrieve`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum SourcesGroupConnectionsKerberosRetrieveError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`sources_group_connections_kerberos_update`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum SourcesGroupConnectionsKerberosUpdateError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`sources_group_connections_kerberos_used_by_list`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum SourcesGroupConnectionsKerberosUsedByListError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`sources_group_connections_ldap_create`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum SourcesGroupConnectionsLdapCreateError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`sources_group_connections_ldap_destroy`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum SourcesGroupConnectionsLdapDestroyError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`sources_group_connections_ldap_list`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum SourcesGroupConnectionsLdapListError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`sources_group_connections_ldap_partial_update`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum SourcesGroupConnectionsLdapPartialUpdateError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`sources_group_connections_ldap_retrieve`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum SourcesGroupConnectionsLdapRetrieveError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`sources_group_connections_ldap_update`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum SourcesGroupConnectionsLdapUpdateError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`sources_group_connections_ldap_used_by_list`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum SourcesGroupConnectionsLdapUsedByListError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`sources_group_connections_oauth_create`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum SourcesGroupConnectionsOauthCreateError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`sources_group_connections_oauth_destroy`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum SourcesGroupConnectionsOauthDestroyError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`sources_group_connections_oauth_list`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum SourcesGroupConnectionsOauthListError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`sources_group_connections_oauth_partial_update`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum SourcesGroupConnectionsOauthPartialUpdateError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`sources_group_connections_oauth_retrieve`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum SourcesGroupConnectionsOauthRetrieveError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`sources_group_connections_oauth_update`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum SourcesGroupConnectionsOauthUpdateError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`sources_group_connections_oauth_used_by_list`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum SourcesGroupConnectionsOauthUsedByListError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`sources_group_connections_plex_create`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum SourcesGroupConnectionsPlexCreateError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`sources_group_connections_plex_destroy`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum SourcesGroupConnectionsPlexDestroyError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`sources_group_connections_plex_list`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum SourcesGroupConnectionsPlexListError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`sources_group_connections_plex_partial_update`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum SourcesGroupConnectionsPlexPartialUpdateError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`sources_group_connections_plex_retrieve`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum SourcesGroupConnectionsPlexRetrieveError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`sources_group_connections_plex_update`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum SourcesGroupConnectionsPlexUpdateError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`sources_group_connections_plex_used_by_list`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum SourcesGroupConnectionsPlexUsedByListError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`sources_group_connections_saml_create`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum SourcesGroupConnectionsSamlCreateError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`sources_group_connections_saml_destroy`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum SourcesGroupConnectionsSamlDestroyError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`sources_group_connections_saml_list`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum SourcesGroupConnectionsSamlListError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`sources_group_connections_saml_partial_update`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum SourcesGroupConnectionsSamlPartialUpdateError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`sources_group_connections_saml_retrieve`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum SourcesGroupConnectionsSamlRetrieveError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`sources_group_connections_saml_update`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum SourcesGroupConnectionsSamlUpdateError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`sources_group_connections_saml_used_by_list`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum SourcesGroupConnectionsSamlUsedByListError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`sources_group_connections_telegram_create`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum SourcesGroupConnectionsTelegramCreateError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`sources_group_connections_telegram_destroy`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum SourcesGroupConnectionsTelegramDestroyError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`sources_group_connections_telegram_list`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum SourcesGroupConnectionsTelegramListError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`sources_group_connections_telegram_partial_update`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum SourcesGroupConnectionsTelegramPartialUpdateError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`sources_group_connections_telegram_retrieve`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum SourcesGroupConnectionsTelegramRetrieveError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`sources_group_connections_telegram_update`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum SourcesGroupConnectionsTelegramUpdateError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`sources_group_connections_telegram_used_by_list`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum SourcesGroupConnectionsTelegramUsedByListError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`sources_kerberos_create`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum SourcesKerberosCreateError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`sources_kerberos_destroy`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum SourcesKerberosDestroyError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`sources_kerberos_list`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum SourcesKerberosListError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`sources_kerberos_partial_update`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum SourcesKerberosPartialUpdateError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`sources_kerberos_retrieve`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum SourcesKerberosRetrieveError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`sources_kerberos_sync_status_retrieve`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum SourcesKerberosSyncStatusRetrieveError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`sources_kerberos_update`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum SourcesKerberosUpdateError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`sources_kerberos_used_by_list`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum SourcesKerberosUsedByListError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`sources_ldap_create`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum SourcesLdapCreateError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`sources_ldap_debug_retrieve`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum SourcesLdapDebugRetrieveError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`sources_ldap_destroy`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum SourcesLdapDestroyError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`sources_ldap_list`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum SourcesLdapListError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`sources_ldap_partial_update`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum SourcesLdapPartialUpdateError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`sources_ldap_retrieve`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum SourcesLdapRetrieveError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`sources_ldap_sync_status_retrieve`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum SourcesLdapSyncStatusRetrieveError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`sources_ldap_update`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum SourcesLdapUpdateError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`sources_ldap_used_by_list`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum SourcesLdapUsedByListError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`sources_oauth_create`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum SourcesOauthCreateError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`sources_oauth_destroy`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum SourcesOauthDestroyError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`sources_oauth_list`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum SourcesOauthListError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`sources_oauth_partial_update`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum SourcesOauthPartialUpdateError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`sources_oauth_retrieve`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum SourcesOauthRetrieveError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`sources_oauth_source_types_list`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum SourcesOauthSourceTypesListError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`sources_oauth_update`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum SourcesOauthUpdateError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`sources_oauth_used_by_list`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum SourcesOauthUsedByListError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`sources_plex_create`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum SourcesPlexCreateError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`sources_plex_destroy`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum SourcesPlexDestroyError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`sources_plex_list`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum SourcesPlexListError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`sources_plex_partial_update`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum SourcesPlexPartialUpdateError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`sources_plex_redeem_token_authenticated_create`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum SourcesPlexRedeemTokenAuthenticatedCreateError { - Status400(), - Status403(), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`sources_plex_redeem_token_create`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum SourcesPlexRedeemTokenCreateError { - Status400(), - Status403(), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`sources_plex_retrieve`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum SourcesPlexRetrieveError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`sources_plex_update`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum SourcesPlexUpdateError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`sources_plex_used_by_list`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum SourcesPlexUsedByListError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`sources_saml_create`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum SourcesSamlCreateError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`sources_saml_destroy`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum SourcesSamlDestroyError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`sources_saml_list`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum SourcesSamlListError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`sources_saml_metadata_retrieve`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum SourcesSamlMetadataRetrieveError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`sources_saml_partial_update`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum SourcesSamlPartialUpdateError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`sources_saml_retrieve`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum SourcesSamlRetrieveError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`sources_saml_update`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum SourcesSamlUpdateError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`sources_saml_used_by_list`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum SourcesSamlUsedByListError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`sources_scim_create`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum SourcesScimCreateError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`sources_scim_destroy`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum SourcesScimDestroyError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`sources_scim_groups_create`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum SourcesScimGroupsCreateError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`sources_scim_groups_destroy`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum SourcesScimGroupsDestroyError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`sources_scim_groups_list`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum SourcesScimGroupsListError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`sources_scim_groups_partial_update`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum SourcesScimGroupsPartialUpdateError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`sources_scim_groups_retrieve`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum SourcesScimGroupsRetrieveError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`sources_scim_groups_update`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum SourcesScimGroupsUpdateError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`sources_scim_groups_used_by_list`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum SourcesScimGroupsUsedByListError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`sources_scim_list`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum SourcesScimListError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`sources_scim_partial_update`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum SourcesScimPartialUpdateError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`sources_scim_retrieve`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum SourcesScimRetrieveError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`sources_scim_update`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum SourcesScimUpdateError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`sources_scim_used_by_list`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum SourcesScimUsedByListError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`sources_scim_users_create`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum SourcesScimUsersCreateError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`sources_scim_users_destroy`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum SourcesScimUsersDestroyError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`sources_scim_users_list`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum SourcesScimUsersListError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`sources_scim_users_partial_update`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum SourcesScimUsersPartialUpdateError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`sources_scim_users_retrieve`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum SourcesScimUsersRetrieveError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`sources_scim_users_update`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum SourcesScimUsersUpdateError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`sources_scim_users_used_by_list`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum SourcesScimUsersUsedByListError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`sources_telegram_connect_user_create`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum SourcesTelegramConnectUserCreateError { - Status403(), - Status400(models::ValidationError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`sources_telegram_create`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum SourcesTelegramCreateError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`sources_telegram_destroy`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum SourcesTelegramDestroyError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`sources_telegram_list`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum SourcesTelegramListError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`sources_telegram_partial_update`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum SourcesTelegramPartialUpdateError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`sources_telegram_retrieve`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum SourcesTelegramRetrieveError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`sources_telegram_update`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum SourcesTelegramUpdateError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`sources_telegram_used_by_list`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum SourcesTelegramUsedByListError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`sources_user_connections_all_destroy`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum SourcesUserConnectionsAllDestroyError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`sources_user_connections_all_list`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum SourcesUserConnectionsAllListError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`sources_user_connections_all_partial_update`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum SourcesUserConnectionsAllPartialUpdateError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`sources_user_connections_all_retrieve`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum SourcesUserConnectionsAllRetrieveError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`sources_user_connections_all_update`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum SourcesUserConnectionsAllUpdateError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`sources_user_connections_all_used_by_list`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum SourcesUserConnectionsAllUsedByListError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`sources_user_connections_kerberos_create`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum SourcesUserConnectionsKerberosCreateError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`sources_user_connections_kerberos_destroy`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum SourcesUserConnectionsKerberosDestroyError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`sources_user_connections_kerberos_list`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum SourcesUserConnectionsKerberosListError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`sources_user_connections_kerberos_partial_update`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum SourcesUserConnectionsKerberosPartialUpdateError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`sources_user_connections_kerberos_retrieve`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum SourcesUserConnectionsKerberosRetrieveError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`sources_user_connections_kerberos_update`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum SourcesUserConnectionsKerberosUpdateError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`sources_user_connections_kerberos_used_by_list`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum SourcesUserConnectionsKerberosUsedByListError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`sources_user_connections_ldap_create`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum SourcesUserConnectionsLdapCreateError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`sources_user_connections_ldap_destroy`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum SourcesUserConnectionsLdapDestroyError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`sources_user_connections_ldap_list`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum SourcesUserConnectionsLdapListError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`sources_user_connections_ldap_partial_update`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum SourcesUserConnectionsLdapPartialUpdateError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`sources_user_connections_ldap_retrieve`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum SourcesUserConnectionsLdapRetrieveError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`sources_user_connections_ldap_update`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum SourcesUserConnectionsLdapUpdateError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`sources_user_connections_ldap_used_by_list`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum SourcesUserConnectionsLdapUsedByListError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`sources_user_connections_oauth_create`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum SourcesUserConnectionsOauthCreateError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`sources_user_connections_oauth_destroy`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum SourcesUserConnectionsOauthDestroyError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`sources_user_connections_oauth_list`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum SourcesUserConnectionsOauthListError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`sources_user_connections_oauth_partial_update`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum SourcesUserConnectionsOauthPartialUpdateError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`sources_user_connections_oauth_retrieve`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum SourcesUserConnectionsOauthRetrieveError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`sources_user_connections_oauth_update`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum SourcesUserConnectionsOauthUpdateError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`sources_user_connections_oauth_used_by_list`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum SourcesUserConnectionsOauthUsedByListError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`sources_user_connections_plex_create`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum SourcesUserConnectionsPlexCreateError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`sources_user_connections_plex_destroy`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum SourcesUserConnectionsPlexDestroyError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`sources_user_connections_plex_list`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum SourcesUserConnectionsPlexListError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`sources_user_connections_plex_partial_update`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum SourcesUserConnectionsPlexPartialUpdateError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`sources_user_connections_plex_retrieve`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum SourcesUserConnectionsPlexRetrieveError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`sources_user_connections_plex_update`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum SourcesUserConnectionsPlexUpdateError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`sources_user_connections_plex_used_by_list`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum SourcesUserConnectionsPlexUsedByListError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`sources_user_connections_saml_create`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum SourcesUserConnectionsSamlCreateError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`sources_user_connections_saml_destroy`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum SourcesUserConnectionsSamlDestroyError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`sources_user_connections_saml_list`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum SourcesUserConnectionsSamlListError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`sources_user_connections_saml_partial_update`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum SourcesUserConnectionsSamlPartialUpdateError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`sources_user_connections_saml_retrieve`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum SourcesUserConnectionsSamlRetrieveError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`sources_user_connections_saml_update`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum SourcesUserConnectionsSamlUpdateError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`sources_user_connections_saml_used_by_list`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum SourcesUserConnectionsSamlUsedByListError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`sources_user_connections_telegram_create`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum SourcesUserConnectionsTelegramCreateError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`sources_user_connections_telegram_destroy`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum SourcesUserConnectionsTelegramDestroyError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`sources_user_connections_telegram_list`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum SourcesUserConnectionsTelegramListError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`sources_user_connections_telegram_partial_update`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum SourcesUserConnectionsTelegramPartialUpdateError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`sources_user_connections_telegram_retrieve`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum SourcesUserConnectionsTelegramRetrieveError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`sources_user_connections_telegram_update`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum SourcesUserConnectionsTelegramUpdateError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`sources_user_connections_telegram_used_by_list`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum SourcesUserConnectionsTelegramUsedByListError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// Prevent deletion of built-in sources -pub async fn sources_all_destroy( - configuration: &configuration::Configuration, - slug: &str, -) -> Result<(), Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_slug = slug; - - let uri_str = format!( - "{}/sources/all/{slug}/", - configuration.base_path, - slug = crate::apis::urlencode(p_path_slug) - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::DELETE, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - - if !status.is_client_error() && !status.is_server_error() { - Ok(()) - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Source Viewset -pub async fn sources_all_list( - configuration: &configuration::Configuration, - managed: Option<&str>, - name: Option<&str>, - ordering: Option<&str>, - page: Option, - page_size: Option, - pbm_uuid: Option<&str>, - search: Option<&str>, - slug: Option<&str>, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_query_managed = managed; - let p_query_name = name; - let p_query_ordering = ordering; - let p_query_page = page; - let p_query_page_size = page_size; - let p_query_pbm_uuid = pbm_uuid; - let p_query_search = search; - let p_query_slug = slug; - - let uri_str = format!("{}/sources/all/", configuration.base_path); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref param_value) = p_query_managed { - req_builder = req_builder.query(&[("managed", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_name { - req_builder = req_builder.query(&[("name", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_ordering { - req_builder = req_builder.query(&[("ordering", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_page { - req_builder = req_builder.query(&[("page", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_page_size { - req_builder = req_builder.query(&[("page_size", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_pbm_uuid { - req_builder = req_builder.query(&[("pbm_uuid", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_search { - req_builder = req_builder.query(&[("search", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_slug { - req_builder = req_builder.query(&[("slug", ¶m_value.to_string())]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::PaginatedSourceList`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::PaginatedSourceList`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Source Viewset -pub async fn sources_all_retrieve( - configuration: &configuration::Configuration, - slug: &str, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_slug = slug; - - let uri_str = format!( - "{}/sources/all/{slug}/", - configuration.base_path, - slug = crate::apis::urlencode(p_path_slug) - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::Source`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::Source`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Get all creatable types -pub async fn sources_all_types_list( - configuration: &configuration::Configuration, -) -> Result, Error> { - let uri_str = format!("{}/sources/all/types/", configuration.base_path); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `Vec<models::TypeCreate>`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `Vec<models::TypeCreate>`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Get a list of all objects that use this object -pub async fn sources_all_used_by_list( - configuration: &configuration::Configuration, - slug: &str, -) -> Result, Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_slug = slug; - - let uri_str = format!( - "{}/sources/all/{slug}/used_by/", - configuration.base_path, - slug = crate::apis::urlencode(p_path_slug) - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `Vec<models::UsedBy>`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `Vec<models::UsedBy>`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Get all sources the user can configure -pub async fn sources_all_user_settings_list( - configuration: &configuration::Configuration, -) -> Result, Error> { - let uri_str = format!("{}/sources/all/user_settings/", configuration.base_path); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `Vec<models::UserSetting>`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `Vec<models::UserSetting>`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Group-source connection Viewset -pub async fn sources_group_connections_all_destroy( - configuration: &configuration::Configuration, - id: i32, -) -> Result<(), Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_id = id; - - let uri_str = format!( - "{}/sources/group_connections/all/{id}/", - configuration.base_path, - id = p_path_id - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::DELETE, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - - if !status.is_client_error() && !status.is_server_error() { - Ok(()) - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Group-source connection Viewset -pub async fn sources_group_connections_all_list( - configuration: &configuration::Configuration, - group: Option<&str>, - ordering: Option<&str>, - page: Option, - page_size: Option, - search: Option<&str>, - source__slug: Option<&str>, -) -> Result> -{ - // add a prefix to parameters to efficiently prevent name collisions - let p_query_group = group; - let p_query_ordering = ordering; - let p_query_page = page; - let p_query_page_size = page_size; - let p_query_search = search; - let p_query_source__slug = source__slug; - - let uri_str = format!("{}/sources/group_connections/all/", configuration.base_path); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref param_value) = p_query_group { - req_builder = req_builder.query(&[("group", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_ordering { - req_builder = req_builder.query(&[("ordering", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_page { - req_builder = req_builder.query(&[("page", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_page_size { - req_builder = req_builder.query(&[("page_size", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_search { - req_builder = req_builder.query(&[("search", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_source__slug { - req_builder = req_builder.query(&[("source__slug", ¶m_value.to_string())]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::PaginatedGroupSourceConnectionList`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::PaginatedGroupSourceConnectionList`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Group-source connection Viewset -pub async fn sources_group_connections_all_partial_update( - configuration: &configuration::Configuration, - id: i32, - patched_group_source_connection_request: Option, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_id = id; - let p_body_patched_group_source_connection_request = patched_group_source_connection_request; - - let uri_str = format!( - "{}/sources/group_connections/all/{id}/", - configuration.base_path, - id = p_path_id - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::PATCH, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - req_builder = req_builder.json(&p_body_patched_group_source_connection_request); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::GroupSourceConnection`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::GroupSourceConnection`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Group-source connection Viewset -pub async fn sources_group_connections_all_retrieve( - configuration: &configuration::Configuration, - id: i32, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_id = id; - - let uri_str = format!( - "{}/sources/group_connections/all/{id}/", - configuration.base_path, - id = p_path_id - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::GroupSourceConnection`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::GroupSourceConnection`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Group-source connection Viewset -pub async fn sources_group_connections_all_update( - configuration: &configuration::Configuration, - id: i32, - group_source_connection_request: models::GroupSourceConnectionRequest, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_id = id; - let p_body_group_source_connection_request = group_source_connection_request; - - let uri_str = format!( - "{}/sources/group_connections/all/{id}/", - configuration.base_path, - id = p_path_id - ); - let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - req_builder = req_builder.json(&p_body_group_source_connection_request); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::GroupSourceConnection`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::GroupSourceConnection`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Get a list of all objects that use this object -pub async fn sources_group_connections_all_used_by_list( - configuration: &configuration::Configuration, - id: i32, -) -> Result, Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_id = id; - - let uri_str = format!( - "{}/sources/group_connections/all/{id}/used_by/", - configuration.base_path, - id = p_path_id - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `Vec<models::UsedBy>`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `Vec<models::UsedBy>`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Group-source connection Viewset -pub async fn sources_group_connections_kerberos_create( - configuration: &configuration::Configuration, - group_kerberos_source_connection_request: models::GroupKerberosSourceConnectionRequest, -) -> Result> -{ - // add a prefix to parameters to efficiently prevent name collisions - let p_body_group_kerberos_source_connection_request = group_kerberos_source_connection_request; - - let uri_str = format!( - "{}/sources/group_connections/kerberos/", - configuration.base_path - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::POST, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - req_builder = req_builder.json(&p_body_group_kerberos_source_connection_request); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::GroupKerberosSourceConnection`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::GroupKerberosSourceConnection`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Group-source connection Viewset -pub async fn sources_group_connections_kerberos_destroy( - configuration: &configuration::Configuration, - id: i32, -) -> Result<(), Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_id = id; - - let uri_str = format!( - "{}/sources/group_connections/kerberos/{id}/", - configuration.base_path, - id = p_path_id - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::DELETE, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - - if !status.is_client_error() && !status.is_server_error() { - Ok(()) - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Group-source connection Viewset -pub async fn sources_group_connections_kerberos_list( - configuration: &configuration::Configuration, - group: Option<&str>, - ordering: Option<&str>, - page: Option, - page_size: Option, - search: Option<&str>, - source__slug: Option<&str>, -) -> Result< - models::PaginatedGroupKerberosSourceConnectionList, - Error, -> { - // add a prefix to parameters to efficiently prevent name collisions - let p_query_group = group; - let p_query_ordering = ordering; - let p_query_page = page; - let p_query_page_size = page_size; - let p_query_search = search; - let p_query_source__slug = source__slug; - - let uri_str = format!( - "{}/sources/group_connections/kerberos/", - configuration.base_path - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref param_value) = p_query_group { - req_builder = req_builder.query(&[("group", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_ordering { - req_builder = req_builder.query(&[("ordering", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_page { - req_builder = req_builder.query(&[("page", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_page_size { - req_builder = req_builder.query(&[("page_size", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_search { - req_builder = req_builder.query(&[("search", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_source__slug { - req_builder = req_builder.query(&[("source__slug", ¶m_value.to_string())]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::PaginatedGroupKerberosSourceConnectionList`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::PaginatedGroupKerberosSourceConnectionList`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Group-source connection Viewset -pub async fn sources_group_connections_kerberos_partial_update( - configuration: &configuration::Configuration, - id: i32, - patched_group_kerberos_source_connection_request: Option< - models::PatchedGroupKerberosSourceConnectionRequest, - >, -) -> Result< - models::GroupKerberosSourceConnection, - Error, -> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_id = id; - let p_body_patched_group_kerberos_source_connection_request = - patched_group_kerberos_source_connection_request; - - let uri_str = format!( - "{}/sources/group_connections/kerberos/{id}/", - configuration.base_path, - id = p_path_id - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::PATCH, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - req_builder = req_builder.json(&p_body_patched_group_kerberos_source_connection_request); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::GroupKerberosSourceConnection`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::GroupKerberosSourceConnection`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Group-source connection Viewset -pub async fn sources_group_connections_kerberos_retrieve( - configuration: &configuration::Configuration, - id: i32, -) -> Result< - models::GroupKerberosSourceConnection, - Error, -> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_id = id; - - let uri_str = format!( - "{}/sources/group_connections/kerberos/{id}/", - configuration.base_path, - id = p_path_id - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::GroupKerberosSourceConnection`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::GroupKerberosSourceConnection`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Group-source connection Viewset -pub async fn sources_group_connections_kerberos_update( - configuration: &configuration::Configuration, - id: i32, - group_kerberos_source_connection_request: models::GroupKerberosSourceConnectionRequest, -) -> Result> -{ - // add a prefix to parameters to efficiently prevent name collisions - let p_path_id = id; - let p_body_group_kerberos_source_connection_request = group_kerberos_source_connection_request; - - let uri_str = format!( - "{}/sources/group_connections/kerberos/{id}/", - configuration.base_path, - id = p_path_id - ); - let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - req_builder = req_builder.json(&p_body_group_kerberos_source_connection_request); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::GroupKerberosSourceConnection`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::GroupKerberosSourceConnection`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Get a list of all objects that use this object -pub async fn sources_group_connections_kerberos_used_by_list( - configuration: &configuration::Configuration, - id: i32, -) -> Result, Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_id = id; - - let uri_str = format!( - "{}/sources/group_connections/kerberos/{id}/used_by/", - configuration.base_path, - id = p_path_id - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `Vec<models::UsedBy>`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `Vec<models::UsedBy>`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Group-source connection Viewset -pub async fn sources_group_connections_ldap_create( - configuration: &configuration::Configuration, - group_ldap_source_connection_request: models::GroupLdapSourceConnectionRequest, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_body_group_ldap_source_connection_request = group_ldap_source_connection_request; - - let uri_str = format!( - "{}/sources/group_connections/ldap/", - configuration.base_path - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::POST, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - req_builder = req_builder.json(&p_body_group_ldap_source_connection_request); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::GroupLdapSourceConnection`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::GroupLdapSourceConnection`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Group-source connection Viewset -pub async fn sources_group_connections_ldap_destroy( - configuration: &configuration::Configuration, - id: i32, -) -> Result<(), Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_id = id; - - let uri_str = format!( - "{}/sources/group_connections/ldap/{id}/", - configuration.base_path, - id = p_path_id - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::DELETE, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - - if !status.is_client_error() && !status.is_server_error() { - Ok(()) - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Group-source connection Viewset -pub async fn sources_group_connections_ldap_list( - configuration: &configuration::Configuration, - group: Option<&str>, - ordering: Option<&str>, - page: Option, - page_size: Option, - search: Option<&str>, - source__slug: Option<&str>, -) -> Result< - models::PaginatedGroupLdapSourceConnectionList, - Error, -> { - // add a prefix to parameters to efficiently prevent name collisions - let p_query_group = group; - let p_query_ordering = ordering; - let p_query_page = page; - let p_query_page_size = page_size; - let p_query_search = search; - let p_query_source__slug = source__slug; - - let uri_str = format!( - "{}/sources/group_connections/ldap/", - configuration.base_path - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref param_value) = p_query_group { - req_builder = req_builder.query(&[("group", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_ordering { - req_builder = req_builder.query(&[("ordering", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_page { - req_builder = req_builder.query(&[("page", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_page_size { - req_builder = req_builder.query(&[("page_size", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_search { - req_builder = req_builder.query(&[("search", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_source__slug { - req_builder = req_builder.query(&[("source__slug", ¶m_value.to_string())]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::PaginatedGroupLdapSourceConnectionList`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::PaginatedGroupLdapSourceConnectionList`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Group-source connection Viewset -pub async fn sources_group_connections_ldap_partial_update( - configuration: &configuration::Configuration, - id: i32, - patched_group_ldap_source_connection_request: Option< - models::PatchedGroupLdapSourceConnectionRequest, - >, -) -> Result> -{ - // add a prefix to parameters to efficiently prevent name collisions - let p_path_id = id; - let p_body_patched_group_ldap_source_connection_request = - patched_group_ldap_source_connection_request; - - let uri_str = format!( - "{}/sources/group_connections/ldap/{id}/", - configuration.base_path, - id = p_path_id - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::PATCH, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - req_builder = req_builder.json(&p_body_patched_group_ldap_source_connection_request); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::GroupLdapSourceConnection`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::GroupLdapSourceConnection`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Group-source connection Viewset -pub async fn sources_group_connections_ldap_retrieve( - configuration: &configuration::Configuration, - id: i32, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_id = id; - - let uri_str = format!( - "{}/sources/group_connections/ldap/{id}/", - configuration.base_path, - id = p_path_id - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::GroupLdapSourceConnection`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::GroupLdapSourceConnection`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Group-source connection Viewset -pub async fn sources_group_connections_ldap_update( - configuration: &configuration::Configuration, - id: i32, - group_ldap_source_connection_request: models::GroupLdapSourceConnectionRequest, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_id = id; - let p_body_group_ldap_source_connection_request = group_ldap_source_connection_request; - - let uri_str = format!( - "{}/sources/group_connections/ldap/{id}/", - configuration.base_path, - id = p_path_id - ); - let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - req_builder = req_builder.json(&p_body_group_ldap_source_connection_request); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::GroupLdapSourceConnection`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::GroupLdapSourceConnection`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Get a list of all objects that use this object -pub async fn sources_group_connections_ldap_used_by_list( - configuration: &configuration::Configuration, - id: i32, -) -> Result, Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_id = id; - - let uri_str = format!( - "{}/sources/group_connections/ldap/{id}/used_by/", - configuration.base_path, - id = p_path_id - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `Vec<models::UsedBy>`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `Vec<models::UsedBy>`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Group-source connection Viewset -pub async fn sources_group_connections_oauth_create( - configuration: &configuration::Configuration, - group_o_auth_source_connection_request: models::GroupOAuthSourceConnectionRequest, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_body_group_o_auth_source_connection_request = group_o_auth_source_connection_request; - - let uri_str = format!( - "{}/sources/group_connections/oauth/", - configuration.base_path - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::POST, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - req_builder = req_builder.json(&p_body_group_o_auth_source_connection_request); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::GroupOAuthSourceConnection`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::GroupOAuthSourceConnection`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Group-source connection Viewset -pub async fn sources_group_connections_oauth_destroy( - configuration: &configuration::Configuration, - id: i32, -) -> Result<(), Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_id = id; - - let uri_str = format!( - "{}/sources/group_connections/oauth/{id}/", - configuration.base_path, - id = p_path_id - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::DELETE, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - - if !status.is_client_error() && !status.is_server_error() { - Ok(()) - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Group-source connection Viewset -pub async fn sources_group_connections_oauth_list( - configuration: &configuration::Configuration, - group: Option<&str>, - ordering: Option<&str>, - page: Option, - page_size: Option, - search: Option<&str>, - source__slug: Option<&str>, -) -> Result< - models::PaginatedGroupOAuthSourceConnectionList, - Error, -> { - // add a prefix to parameters to efficiently prevent name collisions - let p_query_group = group; - let p_query_ordering = ordering; - let p_query_page = page; - let p_query_page_size = page_size; - let p_query_search = search; - let p_query_source__slug = source__slug; - - let uri_str = format!( - "{}/sources/group_connections/oauth/", - configuration.base_path - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref param_value) = p_query_group { - req_builder = req_builder.query(&[("group", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_ordering { - req_builder = req_builder.query(&[("ordering", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_page { - req_builder = req_builder.query(&[("page", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_page_size { - req_builder = req_builder.query(&[("page_size", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_search { - req_builder = req_builder.query(&[("search", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_source__slug { - req_builder = req_builder.query(&[("source__slug", ¶m_value.to_string())]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::PaginatedGroupOAuthSourceConnectionList`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::PaginatedGroupOAuthSourceConnectionList`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Group-source connection Viewset -pub async fn sources_group_connections_oauth_partial_update( - configuration: &configuration::Configuration, - id: i32, - patched_group_o_auth_source_connection_request: Option< - models::PatchedGroupOAuthSourceConnectionRequest, - >, -) -> Result> -{ - // add a prefix to parameters to efficiently prevent name collisions - let p_path_id = id; - let p_body_patched_group_o_auth_source_connection_request = - patched_group_o_auth_source_connection_request; - - let uri_str = format!( - "{}/sources/group_connections/oauth/{id}/", - configuration.base_path, - id = p_path_id - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::PATCH, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - req_builder = req_builder.json(&p_body_patched_group_o_auth_source_connection_request); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::GroupOAuthSourceConnection`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::GroupOAuthSourceConnection`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Group-source connection Viewset -pub async fn sources_group_connections_oauth_retrieve( - configuration: &configuration::Configuration, - id: i32, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_id = id; - - let uri_str = format!( - "{}/sources/group_connections/oauth/{id}/", - configuration.base_path, - id = p_path_id - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::GroupOAuthSourceConnection`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::GroupOAuthSourceConnection`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Group-source connection Viewset -pub async fn sources_group_connections_oauth_update( - configuration: &configuration::Configuration, - id: i32, - group_o_auth_source_connection_request: models::GroupOAuthSourceConnectionRequest, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_id = id; - let p_body_group_o_auth_source_connection_request = group_o_auth_source_connection_request; - - let uri_str = format!( - "{}/sources/group_connections/oauth/{id}/", - configuration.base_path, - id = p_path_id - ); - let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - req_builder = req_builder.json(&p_body_group_o_auth_source_connection_request); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::GroupOAuthSourceConnection`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::GroupOAuthSourceConnection`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Get a list of all objects that use this object -pub async fn sources_group_connections_oauth_used_by_list( - configuration: &configuration::Configuration, - id: i32, -) -> Result, Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_id = id; - - let uri_str = format!( - "{}/sources/group_connections/oauth/{id}/used_by/", - configuration.base_path, - id = p_path_id - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `Vec<models::UsedBy>`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `Vec<models::UsedBy>`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Group-source connection Viewset -pub async fn sources_group_connections_plex_create( - configuration: &configuration::Configuration, - group_plex_source_connection_request: models::GroupPlexSourceConnectionRequest, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_body_group_plex_source_connection_request = group_plex_source_connection_request; - - let uri_str = format!( - "{}/sources/group_connections/plex/", - configuration.base_path - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::POST, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - req_builder = req_builder.json(&p_body_group_plex_source_connection_request); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::GroupPlexSourceConnection`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::GroupPlexSourceConnection`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Group-source connection Viewset -pub async fn sources_group_connections_plex_destroy( - configuration: &configuration::Configuration, - id: i32, -) -> Result<(), Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_id = id; - - let uri_str = format!( - "{}/sources/group_connections/plex/{id}/", - configuration.base_path, - id = p_path_id - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::DELETE, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - - if !status.is_client_error() && !status.is_server_error() { - Ok(()) - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Group-source connection Viewset -pub async fn sources_group_connections_plex_list( - configuration: &configuration::Configuration, - group: Option<&str>, - ordering: Option<&str>, - page: Option, - page_size: Option, - search: Option<&str>, - source__slug: Option<&str>, -) -> Result< - models::PaginatedGroupPlexSourceConnectionList, - Error, -> { - // add a prefix to parameters to efficiently prevent name collisions - let p_query_group = group; - let p_query_ordering = ordering; - let p_query_page = page; - let p_query_page_size = page_size; - let p_query_search = search; - let p_query_source__slug = source__slug; - - let uri_str = format!( - "{}/sources/group_connections/plex/", - configuration.base_path - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref param_value) = p_query_group { - req_builder = req_builder.query(&[("group", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_ordering { - req_builder = req_builder.query(&[("ordering", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_page { - req_builder = req_builder.query(&[("page", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_page_size { - req_builder = req_builder.query(&[("page_size", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_search { - req_builder = req_builder.query(&[("search", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_source__slug { - req_builder = req_builder.query(&[("source__slug", ¶m_value.to_string())]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::PaginatedGroupPlexSourceConnectionList`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::PaginatedGroupPlexSourceConnectionList`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Group-source connection Viewset -pub async fn sources_group_connections_plex_partial_update( - configuration: &configuration::Configuration, - id: i32, - patched_group_plex_source_connection_request: Option< - models::PatchedGroupPlexSourceConnectionRequest, - >, -) -> Result> -{ - // add a prefix to parameters to efficiently prevent name collisions - let p_path_id = id; - let p_body_patched_group_plex_source_connection_request = - patched_group_plex_source_connection_request; - - let uri_str = format!( - "{}/sources/group_connections/plex/{id}/", - configuration.base_path, - id = p_path_id - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::PATCH, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - req_builder = req_builder.json(&p_body_patched_group_plex_source_connection_request); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::GroupPlexSourceConnection`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::GroupPlexSourceConnection`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Group-source connection Viewset -pub async fn sources_group_connections_plex_retrieve( - configuration: &configuration::Configuration, - id: i32, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_id = id; - - let uri_str = format!( - "{}/sources/group_connections/plex/{id}/", - configuration.base_path, - id = p_path_id - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::GroupPlexSourceConnection`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::GroupPlexSourceConnection`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Group-source connection Viewset -pub async fn sources_group_connections_plex_update( - configuration: &configuration::Configuration, - id: i32, - group_plex_source_connection_request: models::GroupPlexSourceConnectionRequest, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_id = id; - let p_body_group_plex_source_connection_request = group_plex_source_connection_request; - - let uri_str = format!( - "{}/sources/group_connections/plex/{id}/", - configuration.base_path, - id = p_path_id - ); - let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - req_builder = req_builder.json(&p_body_group_plex_source_connection_request); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::GroupPlexSourceConnection`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::GroupPlexSourceConnection`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Get a list of all objects that use this object -pub async fn sources_group_connections_plex_used_by_list( - configuration: &configuration::Configuration, - id: i32, -) -> Result, Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_id = id; - - let uri_str = format!( - "{}/sources/group_connections/plex/{id}/used_by/", - configuration.base_path, - id = p_path_id - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `Vec<models::UsedBy>`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `Vec<models::UsedBy>`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Group-source connection Viewset -pub async fn sources_group_connections_saml_create( - configuration: &configuration::Configuration, - group_saml_source_connection_request: models::GroupSamlSourceConnectionRequest, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_body_group_saml_source_connection_request = group_saml_source_connection_request; - - let uri_str = format!( - "{}/sources/group_connections/saml/", - configuration.base_path - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::POST, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - req_builder = req_builder.json(&p_body_group_saml_source_connection_request); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::GroupSamlSourceConnection`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::GroupSamlSourceConnection`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Group-source connection Viewset -pub async fn sources_group_connections_saml_destroy( - configuration: &configuration::Configuration, - id: i32, -) -> Result<(), Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_id = id; - - let uri_str = format!( - "{}/sources/group_connections/saml/{id}/", - configuration.base_path, - id = p_path_id - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::DELETE, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - - if !status.is_client_error() && !status.is_server_error() { - Ok(()) - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Group-source connection Viewset -pub async fn sources_group_connections_saml_list( - configuration: &configuration::Configuration, - group: Option<&str>, - ordering: Option<&str>, - page: Option, - page_size: Option, - search: Option<&str>, - source__slug: Option<&str>, -) -> Result< - models::PaginatedGroupSamlSourceConnectionList, - Error, -> { - // add a prefix to parameters to efficiently prevent name collisions - let p_query_group = group; - let p_query_ordering = ordering; - let p_query_page = page; - let p_query_page_size = page_size; - let p_query_search = search; - let p_query_source__slug = source__slug; - - let uri_str = format!( - "{}/sources/group_connections/saml/", - configuration.base_path - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref param_value) = p_query_group { - req_builder = req_builder.query(&[("group", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_ordering { - req_builder = req_builder.query(&[("ordering", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_page { - req_builder = req_builder.query(&[("page", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_page_size { - req_builder = req_builder.query(&[("page_size", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_search { - req_builder = req_builder.query(&[("search", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_source__slug { - req_builder = req_builder.query(&[("source__slug", ¶m_value.to_string())]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::PaginatedGroupSamlSourceConnectionList`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::PaginatedGroupSamlSourceConnectionList`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Group-source connection Viewset -pub async fn sources_group_connections_saml_partial_update( - configuration: &configuration::Configuration, - id: i32, - patched_group_saml_source_connection_request: Option< - models::PatchedGroupSamlSourceConnectionRequest, - >, -) -> Result> -{ - // add a prefix to parameters to efficiently prevent name collisions - let p_path_id = id; - let p_body_patched_group_saml_source_connection_request = - patched_group_saml_source_connection_request; - - let uri_str = format!( - "{}/sources/group_connections/saml/{id}/", - configuration.base_path, - id = p_path_id - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::PATCH, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - req_builder = req_builder.json(&p_body_patched_group_saml_source_connection_request); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::GroupSamlSourceConnection`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::GroupSamlSourceConnection`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Group-source connection Viewset -pub async fn sources_group_connections_saml_retrieve( - configuration: &configuration::Configuration, - id: i32, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_id = id; - - let uri_str = format!( - "{}/sources/group_connections/saml/{id}/", - configuration.base_path, - id = p_path_id - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::GroupSamlSourceConnection`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::GroupSamlSourceConnection`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Group-source connection Viewset -pub async fn sources_group_connections_saml_update( - configuration: &configuration::Configuration, - id: i32, - group_saml_source_connection_request: models::GroupSamlSourceConnectionRequest, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_id = id; - let p_body_group_saml_source_connection_request = group_saml_source_connection_request; - - let uri_str = format!( - "{}/sources/group_connections/saml/{id}/", - configuration.base_path, - id = p_path_id - ); - let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - req_builder = req_builder.json(&p_body_group_saml_source_connection_request); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::GroupSamlSourceConnection`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::GroupSamlSourceConnection`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Get a list of all objects that use this object -pub async fn sources_group_connections_saml_used_by_list( - configuration: &configuration::Configuration, - id: i32, -) -> Result, Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_id = id; - - let uri_str = format!( - "{}/sources/group_connections/saml/{id}/used_by/", - configuration.base_path, - id = p_path_id - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `Vec<models::UsedBy>`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `Vec<models::UsedBy>`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Group-source connection Viewset -pub async fn sources_group_connections_telegram_create( - configuration: &configuration::Configuration, - group_telegram_source_connection_request: models::GroupTelegramSourceConnectionRequest, -) -> Result> -{ - // add a prefix to parameters to efficiently prevent name collisions - let p_body_group_telegram_source_connection_request = group_telegram_source_connection_request; - - let uri_str = format!( - "{}/sources/group_connections/telegram/", - configuration.base_path - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::POST, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - req_builder = req_builder.json(&p_body_group_telegram_source_connection_request); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::GroupTelegramSourceConnection`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::GroupTelegramSourceConnection`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Group-source connection Viewset -pub async fn sources_group_connections_telegram_destroy( - configuration: &configuration::Configuration, - id: i32, -) -> Result<(), Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_id = id; - - let uri_str = format!( - "{}/sources/group_connections/telegram/{id}/", - configuration.base_path, - id = p_path_id - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::DELETE, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - - if !status.is_client_error() && !status.is_server_error() { - Ok(()) - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Group-source connection Viewset -pub async fn sources_group_connections_telegram_list( - configuration: &configuration::Configuration, - group: Option<&str>, - ordering: Option<&str>, - page: Option, - page_size: Option, - search: Option<&str>, - source__slug: Option<&str>, -) -> Result< - models::PaginatedGroupTelegramSourceConnectionList, - Error, -> { - // add a prefix to parameters to efficiently prevent name collisions - let p_query_group = group; - let p_query_ordering = ordering; - let p_query_page = page; - let p_query_page_size = page_size; - let p_query_search = search; - let p_query_source__slug = source__slug; - - let uri_str = format!( - "{}/sources/group_connections/telegram/", - configuration.base_path - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref param_value) = p_query_group { - req_builder = req_builder.query(&[("group", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_ordering { - req_builder = req_builder.query(&[("ordering", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_page { - req_builder = req_builder.query(&[("page", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_page_size { - req_builder = req_builder.query(&[("page_size", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_search { - req_builder = req_builder.query(&[("search", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_source__slug { - req_builder = req_builder.query(&[("source__slug", ¶m_value.to_string())]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::PaginatedGroupTelegramSourceConnectionList`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::PaginatedGroupTelegramSourceConnectionList`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Group-source connection Viewset -pub async fn sources_group_connections_telegram_partial_update( - configuration: &configuration::Configuration, - id: i32, - patched_group_telegram_source_connection_request: Option< - models::PatchedGroupTelegramSourceConnectionRequest, - >, -) -> Result< - models::GroupTelegramSourceConnection, - Error, -> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_id = id; - let p_body_patched_group_telegram_source_connection_request = - patched_group_telegram_source_connection_request; - - let uri_str = format!( - "{}/sources/group_connections/telegram/{id}/", - configuration.base_path, - id = p_path_id - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::PATCH, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - req_builder = req_builder.json(&p_body_patched_group_telegram_source_connection_request); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::GroupTelegramSourceConnection`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::GroupTelegramSourceConnection`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Group-source connection Viewset -pub async fn sources_group_connections_telegram_retrieve( - configuration: &configuration::Configuration, - id: i32, -) -> Result< - models::GroupTelegramSourceConnection, - Error, -> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_id = id; - - let uri_str = format!( - "{}/sources/group_connections/telegram/{id}/", - configuration.base_path, - id = p_path_id - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::GroupTelegramSourceConnection`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::GroupTelegramSourceConnection`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Group-source connection Viewset -pub async fn sources_group_connections_telegram_update( - configuration: &configuration::Configuration, - id: i32, - group_telegram_source_connection_request: models::GroupTelegramSourceConnectionRequest, -) -> Result> -{ - // add a prefix to parameters to efficiently prevent name collisions - let p_path_id = id; - let p_body_group_telegram_source_connection_request = group_telegram_source_connection_request; - - let uri_str = format!( - "{}/sources/group_connections/telegram/{id}/", - configuration.base_path, - id = p_path_id - ); - let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - req_builder = req_builder.json(&p_body_group_telegram_source_connection_request); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::GroupTelegramSourceConnection`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::GroupTelegramSourceConnection`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Get a list of all objects that use this object -pub async fn sources_group_connections_telegram_used_by_list( - configuration: &configuration::Configuration, - id: i32, -) -> Result, Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_id = id; - - let uri_str = format!( - "{}/sources/group_connections/telegram/{id}/used_by/", - configuration.base_path, - id = p_path_id - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `Vec<models::UsedBy>`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `Vec<models::UsedBy>`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Kerberos Source Viewset -pub async fn sources_kerberos_create( - configuration: &configuration::Configuration, - kerberos_source_request: models::KerberosSourceRequest, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_body_kerberos_source_request = kerberos_source_request; - - let uri_str = format!("{}/sources/kerberos/", configuration.base_path); - let mut req_builder = configuration - .client - .request(reqwest::Method::POST, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - req_builder = req_builder.json(&p_body_kerberos_source_request); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::KerberosSource`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::KerberosSource`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Kerberos Source Viewset -pub async fn sources_kerberos_destroy( - configuration: &configuration::Configuration, - slug: &str, -) -> Result<(), Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_slug = slug; - - let uri_str = format!( - "{}/sources/kerberos/{slug}/", - configuration.base_path, - slug = crate::apis::urlencode(p_path_slug) - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::DELETE, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - - if !status.is_client_error() && !status.is_server_error() { - Ok(()) - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Kerberos Source Viewset -pub async fn sources_kerberos_list( - configuration: &configuration::Configuration, - enabled: Option, - kadmin_type: Option, - name: Option<&str>, - ordering: Option<&str>, - page: Option, - page_size: Option, - password_login_update_internal_password: Option, - pbm_uuid: Option<&str>, - realm: Option<&str>, - search: Option<&str>, - slug: Option<&str>, - spnego_server_name: Option<&str>, - sync_principal: Option<&str>, - sync_users: Option, - sync_users_password: Option, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_query_enabled = enabled; - let p_query_kadmin_type = kadmin_type; - let p_query_name = name; - let p_query_ordering = ordering; - let p_query_page = page; - let p_query_page_size = page_size; - let p_query_password_login_update_internal_password = password_login_update_internal_password; - let p_query_pbm_uuid = pbm_uuid; - let p_query_realm = realm; - let p_query_search = search; - let p_query_slug = slug; - let p_query_spnego_server_name = spnego_server_name; - let p_query_sync_principal = sync_principal; - let p_query_sync_users = sync_users; - let p_query_sync_users_password = sync_users_password; - - let uri_str = format!("{}/sources/kerberos/", configuration.base_path); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref param_value) = p_query_enabled { - req_builder = req_builder.query(&[("enabled", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_kadmin_type { - req_builder = req_builder.query(&[("kadmin_type", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_name { - req_builder = req_builder.query(&[("name", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_ordering { - req_builder = req_builder.query(&[("ordering", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_page { - req_builder = req_builder.query(&[("page", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_page_size { - req_builder = req_builder.query(&[("page_size", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_password_login_update_internal_password { - req_builder = req_builder.query(&[( - "password_login_update_internal_password", - ¶m_value.to_string(), - )]); - } - if let Some(ref param_value) = p_query_pbm_uuid { - req_builder = req_builder.query(&[("pbm_uuid", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_realm { - req_builder = req_builder.query(&[("realm", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_search { - req_builder = req_builder.query(&[("search", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_slug { - req_builder = req_builder.query(&[("slug", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_spnego_server_name { - req_builder = req_builder.query(&[("spnego_server_name", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_sync_principal { - req_builder = req_builder.query(&[("sync_principal", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_sync_users { - req_builder = req_builder.query(&[("sync_users", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_sync_users_password { - req_builder = req_builder.query(&[("sync_users_password", ¶m_value.to_string())]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::PaginatedKerberosSourceList`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::PaginatedKerberosSourceList`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Kerberos Source Viewset -pub async fn sources_kerberos_partial_update( - configuration: &configuration::Configuration, - slug: &str, - patched_kerberos_source_request: Option, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_slug = slug; - let p_body_patched_kerberos_source_request = patched_kerberos_source_request; - - let uri_str = format!( - "{}/sources/kerberos/{slug}/", - configuration.base_path, - slug = crate::apis::urlencode(p_path_slug) - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::PATCH, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - req_builder = req_builder.json(&p_body_patched_kerberos_source_request); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::KerberosSource`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::KerberosSource`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Kerberos Source Viewset -pub async fn sources_kerberos_retrieve( - configuration: &configuration::Configuration, - slug: &str, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_slug = slug; - - let uri_str = format!( - "{}/sources/kerberos/{slug}/", - configuration.base_path, - slug = crate::apis::urlencode(p_path_slug) - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::KerberosSource`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::KerberosSource`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Get provider's sync status -pub async fn sources_kerberos_sync_status_retrieve( - configuration: &configuration::Configuration, - slug: &str, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_slug = slug; - - let uri_str = format!( - "{}/sources/kerberos/{slug}/sync/status/", - configuration.base_path, - slug = crate::apis::urlencode(p_path_slug) - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::SyncStatus`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::SyncStatus`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Kerberos Source Viewset -pub async fn sources_kerberos_update( - configuration: &configuration::Configuration, - slug: &str, - kerberos_source_request: models::KerberosSourceRequest, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_slug = slug; - let p_body_kerberos_source_request = kerberos_source_request; - - let uri_str = format!( - "{}/sources/kerberos/{slug}/", - configuration.base_path, - slug = crate::apis::urlencode(p_path_slug) - ); - let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - req_builder = req_builder.json(&p_body_kerberos_source_request); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::KerberosSource`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::KerberosSource`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Get a list of all objects that use this object -pub async fn sources_kerberos_used_by_list( - configuration: &configuration::Configuration, - slug: &str, -) -> Result, Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_slug = slug; - - let uri_str = format!( - "{}/sources/kerberos/{slug}/used_by/", - configuration.base_path, - slug = crate::apis::urlencode(p_path_slug) - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `Vec<models::UsedBy>`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `Vec<models::UsedBy>`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// LDAP Source Viewset -pub async fn sources_ldap_create( - configuration: &configuration::Configuration, - ldap_source_request: models::LdapSourceRequest, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_body_ldap_source_request = ldap_source_request; - - let uri_str = format!("{}/sources/ldap/", configuration.base_path); - let mut req_builder = configuration - .client - .request(reqwest::Method::POST, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - req_builder = req_builder.json(&p_body_ldap_source_request); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::LdapSource`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::LdapSource`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Get raw LDAP data to debug -pub async fn sources_ldap_debug_retrieve( - configuration: &configuration::Configuration, - slug: &str, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_slug = slug; - - let uri_str = format!( - "{}/sources/ldap/{slug}/debug/", - configuration.base_path, - slug = crate::apis::urlencode(p_path_slug) - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::LdapDebug`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::LdapDebug`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// LDAP Source Viewset -pub async fn sources_ldap_destroy( - configuration: &configuration::Configuration, - slug: &str, -) -> Result<(), Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_slug = slug; - - let uri_str = format!( - "{}/sources/ldap/{slug}/", - configuration.base_path, - slug = crate::apis::urlencode(p_path_slug) - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::DELETE, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - - if !status.is_client_error() && !status.is_server_error() { - Ok(()) - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// LDAP Source Viewset -pub async fn sources_ldap_list( - configuration: &configuration::Configuration, - additional_group_dn: Option<&str>, - additional_user_dn: Option<&str>, - base_dn: Option<&str>, - bind_cn: Option<&str>, - client_certificate: Option<&str>, - delete_not_found_objects: Option, - enabled: Option, - group_membership_field: Option<&str>, - group_object_filter: Option<&str>, - group_property_mappings: Option>, - lookup_groups_from_user: Option, - name: Option<&str>, - object_uniqueness_field: Option<&str>, - ordering: Option<&str>, - page: Option, - page_size: Option, - password_login_update_internal_password: Option, - pbm_uuid: Option<&str>, - peer_certificate: Option<&str>, - search: Option<&str>, - server_uri: Option<&str>, - slug: Option<&str>, - sni: Option, - start_tls: Option, - sync_groups: Option, - sync_parent_group: Option<&str>, - sync_users: Option, - sync_users_password: Option, - user_membership_attribute: Option<&str>, - user_object_filter: Option<&str>, - user_property_mappings: Option>, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_query_additional_group_dn = additional_group_dn; - let p_query_additional_user_dn = additional_user_dn; - let p_query_base_dn = base_dn; - let p_query_bind_cn = bind_cn; - let p_query_client_certificate = client_certificate; - let p_query_delete_not_found_objects = delete_not_found_objects; - let p_query_enabled = enabled; - let p_query_group_membership_field = group_membership_field; - let p_query_group_object_filter = group_object_filter; - let p_query_group_property_mappings = group_property_mappings; - let p_query_lookup_groups_from_user = lookup_groups_from_user; - let p_query_name = name; - let p_query_object_uniqueness_field = object_uniqueness_field; - let p_query_ordering = ordering; - let p_query_page = page; - let p_query_page_size = page_size; - let p_query_password_login_update_internal_password = password_login_update_internal_password; - let p_query_pbm_uuid = pbm_uuid; - let p_query_peer_certificate = peer_certificate; - let p_query_search = search; - let p_query_server_uri = server_uri; - let p_query_slug = slug; - let p_query_sni = sni; - let p_query_start_tls = start_tls; - let p_query_sync_groups = sync_groups; - let p_query_sync_parent_group = sync_parent_group; - let p_query_sync_users = sync_users; - let p_query_sync_users_password = sync_users_password; - let p_query_user_membership_attribute = user_membership_attribute; - let p_query_user_object_filter = user_object_filter; - let p_query_user_property_mappings = user_property_mappings; - - let uri_str = format!("{}/sources/ldap/", configuration.base_path); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref param_value) = p_query_additional_group_dn { - req_builder = req_builder.query(&[("additional_group_dn", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_additional_user_dn { - req_builder = req_builder.query(&[("additional_user_dn", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_base_dn { - req_builder = req_builder.query(&[("base_dn", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_bind_cn { - req_builder = req_builder.query(&[("bind_cn", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_client_certificate { - req_builder = req_builder.query(&[("client_certificate", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_delete_not_found_objects { - req_builder = req_builder.query(&[("delete_not_found_objects", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_enabled { - req_builder = req_builder.query(&[("enabled", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_group_membership_field { - req_builder = req_builder.query(&[("group_membership_field", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_group_object_filter { - req_builder = req_builder.query(&[("group_object_filter", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_group_property_mappings { - req_builder = match "multi" { - "multi" => req_builder.query( - ¶m_value - .into_iter() - .map(|p| ("group_property_mappings".to_owned(), p.to_string())) - .collect::>(), - ), - _ => req_builder.query(&[( - "group_property_mappings", - ¶m_value - .into_iter() - .map(|p| p.to_string()) - .collect::>() - .join(",") - .to_string(), - )]), - }; - } - if let Some(ref param_value) = p_query_lookup_groups_from_user { - req_builder = req_builder.query(&[("lookup_groups_from_user", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_name { - req_builder = req_builder.query(&[("name", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_object_uniqueness_field { - req_builder = req_builder.query(&[("object_uniqueness_field", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_ordering { - req_builder = req_builder.query(&[("ordering", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_page { - req_builder = req_builder.query(&[("page", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_page_size { - req_builder = req_builder.query(&[("page_size", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_password_login_update_internal_password { - req_builder = req_builder.query(&[( - "password_login_update_internal_password", - ¶m_value.to_string(), - )]); - } - if let Some(ref param_value) = p_query_pbm_uuid { - req_builder = req_builder.query(&[("pbm_uuid", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_peer_certificate { - req_builder = req_builder.query(&[("peer_certificate", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_search { - req_builder = req_builder.query(&[("search", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_server_uri { - req_builder = req_builder.query(&[("server_uri", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_slug { - req_builder = req_builder.query(&[("slug", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_sni { - req_builder = req_builder.query(&[("sni", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_start_tls { - req_builder = req_builder.query(&[("start_tls", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_sync_groups { - req_builder = req_builder.query(&[("sync_groups", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_sync_parent_group { - req_builder = req_builder.query(&[("sync_parent_group", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_sync_users { - req_builder = req_builder.query(&[("sync_users", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_sync_users_password { - req_builder = req_builder.query(&[("sync_users_password", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_user_membership_attribute { - req_builder = req_builder.query(&[("user_membership_attribute", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_user_object_filter { - req_builder = req_builder.query(&[("user_object_filter", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_user_property_mappings { - req_builder = match "multi" { - "multi" => req_builder.query( - ¶m_value - .into_iter() - .map(|p| ("user_property_mappings".to_owned(), p.to_string())) - .collect::>(), - ), - _ => req_builder.query(&[( - "user_property_mappings", - ¶m_value - .into_iter() - .map(|p| p.to_string()) - .collect::>() - .join(",") - .to_string(), - )]), - }; - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::PaginatedLdapSourceList`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::PaginatedLdapSourceList`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// LDAP Source Viewset -pub async fn sources_ldap_partial_update( - configuration: &configuration::Configuration, - slug: &str, - patched_ldap_source_request: Option, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_slug = slug; - let p_body_patched_ldap_source_request = patched_ldap_source_request; - - let uri_str = format!( - "{}/sources/ldap/{slug}/", - configuration.base_path, - slug = crate::apis::urlencode(p_path_slug) - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::PATCH, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - req_builder = req_builder.json(&p_body_patched_ldap_source_request); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::LdapSource`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::LdapSource`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// LDAP Source Viewset -pub async fn sources_ldap_retrieve( - configuration: &configuration::Configuration, - slug: &str, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_slug = slug; - - let uri_str = format!( - "{}/sources/ldap/{slug}/", - configuration.base_path, - slug = crate::apis::urlencode(p_path_slug) - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::LdapSource`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::LdapSource`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Get provider's sync status -pub async fn sources_ldap_sync_status_retrieve( - configuration: &configuration::Configuration, - slug: &str, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_slug = slug; - - let uri_str = format!( - "{}/sources/ldap/{slug}/sync/status/", - configuration.base_path, - slug = crate::apis::urlencode(p_path_slug) - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::SyncStatus`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::SyncStatus`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// LDAP Source Viewset -pub async fn sources_ldap_update( - configuration: &configuration::Configuration, - slug: &str, - ldap_source_request: models::LdapSourceRequest, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_slug = slug; - let p_body_ldap_source_request = ldap_source_request; - - let uri_str = format!( - "{}/sources/ldap/{slug}/", - configuration.base_path, - slug = crate::apis::urlencode(p_path_slug) - ); - let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - req_builder = req_builder.json(&p_body_ldap_source_request); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::LdapSource`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::LdapSource`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Get a list of all objects that use this object -pub async fn sources_ldap_used_by_list( - configuration: &configuration::Configuration, - slug: &str, -) -> Result, Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_slug = slug; - - let uri_str = format!( - "{}/sources/ldap/{slug}/used_by/", - configuration.base_path, - slug = crate::apis::urlencode(p_path_slug) - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `Vec<models::UsedBy>`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `Vec<models::UsedBy>`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Source Viewset -pub async fn sources_oauth_create( - configuration: &configuration::Configuration, - o_auth_source_request: models::OAuthSourceRequest, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_body_o_auth_source_request = o_auth_source_request; - - let uri_str = format!("{}/sources/oauth/", configuration.base_path); - let mut req_builder = configuration - .client - .request(reqwest::Method::POST, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - req_builder = req_builder.json(&p_body_o_auth_source_request); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::OAuthSource`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::OAuthSource`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Source Viewset -pub async fn sources_oauth_destroy( - configuration: &configuration::Configuration, - slug: &str, -) -> Result<(), Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_slug = slug; - - let uri_str = format!( - "{}/sources/oauth/{slug}/", - configuration.base_path, - slug = crate::apis::urlencode(p_path_slug) - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::DELETE, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - - if !status.is_client_error() && !status.is_server_error() { - Ok(()) - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Source Viewset -pub async fn sources_oauth_list( - configuration: &configuration::Configuration, - access_token_url: Option<&str>, - additional_scopes: Option<&str>, - authentication_flow: Option<&str>, - authorization_url: Option<&str>, - consumer_key: Option<&str>, - enabled: Option, - enrollment_flow: Option<&str>, - group_matching_mode: Option, - has_jwks: Option, - name: Option<&str>, - ordering: Option<&str>, - page: Option, - page_size: Option, - pbm_uuid: Option<&str>, - policy_engine_mode: Option, - profile_url: Option<&str>, - provider_type: Option<&str>, - request_token_url: Option<&str>, - search: Option<&str>, - slug: Option<&str>, - user_matching_mode: Option, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_query_access_token_url = access_token_url; - let p_query_additional_scopes = additional_scopes; - let p_query_authentication_flow = authentication_flow; - let p_query_authorization_url = authorization_url; - let p_query_consumer_key = consumer_key; - let p_query_enabled = enabled; - let p_query_enrollment_flow = enrollment_flow; - let p_query_group_matching_mode = group_matching_mode; - let p_query_has_jwks = has_jwks; - let p_query_name = name; - let p_query_ordering = ordering; - let p_query_page = page; - let p_query_page_size = page_size; - let p_query_pbm_uuid = pbm_uuid; - let p_query_policy_engine_mode = policy_engine_mode; - let p_query_profile_url = profile_url; - let p_query_provider_type = provider_type; - let p_query_request_token_url = request_token_url; - let p_query_search = search; - let p_query_slug = slug; - let p_query_user_matching_mode = user_matching_mode; - - let uri_str = format!("{}/sources/oauth/", configuration.base_path); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref param_value) = p_query_access_token_url { - req_builder = req_builder.query(&[("access_token_url", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_additional_scopes { - req_builder = req_builder.query(&[("additional_scopes", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_authentication_flow { - req_builder = req_builder.query(&[("authentication_flow", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_authorization_url { - req_builder = req_builder.query(&[("authorization_url", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_consumer_key { - req_builder = req_builder.query(&[("consumer_key", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_enabled { - req_builder = req_builder.query(&[("enabled", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_enrollment_flow { - req_builder = req_builder.query(&[("enrollment_flow", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_group_matching_mode { - req_builder = req_builder.query(&[("group_matching_mode", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_has_jwks { - req_builder = req_builder.query(&[("has_jwks", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_name { - req_builder = req_builder.query(&[("name", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_ordering { - req_builder = req_builder.query(&[("ordering", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_page { - req_builder = req_builder.query(&[("page", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_page_size { - req_builder = req_builder.query(&[("page_size", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_pbm_uuid { - req_builder = req_builder.query(&[("pbm_uuid", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_policy_engine_mode { - req_builder = req_builder.query(&[("policy_engine_mode", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_profile_url { - req_builder = req_builder.query(&[("profile_url", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_provider_type { - req_builder = req_builder.query(&[("provider_type", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_request_token_url { - req_builder = req_builder.query(&[("request_token_url", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_search { - req_builder = req_builder.query(&[("search", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_slug { - req_builder = req_builder.query(&[("slug", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_user_matching_mode { - req_builder = req_builder.query(&[("user_matching_mode", ¶m_value.to_string())]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::PaginatedOAuthSourceList`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::PaginatedOAuthSourceList`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Source Viewset -pub async fn sources_oauth_partial_update( - configuration: &configuration::Configuration, - slug: &str, - patched_o_auth_source_request: Option, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_slug = slug; - let p_body_patched_o_auth_source_request = patched_o_auth_source_request; - - let uri_str = format!( - "{}/sources/oauth/{slug}/", - configuration.base_path, - slug = crate::apis::urlencode(p_path_slug) - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::PATCH, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - req_builder = req_builder.json(&p_body_patched_o_auth_source_request); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::OAuthSource`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::OAuthSource`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Source Viewset -pub async fn sources_oauth_retrieve( - configuration: &configuration::Configuration, - slug: &str, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_slug = slug; - - let uri_str = format!( - "{}/sources/oauth/{slug}/", - configuration.base_path, - slug = crate::apis::urlencode(p_path_slug) - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::OAuthSource`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::OAuthSource`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Get all creatable source types. If ?name is set, only returns the type for . If -/// isn't found, returns the default type. -pub async fn sources_oauth_source_types_list( - configuration: &configuration::Configuration, - name: Option<&str>, -) -> Result, Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_query_name = name; - - let uri_str = format!("{}/sources/oauth/source_types/", configuration.base_path); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref param_value) = p_query_name { - req_builder = req_builder.query(&[("name", ¶m_value.to_string())]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `Vec<models::SourceType>`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `Vec<models::SourceType>`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Source Viewset -pub async fn sources_oauth_update( - configuration: &configuration::Configuration, - slug: &str, - o_auth_source_request: models::OAuthSourceRequest, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_slug = slug; - let p_body_o_auth_source_request = o_auth_source_request; - - let uri_str = format!( - "{}/sources/oauth/{slug}/", - configuration.base_path, - slug = crate::apis::urlencode(p_path_slug) - ); - let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - req_builder = req_builder.json(&p_body_o_auth_source_request); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::OAuthSource`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::OAuthSource`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Get a list of all objects that use this object -pub async fn sources_oauth_used_by_list( - configuration: &configuration::Configuration, - slug: &str, -) -> Result, Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_slug = slug; - - let uri_str = format!( - "{}/sources/oauth/{slug}/used_by/", - configuration.base_path, - slug = crate::apis::urlencode(p_path_slug) - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `Vec<models::UsedBy>`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `Vec<models::UsedBy>`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Plex source Viewset -pub async fn sources_plex_create( - configuration: &configuration::Configuration, - plex_source_request: models::PlexSourceRequest, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_body_plex_source_request = plex_source_request; - - let uri_str = format!("{}/sources/plex/", configuration.base_path); - let mut req_builder = configuration - .client - .request(reqwest::Method::POST, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - req_builder = req_builder.json(&p_body_plex_source_request); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::PlexSource`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::PlexSource`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Plex source Viewset -pub async fn sources_plex_destroy( - configuration: &configuration::Configuration, - slug: &str, -) -> Result<(), Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_slug = slug; - - let uri_str = format!( - "{}/sources/plex/{slug}/", - configuration.base_path, - slug = crate::apis::urlencode(p_path_slug) - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::DELETE, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - - if !status.is_client_error() && !status.is_server_error() { - Ok(()) - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Plex source Viewset -pub async fn sources_plex_list( - configuration: &configuration::Configuration, - allow_friends: Option, - authentication_flow: Option<&str>, - client_id: Option<&str>, - enabled: Option, - enrollment_flow: Option<&str>, - group_matching_mode: Option, - name: Option<&str>, - ordering: Option<&str>, - page: Option, - page_size: Option, - pbm_uuid: Option<&str>, - policy_engine_mode: Option, - search: Option<&str>, - slug: Option<&str>, - user_matching_mode: Option, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_query_allow_friends = allow_friends; - let p_query_authentication_flow = authentication_flow; - let p_query_client_id = client_id; - let p_query_enabled = enabled; - let p_query_enrollment_flow = enrollment_flow; - let p_query_group_matching_mode = group_matching_mode; - let p_query_name = name; - let p_query_ordering = ordering; - let p_query_page = page; - let p_query_page_size = page_size; - let p_query_pbm_uuid = pbm_uuid; - let p_query_policy_engine_mode = policy_engine_mode; - let p_query_search = search; - let p_query_slug = slug; - let p_query_user_matching_mode = user_matching_mode; - - let uri_str = format!("{}/sources/plex/", configuration.base_path); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref param_value) = p_query_allow_friends { - req_builder = req_builder.query(&[("allow_friends", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_authentication_flow { - req_builder = req_builder.query(&[("authentication_flow", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_client_id { - req_builder = req_builder.query(&[("client_id", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_enabled { - req_builder = req_builder.query(&[("enabled", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_enrollment_flow { - req_builder = req_builder.query(&[("enrollment_flow", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_group_matching_mode { - req_builder = req_builder.query(&[("group_matching_mode", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_name { - req_builder = req_builder.query(&[("name", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_ordering { - req_builder = req_builder.query(&[("ordering", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_page { - req_builder = req_builder.query(&[("page", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_page_size { - req_builder = req_builder.query(&[("page_size", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_pbm_uuid { - req_builder = req_builder.query(&[("pbm_uuid", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_policy_engine_mode { - req_builder = req_builder.query(&[("policy_engine_mode", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_search { - req_builder = req_builder.query(&[("search", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_slug { - req_builder = req_builder.query(&[("slug", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_user_matching_mode { - req_builder = req_builder.query(&[("user_matching_mode", ¶m_value.to_string())]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::PaginatedPlexSourceList`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::PaginatedPlexSourceList`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Plex source Viewset -pub async fn sources_plex_partial_update( - configuration: &configuration::Configuration, - slug: &str, - patched_plex_source_request: Option, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_slug = slug; - let p_body_patched_plex_source_request = patched_plex_source_request; - - let uri_str = format!( - "{}/sources/plex/{slug}/", - configuration.base_path, - slug = crate::apis::urlencode(p_path_slug) - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::PATCH, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - req_builder = req_builder.json(&p_body_patched_plex_source_request); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::PlexSource`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::PlexSource`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Redeem a plex token for an authenticated user, creating a connection -pub async fn sources_plex_redeem_token_authenticated_create( - configuration: &configuration::Configuration, - plex_token_redeem_request: models::PlexTokenRedeemRequest, - slug: Option<&str>, -) -> Result<(), Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_body_plex_token_redeem_request = plex_token_redeem_request; - let p_query_slug = slug; - - let uri_str = format!( - "{}/sources/plex/redeem_token_authenticated/", - configuration.base_path - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::POST, &uri_str); - - if let Some(ref param_value) = p_query_slug { - req_builder = req_builder.query(&[("slug", ¶m_value.to_string())]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - req_builder = req_builder.json(&p_body_plex_token_redeem_request); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - - if !status.is_client_error() && !status.is_server_error() { - Ok(()) - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Redeem a plex token, check it's access to resources against what's allowed for the source, and -/// redirect to an authentication/enrollment flow. -pub async fn sources_plex_redeem_token_create( - configuration: &configuration::Configuration, - plex_token_redeem_request: models::PlexTokenRedeemRequest, - slug: Option<&str>, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_body_plex_token_redeem_request = plex_token_redeem_request; - let p_query_slug = slug; - - let uri_str = format!("{}/sources/plex/redeem_token/", configuration.base_path); - let mut req_builder = configuration - .client - .request(reqwest::Method::POST, &uri_str); - - if let Some(ref param_value) = p_query_slug { - req_builder = req_builder.query(&[("slug", ¶m_value.to_string())]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - req_builder = req_builder.json(&p_body_plex_token_redeem_request); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::RedirectChallenge`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::RedirectChallenge`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Plex source Viewset -pub async fn sources_plex_retrieve( - configuration: &configuration::Configuration, - slug: &str, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_slug = slug; - - let uri_str = format!( - "{}/sources/plex/{slug}/", - configuration.base_path, - slug = crate::apis::urlencode(p_path_slug) - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::PlexSource`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::PlexSource`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Plex source Viewset -pub async fn sources_plex_update( - configuration: &configuration::Configuration, - slug: &str, - plex_source_request: models::PlexSourceRequest, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_slug = slug; - let p_body_plex_source_request = plex_source_request; - - let uri_str = format!( - "{}/sources/plex/{slug}/", - configuration.base_path, - slug = crate::apis::urlencode(p_path_slug) - ); - let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - req_builder = req_builder.json(&p_body_plex_source_request); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::PlexSource`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::PlexSource`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Get a list of all objects that use this object -pub async fn sources_plex_used_by_list( - configuration: &configuration::Configuration, - slug: &str, -) -> Result, Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_slug = slug; - - let uri_str = format!( - "{}/sources/plex/{slug}/used_by/", - configuration.base_path, - slug = crate::apis::urlencode(p_path_slug) - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `Vec<models::UsedBy>`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `Vec<models::UsedBy>`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// SAMLSource Viewset -pub async fn sources_saml_create( - configuration: &configuration::Configuration, - saml_source_request: models::SamlSourceRequest, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_body_saml_source_request = saml_source_request; - - let uri_str = format!("{}/sources/saml/", configuration.base_path); - let mut req_builder = configuration - .client - .request(reqwest::Method::POST, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - req_builder = req_builder.json(&p_body_saml_source_request); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::SamlSource`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::SamlSource`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// SAMLSource Viewset -pub async fn sources_saml_destroy( - configuration: &configuration::Configuration, - slug: &str, -) -> Result<(), Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_slug = slug; - - let uri_str = format!( - "{}/sources/saml/{slug}/", - configuration.base_path, - slug = crate::apis::urlencode(p_path_slug) - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::DELETE, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - - if !status.is_client_error() && !status.is_server_error() { - Ok(()) - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// SAMLSource Viewset -pub async fn sources_saml_list( - configuration: &configuration::Configuration, - allow_idp_initiated: Option, - authentication_flow: Option<&str>, - binding_type: Option, - digest_algorithm: Option, - enabled: Option, - enrollment_flow: Option<&str>, - force_authn: Option, - issuer: Option<&str>, - managed: Option<&str>, - name: Option<&str>, - name_id_policy: Option, - ordering: Option<&str>, - page: Option, - page_size: Option, - pbm_uuid: Option<&str>, - policy_engine_mode: Option, - pre_authentication_flow: Option<&str>, - search: Option<&str>, - signature_algorithm: Option, - signed_assertion: Option, - signed_response: Option, - signing_kp: Option<&str>, - slo_url: Option<&str>, - slug: Option<&str>, - sso_url: Option<&str>, - temporary_user_delete_after: Option<&str>, - user_matching_mode: Option, - verification_kp: Option<&str>, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_query_allow_idp_initiated = allow_idp_initiated; - let p_query_authentication_flow = authentication_flow; - let p_query_binding_type = binding_type; - let p_query_digest_algorithm = digest_algorithm; - let p_query_enabled = enabled; - let p_query_enrollment_flow = enrollment_flow; - let p_query_force_authn = force_authn; - let p_query_issuer = issuer; - let p_query_managed = managed; - let p_query_name = name; - let p_query_name_id_policy = name_id_policy; - let p_query_ordering = ordering; - let p_query_page = page; - let p_query_page_size = page_size; - let p_query_pbm_uuid = pbm_uuid; - let p_query_policy_engine_mode = policy_engine_mode; - let p_query_pre_authentication_flow = pre_authentication_flow; - let p_query_search = search; - let p_query_signature_algorithm = signature_algorithm; - let p_query_signed_assertion = signed_assertion; - let p_query_signed_response = signed_response; - let p_query_signing_kp = signing_kp; - let p_query_slo_url = slo_url; - let p_query_slug = slug; - let p_query_sso_url = sso_url; - let p_query_temporary_user_delete_after = temporary_user_delete_after; - let p_query_user_matching_mode = user_matching_mode; - let p_query_verification_kp = verification_kp; - - let uri_str = format!("{}/sources/saml/", configuration.base_path); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref param_value) = p_query_allow_idp_initiated { - req_builder = req_builder.query(&[("allow_idp_initiated", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_authentication_flow { - req_builder = req_builder.query(&[("authentication_flow", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_binding_type { - req_builder = req_builder.query(&[("binding_type", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_digest_algorithm { - req_builder = req_builder.query(&[("digest_algorithm", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_enabled { - req_builder = req_builder.query(&[("enabled", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_enrollment_flow { - req_builder = req_builder.query(&[("enrollment_flow", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_force_authn { - req_builder = req_builder.query(&[("force_authn", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_issuer { - req_builder = req_builder.query(&[("issuer", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_managed { - req_builder = req_builder.query(&[("managed", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_name { - req_builder = req_builder.query(&[("name", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_name_id_policy { - req_builder = req_builder.query(&[("name_id_policy", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_ordering { - req_builder = req_builder.query(&[("ordering", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_page { - req_builder = req_builder.query(&[("page", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_page_size { - req_builder = req_builder.query(&[("page_size", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_pbm_uuid { - req_builder = req_builder.query(&[("pbm_uuid", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_policy_engine_mode { - req_builder = req_builder.query(&[("policy_engine_mode", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_pre_authentication_flow { - req_builder = req_builder.query(&[("pre_authentication_flow", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_search { - req_builder = req_builder.query(&[("search", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_signature_algorithm { - req_builder = req_builder.query(&[("signature_algorithm", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_signed_assertion { - req_builder = req_builder.query(&[("signed_assertion", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_signed_response { - req_builder = req_builder.query(&[("signed_response", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_signing_kp { - req_builder = req_builder.query(&[("signing_kp", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_slo_url { - req_builder = req_builder.query(&[("slo_url", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_slug { - req_builder = req_builder.query(&[("slug", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_sso_url { - req_builder = req_builder.query(&[("sso_url", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_temporary_user_delete_after { - req_builder = - req_builder.query(&[("temporary_user_delete_after", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_user_matching_mode { - req_builder = req_builder.query(&[("user_matching_mode", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_verification_kp { - req_builder = req_builder.query(&[("verification_kp", ¶m_value.to_string())]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::PaginatedSamlSourceList`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::PaginatedSamlSourceList`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Return metadata as XML string -pub async fn sources_saml_metadata_retrieve( - configuration: &configuration::Configuration, - slug: &str, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_slug = slug; - - let uri_str = format!( - "{}/sources/saml/{slug}/metadata/", - configuration.base_path, - slug = crate::apis::urlencode(p_path_slug) - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::SamlMetadata`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::SamlMetadata`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// SAMLSource Viewset -pub async fn sources_saml_partial_update( - configuration: &configuration::Configuration, - slug: &str, - patched_saml_source_request: Option, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_slug = slug; - let p_body_patched_saml_source_request = patched_saml_source_request; - - let uri_str = format!( - "{}/sources/saml/{slug}/", - configuration.base_path, - slug = crate::apis::urlencode(p_path_slug) - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::PATCH, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - req_builder = req_builder.json(&p_body_patched_saml_source_request); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::SamlSource`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::SamlSource`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// SAMLSource Viewset -pub async fn sources_saml_retrieve( - configuration: &configuration::Configuration, - slug: &str, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_slug = slug; - - let uri_str = format!( - "{}/sources/saml/{slug}/", - configuration.base_path, - slug = crate::apis::urlencode(p_path_slug) - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::SamlSource`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::SamlSource`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// SAMLSource Viewset -pub async fn sources_saml_update( - configuration: &configuration::Configuration, - slug: &str, - saml_source_request: models::SamlSourceRequest, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_slug = slug; - let p_body_saml_source_request = saml_source_request; - - let uri_str = format!( - "{}/sources/saml/{slug}/", - configuration.base_path, - slug = crate::apis::urlencode(p_path_slug) - ); - let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - req_builder = req_builder.json(&p_body_saml_source_request); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::SamlSource`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::SamlSource`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Get a list of all objects that use this object -pub async fn sources_saml_used_by_list( - configuration: &configuration::Configuration, - slug: &str, -) -> Result, Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_slug = slug; - - let uri_str = format!( - "{}/sources/saml/{slug}/used_by/", - configuration.base_path, - slug = crate::apis::urlencode(p_path_slug) - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `Vec<models::UsedBy>`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `Vec<models::UsedBy>`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// SCIMSource Viewset -pub async fn sources_scim_create( - configuration: &configuration::Configuration, - scim_source_request: models::ScimSourceRequest, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_body_scim_source_request = scim_source_request; - - let uri_str = format!("{}/sources/scim/", configuration.base_path); - let mut req_builder = configuration - .client - .request(reqwest::Method::POST, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - req_builder = req_builder.json(&p_body_scim_source_request); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::ScimSource`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::ScimSource`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// SCIMSource Viewset -pub async fn sources_scim_destroy( - configuration: &configuration::Configuration, - slug: &str, -) -> Result<(), Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_slug = slug; - - let uri_str = format!( - "{}/sources/scim/{slug}/", - configuration.base_path, - slug = crate::apis::urlencode(p_path_slug) - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::DELETE, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - - if !status.is_client_error() && !status.is_server_error() { - Ok(()) - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// SCIMSourceGroup Viewset -pub async fn sources_scim_groups_create( - configuration: &configuration::Configuration, - scim_source_group_request: models::ScimSourceGroupRequest, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_body_scim_source_group_request = scim_source_group_request; - - let uri_str = format!("{}/sources/scim_groups/", configuration.base_path); - let mut req_builder = configuration - .client - .request(reqwest::Method::POST, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - req_builder = req_builder.json(&p_body_scim_source_group_request); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::ScimSourceGroup`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::ScimSourceGroup`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// SCIMSourceGroup Viewset -pub async fn sources_scim_groups_destroy( - configuration: &configuration::Configuration, - id: &str, -) -> Result<(), Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_id = id; - - let uri_str = format!( - "{}/sources/scim_groups/{id}/", - configuration.base_path, - id = crate::apis::urlencode(p_path_id) - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::DELETE, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - - if !status.is_client_error() && !status.is_server_error() { - Ok(()) - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// SCIMSourceGroup Viewset -pub async fn sources_scim_groups_list( - configuration: &configuration::Configuration, - group__group_uuid: Option<&str>, - group__name: Option<&str>, - ordering: Option<&str>, - page: Option, - page_size: Option, - search: Option<&str>, - source__slug: Option<&str>, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_query_group__group_uuid = group__group_uuid; - let p_query_group__name = group__name; - let p_query_ordering = ordering; - let p_query_page = page; - let p_query_page_size = page_size; - let p_query_search = search; - let p_query_source__slug = source__slug; - - let uri_str = format!("{}/sources/scim_groups/", configuration.base_path); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref param_value) = p_query_group__group_uuid { - req_builder = req_builder.query(&[("group__group_uuid", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_group__name { - req_builder = req_builder.query(&[("group__name", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_ordering { - req_builder = req_builder.query(&[("ordering", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_page { - req_builder = req_builder.query(&[("page", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_page_size { - req_builder = req_builder.query(&[("page_size", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_search { - req_builder = req_builder.query(&[("search", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_source__slug { - req_builder = req_builder.query(&[("source__slug", ¶m_value.to_string())]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::PaginatedScimSourceGroupList`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::PaginatedScimSourceGroupList`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// SCIMSourceGroup Viewset -pub async fn sources_scim_groups_partial_update( - configuration: &configuration::Configuration, - id: &str, - patched_scim_source_group_request: Option, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_id = id; - let p_body_patched_scim_source_group_request = patched_scim_source_group_request; - - let uri_str = format!( - "{}/sources/scim_groups/{id}/", - configuration.base_path, - id = crate::apis::urlencode(p_path_id) - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::PATCH, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - req_builder = req_builder.json(&p_body_patched_scim_source_group_request); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::ScimSourceGroup`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::ScimSourceGroup`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// SCIMSourceGroup Viewset -pub async fn sources_scim_groups_retrieve( - configuration: &configuration::Configuration, - id: &str, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_id = id; - - let uri_str = format!( - "{}/sources/scim_groups/{id}/", - configuration.base_path, - id = crate::apis::urlencode(p_path_id) - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::ScimSourceGroup`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::ScimSourceGroup`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// SCIMSourceGroup Viewset -pub async fn sources_scim_groups_update( - configuration: &configuration::Configuration, - id: &str, - scim_source_group_request: models::ScimSourceGroupRequest, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_id = id; - let p_body_scim_source_group_request = scim_source_group_request; - - let uri_str = format!( - "{}/sources/scim_groups/{id}/", - configuration.base_path, - id = crate::apis::urlencode(p_path_id) - ); - let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - req_builder = req_builder.json(&p_body_scim_source_group_request); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::ScimSourceGroup`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::ScimSourceGroup`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Get a list of all objects that use this object -pub async fn sources_scim_groups_used_by_list( - configuration: &configuration::Configuration, - id: &str, -) -> Result, Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_id = id; - - let uri_str = format!( - "{}/sources/scim_groups/{id}/used_by/", - configuration.base_path, - id = crate::apis::urlencode(p_path_id) - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `Vec<models::UsedBy>`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `Vec<models::UsedBy>`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// SCIMSource Viewset -pub async fn sources_scim_list( - configuration: &configuration::Configuration, - name: Option<&str>, - ordering: Option<&str>, - page: Option, - page_size: Option, - pbm_uuid: Option<&str>, - search: Option<&str>, - slug: Option<&str>, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_query_name = name; - let p_query_ordering = ordering; - let p_query_page = page; - let p_query_page_size = page_size; - let p_query_pbm_uuid = pbm_uuid; - let p_query_search = search; - let p_query_slug = slug; - - let uri_str = format!("{}/sources/scim/", configuration.base_path); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref param_value) = p_query_name { - req_builder = req_builder.query(&[("name", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_ordering { - req_builder = req_builder.query(&[("ordering", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_page { - req_builder = req_builder.query(&[("page", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_page_size { - req_builder = req_builder.query(&[("page_size", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_pbm_uuid { - req_builder = req_builder.query(&[("pbm_uuid", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_search { - req_builder = req_builder.query(&[("search", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_slug { - req_builder = req_builder.query(&[("slug", ¶m_value.to_string())]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::PaginatedScimSourceList`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::PaginatedScimSourceList`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// SCIMSource Viewset -pub async fn sources_scim_partial_update( - configuration: &configuration::Configuration, - slug: &str, - patched_scim_source_request: Option, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_slug = slug; - let p_body_patched_scim_source_request = patched_scim_source_request; - - let uri_str = format!( - "{}/sources/scim/{slug}/", - configuration.base_path, - slug = crate::apis::urlencode(p_path_slug) - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::PATCH, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - req_builder = req_builder.json(&p_body_patched_scim_source_request); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::ScimSource`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::ScimSource`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// SCIMSource Viewset -pub async fn sources_scim_retrieve( - configuration: &configuration::Configuration, - slug: &str, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_slug = slug; - - let uri_str = format!( - "{}/sources/scim/{slug}/", - configuration.base_path, - slug = crate::apis::urlencode(p_path_slug) - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::ScimSource`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::ScimSource`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// SCIMSource Viewset -pub async fn sources_scim_update( - configuration: &configuration::Configuration, - slug: &str, - scim_source_request: models::ScimSourceRequest, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_slug = slug; - let p_body_scim_source_request = scim_source_request; - - let uri_str = format!( - "{}/sources/scim/{slug}/", - configuration.base_path, - slug = crate::apis::urlencode(p_path_slug) - ); - let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - req_builder = req_builder.json(&p_body_scim_source_request); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::ScimSource`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::ScimSource`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Get a list of all objects that use this object -pub async fn sources_scim_used_by_list( - configuration: &configuration::Configuration, - slug: &str, -) -> Result, Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_slug = slug; - - let uri_str = format!( - "{}/sources/scim/{slug}/used_by/", - configuration.base_path, - slug = crate::apis::urlencode(p_path_slug) - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `Vec<models::UsedBy>`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `Vec<models::UsedBy>`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// SCIMSourceUser Viewset -pub async fn sources_scim_users_create( - configuration: &configuration::Configuration, - scim_source_user_request: models::ScimSourceUserRequest, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_body_scim_source_user_request = scim_source_user_request; - - let uri_str = format!("{}/sources/scim_users/", configuration.base_path); - let mut req_builder = configuration - .client - .request(reqwest::Method::POST, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - req_builder = req_builder.json(&p_body_scim_source_user_request); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::ScimSourceUser`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::ScimSourceUser`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// SCIMSourceUser Viewset -pub async fn sources_scim_users_destroy( - configuration: &configuration::Configuration, - id: &str, -) -> Result<(), Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_id = id; - - let uri_str = format!( - "{}/sources/scim_users/{id}/", - configuration.base_path, - id = crate::apis::urlencode(p_path_id) - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::DELETE, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - - if !status.is_client_error() && !status.is_server_error() { - Ok(()) - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// SCIMSourceUser Viewset -pub async fn sources_scim_users_list( - configuration: &configuration::Configuration, - ordering: Option<&str>, - page: Option, - page_size: Option, - search: Option<&str>, - source__slug: Option<&str>, - user__id: Option, - user__username: Option<&str>, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_query_ordering = ordering; - let p_query_page = page; - let p_query_page_size = page_size; - let p_query_search = search; - let p_query_source__slug = source__slug; - let p_query_user__id = user__id; - let p_query_user__username = user__username; - - let uri_str = format!("{}/sources/scim_users/", configuration.base_path); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref param_value) = p_query_ordering { - req_builder = req_builder.query(&[("ordering", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_page { - req_builder = req_builder.query(&[("page", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_page_size { - req_builder = req_builder.query(&[("page_size", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_search { - req_builder = req_builder.query(&[("search", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_source__slug { - req_builder = req_builder.query(&[("source__slug", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_user__id { - req_builder = req_builder.query(&[("user__id", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_user__username { - req_builder = req_builder.query(&[("user__username", ¶m_value.to_string())]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::PaginatedScimSourceUserList`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::PaginatedScimSourceUserList`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// SCIMSourceUser Viewset -pub async fn sources_scim_users_partial_update( - configuration: &configuration::Configuration, - id: &str, - patched_scim_source_user_request: Option, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_id = id; - let p_body_patched_scim_source_user_request = patched_scim_source_user_request; - - let uri_str = format!( - "{}/sources/scim_users/{id}/", - configuration.base_path, - id = crate::apis::urlencode(p_path_id) - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::PATCH, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - req_builder = req_builder.json(&p_body_patched_scim_source_user_request); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::ScimSourceUser`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::ScimSourceUser`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// SCIMSourceUser Viewset -pub async fn sources_scim_users_retrieve( - configuration: &configuration::Configuration, - id: &str, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_id = id; - - let uri_str = format!( - "{}/sources/scim_users/{id}/", - configuration.base_path, - id = crate::apis::urlencode(p_path_id) - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::ScimSourceUser`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::ScimSourceUser`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// SCIMSourceUser Viewset -pub async fn sources_scim_users_update( - configuration: &configuration::Configuration, - id: &str, - scim_source_user_request: models::ScimSourceUserRequest, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_id = id; - let p_body_scim_source_user_request = scim_source_user_request; - - let uri_str = format!( - "{}/sources/scim_users/{id}/", - configuration.base_path, - id = crate::apis::urlencode(p_path_id) - ); - let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - req_builder = req_builder.json(&p_body_scim_source_user_request); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::ScimSourceUser`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::ScimSourceUser`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Get a list of all objects that use this object -pub async fn sources_scim_users_used_by_list( - configuration: &configuration::Configuration, - id: &str, -) -> Result, Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_id = id; - - let uri_str = format!( - "{}/sources/scim_users/{id}/used_by/", - configuration.base_path, - id = crate::apis::urlencode(p_path_id) - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `Vec<models::UsedBy>`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `Vec<models::UsedBy>`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Mixin to add a used_by endpoint to return a list of all objects using this object -pub async fn sources_telegram_connect_user_create( - configuration: &configuration::Configuration, - slug: &str, - telegram_auth_request: models::TelegramAuthRequest, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_slug = slug; - let p_body_telegram_auth_request = telegram_auth_request; - - let uri_str = format!( - "{}/sources/telegram/{slug}/connect_user/", - configuration.base_path, - slug = crate::apis::urlencode(p_path_slug) - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::POST, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - req_builder = req_builder.json(&p_body_telegram_auth_request); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::UserTelegramSourceConnection`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::UserTelegramSourceConnection`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Mixin to add a used_by endpoint to return a list of all objects using this object -pub async fn sources_telegram_create( - configuration: &configuration::Configuration, - telegram_source_request: models::TelegramSourceRequest, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_body_telegram_source_request = telegram_source_request; - - let uri_str = format!("{}/sources/telegram/", configuration.base_path); - let mut req_builder = configuration - .client - .request(reqwest::Method::POST, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - req_builder = req_builder.json(&p_body_telegram_source_request); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::TelegramSource`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::TelegramSource`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Mixin to add a used_by endpoint to return a list of all objects using this object -pub async fn sources_telegram_destroy( - configuration: &configuration::Configuration, - slug: &str, -) -> Result<(), Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_slug = slug; - - let uri_str = format!( - "{}/sources/telegram/{slug}/", - configuration.base_path, - slug = crate::apis::urlencode(p_path_slug) - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::DELETE, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - - if !status.is_client_error() && !status.is_server_error() { - Ok(()) - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Mixin to add a used_by endpoint to return a list of all objects using this object -pub async fn sources_telegram_list( - configuration: &configuration::Configuration, - authentication_flow: Option<&str>, - bot_username: Option<&str>, - enabled: Option, - enrollment_flow: Option<&str>, - group_matching_mode: Option, - name: Option<&str>, - ordering: Option<&str>, - page: Option, - page_size: Option, - pbm_uuid: Option<&str>, - policy_engine_mode: Option, - request_message_access: Option, - search: Option<&str>, - slug: Option<&str>, - user_matching_mode: Option, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_query_authentication_flow = authentication_flow; - let p_query_bot_username = bot_username; - let p_query_enabled = enabled; - let p_query_enrollment_flow = enrollment_flow; - let p_query_group_matching_mode = group_matching_mode; - let p_query_name = name; - let p_query_ordering = ordering; - let p_query_page = page; - let p_query_page_size = page_size; - let p_query_pbm_uuid = pbm_uuid; - let p_query_policy_engine_mode = policy_engine_mode; - let p_query_request_message_access = request_message_access; - let p_query_search = search; - let p_query_slug = slug; - let p_query_user_matching_mode = user_matching_mode; - - let uri_str = format!("{}/sources/telegram/", configuration.base_path); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref param_value) = p_query_authentication_flow { - req_builder = req_builder.query(&[("authentication_flow", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_bot_username { - req_builder = req_builder.query(&[("bot_username", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_enabled { - req_builder = req_builder.query(&[("enabled", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_enrollment_flow { - req_builder = req_builder.query(&[("enrollment_flow", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_group_matching_mode { - req_builder = req_builder.query(&[("group_matching_mode", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_name { - req_builder = req_builder.query(&[("name", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_ordering { - req_builder = req_builder.query(&[("ordering", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_page { - req_builder = req_builder.query(&[("page", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_page_size { - req_builder = req_builder.query(&[("page_size", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_pbm_uuid { - req_builder = req_builder.query(&[("pbm_uuid", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_policy_engine_mode { - req_builder = req_builder.query(&[("policy_engine_mode", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_request_message_access { - req_builder = req_builder.query(&[("request_message_access", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_search { - req_builder = req_builder.query(&[("search", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_slug { - req_builder = req_builder.query(&[("slug", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_user_matching_mode { - req_builder = req_builder.query(&[("user_matching_mode", ¶m_value.to_string())]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::PaginatedTelegramSourceList`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::PaginatedTelegramSourceList`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Mixin to add a used_by endpoint to return a list of all objects using this object -pub async fn sources_telegram_partial_update( - configuration: &configuration::Configuration, - slug: &str, - patched_telegram_source_request: Option, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_slug = slug; - let p_body_patched_telegram_source_request = patched_telegram_source_request; - - let uri_str = format!( - "{}/sources/telegram/{slug}/", - configuration.base_path, - slug = crate::apis::urlencode(p_path_slug) - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::PATCH, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - req_builder = req_builder.json(&p_body_patched_telegram_source_request); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::TelegramSource`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::TelegramSource`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Mixin to add a used_by endpoint to return a list of all objects using this object -pub async fn sources_telegram_retrieve( - configuration: &configuration::Configuration, - slug: &str, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_slug = slug; - - let uri_str = format!( - "{}/sources/telegram/{slug}/", - configuration.base_path, - slug = crate::apis::urlencode(p_path_slug) - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::TelegramSource`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::TelegramSource`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Mixin to add a used_by endpoint to return a list of all objects using this object -pub async fn sources_telegram_update( - configuration: &configuration::Configuration, - slug: &str, - telegram_source_request: models::TelegramSourceRequest, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_slug = slug; - let p_body_telegram_source_request = telegram_source_request; - - let uri_str = format!( - "{}/sources/telegram/{slug}/", - configuration.base_path, - slug = crate::apis::urlencode(p_path_slug) - ); - let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - req_builder = req_builder.json(&p_body_telegram_source_request); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::TelegramSource`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::TelegramSource`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Get a list of all objects that use this object -pub async fn sources_telegram_used_by_list( - configuration: &configuration::Configuration, - slug: &str, -) -> Result, Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_slug = slug; - - let uri_str = format!( - "{}/sources/telegram/{slug}/used_by/", - configuration.base_path, - slug = crate::apis::urlencode(p_path_slug) - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `Vec<models::UsedBy>`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `Vec<models::UsedBy>`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// User-source connection Viewset -pub async fn sources_user_connections_all_destroy( - configuration: &configuration::Configuration, - id: i32, -) -> Result<(), Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_id = id; - - let uri_str = format!( - "{}/sources/user_connections/all/{id}/", - configuration.base_path, - id = p_path_id - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::DELETE, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - - if !status.is_client_error() && !status.is_server_error() { - Ok(()) - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// User-source connection Viewset -pub async fn sources_user_connections_all_list( - configuration: &configuration::Configuration, - ordering: Option<&str>, - page: Option, - page_size: Option, - search: Option<&str>, - source__slug: Option<&str>, - user: Option, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_query_ordering = ordering; - let p_query_page = page; - let p_query_page_size = page_size; - let p_query_search = search; - let p_query_source__slug = source__slug; - let p_query_user = user; - - let uri_str = format!("{}/sources/user_connections/all/", configuration.base_path); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref param_value) = p_query_ordering { - req_builder = req_builder.query(&[("ordering", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_page { - req_builder = req_builder.query(&[("page", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_page_size { - req_builder = req_builder.query(&[("page_size", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_search { - req_builder = req_builder.query(&[("search", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_source__slug { - req_builder = req_builder.query(&[("source__slug", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_user { - req_builder = req_builder.query(&[("user", ¶m_value.to_string())]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::PaginatedUserSourceConnectionList`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::PaginatedUserSourceConnectionList`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// User-source connection Viewset -pub async fn sources_user_connections_all_partial_update( - configuration: &configuration::Configuration, - id: i32, - patched_user_source_connection_request: Option, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_id = id; - let p_body_patched_user_source_connection_request = patched_user_source_connection_request; - - let uri_str = format!( - "{}/sources/user_connections/all/{id}/", - configuration.base_path, - id = p_path_id - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::PATCH, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - req_builder = req_builder.json(&p_body_patched_user_source_connection_request); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::UserSourceConnection`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::UserSourceConnection`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// User-source connection Viewset -pub async fn sources_user_connections_all_retrieve( - configuration: &configuration::Configuration, - id: i32, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_id = id; - - let uri_str = format!( - "{}/sources/user_connections/all/{id}/", - configuration.base_path, - id = p_path_id - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::UserSourceConnection`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::UserSourceConnection`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// User-source connection Viewset -pub async fn sources_user_connections_all_update( - configuration: &configuration::Configuration, - id: i32, - user_source_connection_request: models::UserSourceConnectionRequest, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_id = id; - let p_body_user_source_connection_request = user_source_connection_request; - - let uri_str = format!( - "{}/sources/user_connections/all/{id}/", - configuration.base_path, - id = p_path_id - ); - let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - req_builder = req_builder.json(&p_body_user_source_connection_request); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::UserSourceConnection`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::UserSourceConnection`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Get a list of all objects that use this object -pub async fn sources_user_connections_all_used_by_list( - configuration: &configuration::Configuration, - id: i32, -) -> Result, Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_id = id; - - let uri_str = format!( - "{}/sources/user_connections/all/{id}/used_by/", - configuration.base_path, - id = p_path_id - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `Vec<models::UsedBy>`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `Vec<models::UsedBy>`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// User-source connection Viewset -pub async fn sources_user_connections_kerberos_create( - configuration: &configuration::Configuration, - user_kerberos_source_connection_request: models::UserKerberosSourceConnectionRequest, -) -> Result> -{ - // add a prefix to parameters to efficiently prevent name collisions - let p_body_user_kerberos_source_connection_request = user_kerberos_source_connection_request; - - let uri_str = format!( - "{}/sources/user_connections/kerberos/", - configuration.base_path - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::POST, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - req_builder = req_builder.json(&p_body_user_kerberos_source_connection_request); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::UserKerberosSourceConnection`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::UserKerberosSourceConnection`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// User-source connection Viewset -pub async fn sources_user_connections_kerberos_destroy( - configuration: &configuration::Configuration, - id: i32, -) -> Result<(), Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_id = id; - - let uri_str = format!( - "{}/sources/user_connections/kerberos/{id}/", - configuration.base_path, - id = p_path_id - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::DELETE, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - - if !status.is_client_error() && !status.is_server_error() { - Ok(()) - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// User-source connection Viewset -pub async fn sources_user_connections_kerberos_list( - configuration: &configuration::Configuration, - ordering: Option<&str>, - page: Option, - page_size: Option, - search: Option<&str>, - source__slug: Option<&str>, - user: Option, -) -> Result< - models::PaginatedUserKerberosSourceConnectionList, - Error, -> { - // add a prefix to parameters to efficiently prevent name collisions - let p_query_ordering = ordering; - let p_query_page = page; - let p_query_page_size = page_size; - let p_query_search = search; - let p_query_source__slug = source__slug; - let p_query_user = user; - - let uri_str = format!( - "{}/sources/user_connections/kerberos/", - configuration.base_path - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref param_value) = p_query_ordering { - req_builder = req_builder.query(&[("ordering", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_page { - req_builder = req_builder.query(&[("page", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_page_size { - req_builder = req_builder.query(&[("page_size", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_search { - req_builder = req_builder.query(&[("search", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_source__slug { - req_builder = req_builder.query(&[("source__slug", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_user { - req_builder = req_builder.query(&[("user", ¶m_value.to_string())]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::PaginatedUserKerberosSourceConnectionList`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::PaginatedUserKerberosSourceConnectionList`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// User-source connection Viewset -pub async fn sources_user_connections_kerberos_partial_update( - configuration: &configuration::Configuration, - id: i32, - patched_user_kerberos_source_connection_request: Option< - models::PatchedUserKerberosSourceConnectionRequest, - >, -) -> Result< - models::UserKerberosSourceConnection, - Error, -> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_id = id; - let p_body_patched_user_kerberos_source_connection_request = - patched_user_kerberos_source_connection_request; - - let uri_str = format!( - "{}/sources/user_connections/kerberos/{id}/", - configuration.base_path, - id = p_path_id - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::PATCH, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - req_builder = req_builder.json(&p_body_patched_user_kerberos_source_connection_request); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::UserKerberosSourceConnection`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::UserKerberosSourceConnection`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// User-source connection Viewset -pub async fn sources_user_connections_kerberos_retrieve( - configuration: &configuration::Configuration, - id: i32, -) -> Result> -{ - // add a prefix to parameters to efficiently prevent name collisions - let p_path_id = id; - - let uri_str = format!( - "{}/sources/user_connections/kerberos/{id}/", - configuration.base_path, - id = p_path_id - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::UserKerberosSourceConnection`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::UserKerberosSourceConnection`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// User-source connection Viewset -pub async fn sources_user_connections_kerberos_update( - configuration: &configuration::Configuration, - id: i32, - user_kerberos_source_connection_request: models::UserKerberosSourceConnectionRequest, -) -> Result> -{ - // add a prefix to parameters to efficiently prevent name collisions - let p_path_id = id; - let p_body_user_kerberos_source_connection_request = user_kerberos_source_connection_request; - - let uri_str = format!( - "{}/sources/user_connections/kerberos/{id}/", - configuration.base_path, - id = p_path_id - ); - let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - req_builder = req_builder.json(&p_body_user_kerberos_source_connection_request); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::UserKerberosSourceConnection`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::UserKerberosSourceConnection`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Get a list of all objects that use this object -pub async fn sources_user_connections_kerberos_used_by_list( - configuration: &configuration::Configuration, - id: i32, -) -> Result, Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_id = id; - - let uri_str = format!( - "{}/sources/user_connections/kerberos/{id}/used_by/", - configuration.base_path, - id = p_path_id - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `Vec<models::UsedBy>`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `Vec<models::UsedBy>`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// User-source connection Viewset -pub async fn sources_user_connections_ldap_create( - configuration: &configuration::Configuration, - user_ldap_source_connection_request: models::UserLdapSourceConnectionRequest, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_body_user_ldap_source_connection_request = user_ldap_source_connection_request; - - let uri_str = format!("{}/sources/user_connections/ldap/", configuration.base_path); - let mut req_builder = configuration - .client - .request(reqwest::Method::POST, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - req_builder = req_builder.json(&p_body_user_ldap_source_connection_request); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::UserLdapSourceConnection`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::UserLdapSourceConnection`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// User-source connection Viewset -pub async fn sources_user_connections_ldap_destroy( - configuration: &configuration::Configuration, - id: i32, -) -> Result<(), Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_id = id; - - let uri_str = format!( - "{}/sources/user_connections/ldap/{id}/", - configuration.base_path, - id = p_path_id - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::DELETE, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - - if !status.is_client_error() && !status.is_server_error() { - Ok(()) - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// User-source connection Viewset -pub async fn sources_user_connections_ldap_list( - configuration: &configuration::Configuration, - ordering: Option<&str>, - page: Option, - page_size: Option, - search: Option<&str>, - source__slug: Option<&str>, - user: Option, -) -> Result> -{ - // add a prefix to parameters to efficiently prevent name collisions - let p_query_ordering = ordering; - let p_query_page = page; - let p_query_page_size = page_size; - let p_query_search = search; - let p_query_source__slug = source__slug; - let p_query_user = user; - - let uri_str = format!("{}/sources/user_connections/ldap/", configuration.base_path); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref param_value) = p_query_ordering { - req_builder = req_builder.query(&[("ordering", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_page { - req_builder = req_builder.query(&[("page", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_page_size { - req_builder = req_builder.query(&[("page_size", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_search { - req_builder = req_builder.query(&[("search", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_source__slug { - req_builder = req_builder.query(&[("source__slug", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_user { - req_builder = req_builder.query(&[("user", ¶m_value.to_string())]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::PaginatedUserLdapSourceConnectionList`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::PaginatedUserLdapSourceConnectionList`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// User-source connection Viewset -pub async fn sources_user_connections_ldap_partial_update( - configuration: &configuration::Configuration, - id: i32, - patched_user_ldap_source_connection_request: Option< - models::PatchedUserLdapSourceConnectionRequest, - >, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_id = id; - let p_body_patched_user_ldap_source_connection_request = - patched_user_ldap_source_connection_request; - - let uri_str = format!( - "{}/sources/user_connections/ldap/{id}/", - configuration.base_path, - id = p_path_id - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::PATCH, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - req_builder = req_builder.json(&p_body_patched_user_ldap_source_connection_request); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::UserLdapSourceConnection`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::UserLdapSourceConnection`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// User-source connection Viewset -pub async fn sources_user_connections_ldap_retrieve( - configuration: &configuration::Configuration, - id: i32, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_id = id; - - let uri_str = format!( - "{}/sources/user_connections/ldap/{id}/", - configuration.base_path, - id = p_path_id - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::UserLdapSourceConnection`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::UserLdapSourceConnection`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// User-source connection Viewset -pub async fn sources_user_connections_ldap_update( - configuration: &configuration::Configuration, - id: i32, - user_ldap_source_connection_request: models::UserLdapSourceConnectionRequest, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_id = id; - let p_body_user_ldap_source_connection_request = user_ldap_source_connection_request; - - let uri_str = format!( - "{}/sources/user_connections/ldap/{id}/", - configuration.base_path, - id = p_path_id - ); - let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - req_builder = req_builder.json(&p_body_user_ldap_source_connection_request); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::UserLdapSourceConnection`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::UserLdapSourceConnection`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Get a list of all objects that use this object -pub async fn sources_user_connections_ldap_used_by_list( - configuration: &configuration::Configuration, - id: i32, -) -> Result, Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_id = id; - - let uri_str = format!( - "{}/sources/user_connections/ldap/{id}/used_by/", - configuration.base_path, - id = p_path_id - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `Vec<models::UsedBy>`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `Vec<models::UsedBy>`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// User-source connection Viewset -pub async fn sources_user_connections_oauth_create( - configuration: &configuration::Configuration, - user_o_auth_source_connection_request: models::UserOAuthSourceConnectionRequest, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_body_user_o_auth_source_connection_request = user_o_auth_source_connection_request; - - let uri_str = format!( - "{}/sources/user_connections/oauth/", - configuration.base_path - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::POST, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - req_builder = req_builder.json(&p_body_user_o_auth_source_connection_request); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::UserOAuthSourceConnection`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::UserOAuthSourceConnection`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// User-source connection Viewset -pub async fn sources_user_connections_oauth_destroy( - configuration: &configuration::Configuration, - id: i32, -) -> Result<(), Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_id = id; - - let uri_str = format!( - "{}/sources/user_connections/oauth/{id}/", - configuration.base_path, - id = p_path_id - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::DELETE, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - - if !status.is_client_error() && !status.is_server_error() { - Ok(()) - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// User-source connection Viewset -pub async fn sources_user_connections_oauth_list( - configuration: &configuration::Configuration, - ordering: Option<&str>, - page: Option, - page_size: Option, - search: Option<&str>, - source__slug: Option<&str>, - user: Option, -) -> Result< - models::PaginatedUserOAuthSourceConnectionList, - Error, -> { - // add a prefix to parameters to efficiently prevent name collisions - let p_query_ordering = ordering; - let p_query_page = page; - let p_query_page_size = page_size; - let p_query_search = search; - let p_query_source__slug = source__slug; - let p_query_user = user; - - let uri_str = format!( - "{}/sources/user_connections/oauth/", - configuration.base_path - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref param_value) = p_query_ordering { - req_builder = req_builder.query(&[("ordering", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_page { - req_builder = req_builder.query(&[("page", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_page_size { - req_builder = req_builder.query(&[("page_size", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_search { - req_builder = req_builder.query(&[("search", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_source__slug { - req_builder = req_builder.query(&[("source__slug", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_user { - req_builder = req_builder.query(&[("user", ¶m_value.to_string())]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::PaginatedUserOAuthSourceConnectionList`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::PaginatedUserOAuthSourceConnectionList`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// User-source connection Viewset -pub async fn sources_user_connections_oauth_partial_update( - configuration: &configuration::Configuration, - id: i32, - patched_user_o_auth_source_connection_request: Option< - models::PatchedUserOAuthSourceConnectionRequest, - >, -) -> Result> -{ - // add a prefix to parameters to efficiently prevent name collisions - let p_path_id = id; - let p_body_patched_user_o_auth_source_connection_request = - patched_user_o_auth_source_connection_request; - - let uri_str = format!( - "{}/sources/user_connections/oauth/{id}/", - configuration.base_path, - id = p_path_id - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::PATCH, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - req_builder = req_builder.json(&p_body_patched_user_o_auth_source_connection_request); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::UserOAuthSourceConnection`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::UserOAuthSourceConnection`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// User-source connection Viewset -pub async fn sources_user_connections_oauth_retrieve( - configuration: &configuration::Configuration, - id: i32, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_id = id; - - let uri_str = format!( - "{}/sources/user_connections/oauth/{id}/", - configuration.base_path, - id = p_path_id - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::UserOAuthSourceConnection`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::UserOAuthSourceConnection`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// User-source connection Viewset -pub async fn sources_user_connections_oauth_update( - configuration: &configuration::Configuration, - id: i32, - user_o_auth_source_connection_request: models::UserOAuthSourceConnectionRequest, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_id = id; - let p_body_user_o_auth_source_connection_request = user_o_auth_source_connection_request; - - let uri_str = format!( - "{}/sources/user_connections/oauth/{id}/", - configuration.base_path, - id = p_path_id - ); - let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - req_builder = req_builder.json(&p_body_user_o_auth_source_connection_request); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::UserOAuthSourceConnection`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::UserOAuthSourceConnection`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Get a list of all objects that use this object -pub async fn sources_user_connections_oauth_used_by_list( - configuration: &configuration::Configuration, - id: i32, -) -> Result, Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_id = id; - - let uri_str = format!( - "{}/sources/user_connections/oauth/{id}/used_by/", - configuration.base_path, - id = p_path_id - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `Vec<models::UsedBy>`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `Vec<models::UsedBy>`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// User-source connection Viewset -pub async fn sources_user_connections_plex_create( - configuration: &configuration::Configuration, - user_plex_source_connection_request: models::UserPlexSourceConnectionRequest, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_body_user_plex_source_connection_request = user_plex_source_connection_request; - - let uri_str = format!("{}/sources/user_connections/plex/", configuration.base_path); - let mut req_builder = configuration - .client - .request(reqwest::Method::POST, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - req_builder = req_builder.json(&p_body_user_plex_source_connection_request); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::UserPlexSourceConnection`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::UserPlexSourceConnection`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// User-source connection Viewset -pub async fn sources_user_connections_plex_destroy( - configuration: &configuration::Configuration, - id: i32, -) -> Result<(), Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_id = id; - - let uri_str = format!( - "{}/sources/user_connections/plex/{id}/", - configuration.base_path, - id = p_path_id - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::DELETE, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - - if !status.is_client_error() && !status.is_server_error() { - Ok(()) - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// User-source connection Viewset -pub async fn sources_user_connections_plex_list( - configuration: &configuration::Configuration, - ordering: Option<&str>, - page: Option, - page_size: Option, - search: Option<&str>, - source__slug: Option<&str>, - user: Option, -) -> Result> -{ - // add a prefix to parameters to efficiently prevent name collisions - let p_query_ordering = ordering; - let p_query_page = page; - let p_query_page_size = page_size; - let p_query_search = search; - let p_query_source__slug = source__slug; - let p_query_user = user; - - let uri_str = format!("{}/sources/user_connections/plex/", configuration.base_path); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref param_value) = p_query_ordering { - req_builder = req_builder.query(&[("ordering", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_page { - req_builder = req_builder.query(&[("page", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_page_size { - req_builder = req_builder.query(&[("page_size", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_search { - req_builder = req_builder.query(&[("search", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_source__slug { - req_builder = req_builder.query(&[("source__slug", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_user { - req_builder = req_builder.query(&[("user", ¶m_value.to_string())]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::PaginatedUserPlexSourceConnectionList`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::PaginatedUserPlexSourceConnectionList`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// User-source connection Viewset -pub async fn sources_user_connections_plex_partial_update( - configuration: &configuration::Configuration, - id: i32, - patched_user_plex_source_connection_request: Option< - models::PatchedUserPlexSourceConnectionRequest, - >, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_id = id; - let p_body_patched_user_plex_source_connection_request = - patched_user_plex_source_connection_request; - - let uri_str = format!( - "{}/sources/user_connections/plex/{id}/", - configuration.base_path, - id = p_path_id - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::PATCH, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - req_builder = req_builder.json(&p_body_patched_user_plex_source_connection_request); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::UserPlexSourceConnection`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::UserPlexSourceConnection`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// User-source connection Viewset -pub async fn sources_user_connections_plex_retrieve( - configuration: &configuration::Configuration, - id: i32, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_id = id; - - let uri_str = format!( - "{}/sources/user_connections/plex/{id}/", - configuration.base_path, - id = p_path_id - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::UserPlexSourceConnection`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::UserPlexSourceConnection`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// User-source connection Viewset -pub async fn sources_user_connections_plex_update( - configuration: &configuration::Configuration, - id: i32, - user_plex_source_connection_request: models::UserPlexSourceConnectionRequest, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_id = id; - let p_body_user_plex_source_connection_request = user_plex_source_connection_request; - - let uri_str = format!( - "{}/sources/user_connections/plex/{id}/", - configuration.base_path, - id = p_path_id - ); - let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - req_builder = req_builder.json(&p_body_user_plex_source_connection_request); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::UserPlexSourceConnection`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::UserPlexSourceConnection`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Get a list of all objects that use this object -pub async fn sources_user_connections_plex_used_by_list( - configuration: &configuration::Configuration, - id: i32, -) -> Result, Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_id = id; - - let uri_str = format!( - "{}/sources/user_connections/plex/{id}/used_by/", - configuration.base_path, - id = p_path_id - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `Vec<models::UsedBy>`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `Vec<models::UsedBy>`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// User-source connection Viewset -pub async fn sources_user_connections_saml_create( - configuration: &configuration::Configuration, - user_saml_source_connection_request: models::UserSamlSourceConnectionRequest, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_body_user_saml_source_connection_request = user_saml_source_connection_request; - - let uri_str = format!("{}/sources/user_connections/saml/", configuration.base_path); - let mut req_builder = configuration - .client - .request(reqwest::Method::POST, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - req_builder = req_builder.json(&p_body_user_saml_source_connection_request); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::UserSamlSourceConnection`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::UserSamlSourceConnection`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// User-source connection Viewset -pub async fn sources_user_connections_saml_destroy( - configuration: &configuration::Configuration, - id: i32, -) -> Result<(), Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_id = id; - - let uri_str = format!( - "{}/sources/user_connections/saml/{id}/", - configuration.base_path, - id = p_path_id - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::DELETE, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - - if !status.is_client_error() && !status.is_server_error() { - Ok(()) - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// User-source connection Viewset -pub async fn sources_user_connections_saml_list( - configuration: &configuration::Configuration, - ordering: Option<&str>, - page: Option, - page_size: Option, - search: Option<&str>, - source__slug: Option<&str>, - user: Option, -) -> Result> -{ - // add a prefix to parameters to efficiently prevent name collisions - let p_query_ordering = ordering; - let p_query_page = page; - let p_query_page_size = page_size; - let p_query_search = search; - let p_query_source__slug = source__slug; - let p_query_user = user; - - let uri_str = format!("{}/sources/user_connections/saml/", configuration.base_path); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref param_value) = p_query_ordering { - req_builder = req_builder.query(&[("ordering", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_page { - req_builder = req_builder.query(&[("page", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_page_size { - req_builder = req_builder.query(&[("page_size", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_search { - req_builder = req_builder.query(&[("search", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_source__slug { - req_builder = req_builder.query(&[("source__slug", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_user { - req_builder = req_builder.query(&[("user", ¶m_value.to_string())]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::PaginatedUserSamlSourceConnectionList`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::PaginatedUserSamlSourceConnectionList`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// User-source connection Viewset -pub async fn sources_user_connections_saml_partial_update( - configuration: &configuration::Configuration, - id: i32, - patched_user_saml_source_connection_request: Option< - models::PatchedUserSamlSourceConnectionRequest, - >, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_id = id; - let p_body_patched_user_saml_source_connection_request = - patched_user_saml_source_connection_request; - - let uri_str = format!( - "{}/sources/user_connections/saml/{id}/", - configuration.base_path, - id = p_path_id - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::PATCH, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - req_builder = req_builder.json(&p_body_patched_user_saml_source_connection_request); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::UserSamlSourceConnection`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::UserSamlSourceConnection`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// User-source connection Viewset -pub async fn sources_user_connections_saml_retrieve( - configuration: &configuration::Configuration, - id: i32, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_id = id; - - let uri_str = format!( - "{}/sources/user_connections/saml/{id}/", - configuration.base_path, - id = p_path_id - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::UserSamlSourceConnection`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::UserSamlSourceConnection`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// User-source connection Viewset -pub async fn sources_user_connections_saml_update( - configuration: &configuration::Configuration, - id: i32, - user_saml_source_connection_request: models::UserSamlSourceConnectionRequest, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_id = id; - let p_body_user_saml_source_connection_request = user_saml_source_connection_request; - - let uri_str = format!( - "{}/sources/user_connections/saml/{id}/", - configuration.base_path, - id = p_path_id - ); - let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - req_builder = req_builder.json(&p_body_user_saml_source_connection_request); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::UserSamlSourceConnection`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::UserSamlSourceConnection`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Get a list of all objects that use this object -pub async fn sources_user_connections_saml_used_by_list( - configuration: &configuration::Configuration, - id: i32, -) -> Result, Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_id = id; - - let uri_str = format!( - "{}/sources/user_connections/saml/{id}/used_by/", - configuration.base_path, - id = p_path_id - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `Vec<models::UsedBy>`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `Vec<models::UsedBy>`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// User-source connection Viewset -pub async fn sources_user_connections_telegram_create( - configuration: &configuration::Configuration, - user_telegram_source_connection_request: models::UserTelegramSourceConnectionRequest, -) -> Result> -{ - // add a prefix to parameters to efficiently prevent name collisions - let p_body_user_telegram_source_connection_request = user_telegram_source_connection_request; - - let uri_str = format!( - "{}/sources/user_connections/telegram/", - configuration.base_path - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::POST, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - req_builder = req_builder.json(&p_body_user_telegram_source_connection_request); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::UserTelegramSourceConnection`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::UserTelegramSourceConnection`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// User-source connection Viewset -pub async fn sources_user_connections_telegram_destroy( - configuration: &configuration::Configuration, - id: i32, -) -> Result<(), Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_id = id; - - let uri_str = format!( - "{}/sources/user_connections/telegram/{id}/", - configuration.base_path, - id = p_path_id - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::DELETE, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - - if !status.is_client_error() && !status.is_server_error() { - Ok(()) - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// User-source connection Viewset -pub async fn sources_user_connections_telegram_list( - configuration: &configuration::Configuration, - ordering: Option<&str>, - page: Option, - page_size: Option, - search: Option<&str>, - source__slug: Option<&str>, - user: Option, -) -> Result< - models::PaginatedUserTelegramSourceConnectionList, - Error, -> { - // add a prefix to parameters to efficiently prevent name collisions - let p_query_ordering = ordering; - let p_query_page = page; - let p_query_page_size = page_size; - let p_query_search = search; - let p_query_source__slug = source__slug; - let p_query_user = user; - - let uri_str = format!( - "{}/sources/user_connections/telegram/", - configuration.base_path - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref param_value) = p_query_ordering { - req_builder = req_builder.query(&[("ordering", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_page { - req_builder = req_builder.query(&[("page", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_page_size { - req_builder = req_builder.query(&[("page_size", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_search { - req_builder = req_builder.query(&[("search", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_source__slug { - req_builder = req_builder.query(&[("source__slug", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_user { - req_builder = req_builder.query(&[("user", ¶m_value.to_string())]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::PaginatedUserTelegramSourceConnectionList`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::PaginatedUserTelegramSourceConnectionList`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// User-source connection Viewset -pub async fn sources_user_connections_telegram_partial_update( - configuration: &configuration::Configuration, - id: i32, - patched_user_telegram_source_connection_request: Option< - models::PatchedUserTelegramSourceConnectionRequest, - >, -) -> Result< - models::UserTelegramSourceConnection, - Error, -> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_id = id; - let p_body_patched_user_telegram_source_connection_request = - patched_user_telegram_source_connection_request; - - let uri_str = format!( - "{}/sources/user_connections/telegram/{id}/", - configuration.base_path, - id = p_path_id - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::PATCH, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - req_builder = req_builder.json(&p_body_patched_user_telegram_source_connection_request); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::UserTelegramSourceConnection`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::UserTelegramSourceConnection`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// User-source connection Viewset -pub async fn sources_user_connections_telegram_retrieve( - configuration: &configuration::Configuration, - id: i32, -) -> Result> -{ - // add a prefix to parameters to efficiently prevent name collisions - let p_path_id = id; - - let uri_str = format!( - "{}/sources/user_connections/telegram/{id}/", - configuration.base_path, - id = p_path_id - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::UserTelegramSourceConnection`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::UserTelegramSourceConnection`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// User-source connection Viewset -pub async fn sources_user_connections_telegram_update( - configuration: &configuration::Configuration, - id: i32, - user_telegram_source_connection_request: models::UserTelegramSourceConnectionRequest, -) -> Result> -{ - // add a prefix to parameters to efficiently prevent name collisions - let p_path_id = id; - let p_body_user_telegram_source_connection_request = user_telegram_source_connection_request; - - let uri_str = format!( - "{}/sources/user_connections/telegram/{id}/", - configuration.base_path, - id = p_path_id - ); - let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - req_builder = req_builder.json(&p_body_user_telegram_source_connection_request); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::UserTelegramSourceConnection`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::UserTelegramSourceConnection`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Get a list of all objects that use this object -pub async fn sources_user_connections_telegram_used_by_list( - configuration: &configuration::Configuration, - id: i32, -) -> Result, Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_id = id; - - let uri_str = format!( - "{}/sources/user_connections/telegram/{id}/used_by/", - configuration.base_path, - id = p_path_id - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `Vec<models::UsedBy>`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `Vec<models::UsedBy>`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} diff --git a/packages/client-rust/src/apis/ssf_api.rs b/packages/client-rust/src/apis/ssf_api.rs deleted file mode 100644 index 1f0b3e029c..0000000000 --- a/packages/client-rust/src/apis/ssf_api.rs +++ /dev/null @@ -1,233 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use reqwest; -use serde::{Deserialize, Serialize, de::Error as _}; - -use super::{ContentType, Error, configuration}; -use crate::{apis::ResponseContent, models}; - -/// struct for typed errors of method [`ssf_streams_destroy`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum SsfStreamsDestroyError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`ssf_streams_list`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum SsfStreamsListError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`ssf_streams_retrieve`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum SsfStreamsRetrieveError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// SSFStream Viewset -pub async fn ssf_streams_destroy( - configuration: &configuration::Configuration, - uuid: &str, -) -> Result<(), Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_uuid = uuid; - - let uri_str = format!( - "{}/ssf/streams/{uuid}/", - configuration.base_path, - uuid = crate::apis::urlencode(p_path_uuid) - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::DELETE, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - - if !status.is_client_error() && !status.is_server_error() { - Ok(()) - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// SSFStream Viewset -pub async fn ssf_streams_list( - configuration: &configuration::Configuration, - delivery_method: Option, - endpoint_url: Option<&str>, - ordering: Option<&str>, - page: Option, - page_size: Option, - provider: Option, - search: Option<&str>, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_query_delivery_method = delivery_method; - let p_query_endpoint_url = endpoint_url; - let p_query_ordering = ordering; - let p_query_page = page; - let p_query_page_size = page_size; - let p_query_provider = provider; - let p_query_search = search; - - let uri_str = format!("{}/ssf/streams/", configuration.base_path); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref param_value) = p_query_delivery_method { - req_builder = req_builder.query(&[("delivery_method", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_endpoint_url { - req_builder = req_builder.query(&[("endpoint_url", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_ordering { - req_builder = req_builder.query(&[("ordering", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_page { - req_builder = req_builder.query(&[("page", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_page_size { - req_builder = req_builder.query(&[("page_size", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_provider { - req_builder = req_builder.query(&[("provider", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_search { - req_builder = req_builder.query(&[("search", ¶m_value.to_string())]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::PaginatedSsfStreamList`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::PaginatedSsfStreamList`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// SSFStream Viewset -pub async fn ssf_streams_retrieve( - configuration: &configuration::Configuration, - uuid: &str, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_uuid = uuid; - - let uri_str = format!( - "{}/ssf/streams/{uuid}/", - configuration.base_path, - uuid = crate::apis::urlencode(p_path_uuid) - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::SsfStream`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::SsfStream`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} diff --git a/packages/client-rust/src/apis/stages_api.rs b/packages/client-rust/src/apis/stages_api.rs deleted file mode 100644 index c36d1c44ec..0000000000 --- a/packages/client-rust/src/apis/stages_api.rs +++ /dev/null @@ -1,15173 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use reqwest; -use serde::{Deserialize, Serialize, de::Error as _}; - -use super::{ContentType, Error, configuration}; -use crate::{apis::ResponseContent, models}; - -/// struct for typed errors of method [`stages_all_destroy`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum StagesAllDestroyError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`stages_all_list`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum StagesAllListError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`stages_all_retrieve`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum StagesAllRetrieveError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`stages_all_types_list`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum StagesAllTypesListError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`stages_all_used_by_list`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum StagesAllUsedByListError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`stages_all_user_settings_list`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum StagesAllUserSettingsListError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`stages_authenticator_duo_create`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum StagesAuthenticatorDuoCreateError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`stages_authenticator_duo_destroy`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum StagesAuthenticatorDuoDestroyError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`stages_authenticator_duo_enrollment_status_create`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum StagesAuthenticatorDuoEnrollmentStatusCreateError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`stages_authenticator_duo_import_device_manual_create`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum StagesAuthenticatorDuoImportDeviceManualCreateError { - Status400(), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`stages_authenticator_duo_import_devices_automatic_create`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum StagesAuthenticatorDuoImportDevicesAutomaticCreateError { - Status400(), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`stages_authenticator_duo_list`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum StagesAuthenticatorDuoListError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`stages_authenticator_duo_partial_update`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum StagesAuthenticatorDuoPartialUpdateError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`stages_authenticator_duo_retrieve`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum StagesAuthenticatorDuoRetrieveError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`stages_authenticator_duo_update`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum StagesAuthenticatorDuoUpdateError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`stages_authenticator_duo_used_by_list`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum StagesAuthenticatorDuoUsedByListError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`stages_authenticator_email_create`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum StagesAuthenticatorEmailCreateError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`stages_authenticator_email_destroy`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum StagesAuthenticatorEmailDestroyError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`stages_authenticator_email_list`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum StagesAuthenticatorEmailListError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`stages_authenticator_email_partial_update`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum StagesAuthenticatorEmailPartialUpdateError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`stages_authenticator_email_retrieve`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum StagesAuthenticatorEmailRetrieveError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`stages_authenticator_email_update`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum StagesAuthenticatorEmailUpdateError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`stages_authenticator_email_used_by_list`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum StagesAuthenticatorEmailUsedByListError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`stages_authenticator_endpoint_gdtc_create`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum StagesAuthenticatorEndpointGdtcCreateError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`stages_authenticator_endpoint_gdtc_destroy`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum StagesAuthenticatorEndpointGdtcDestroyError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`stages_authenticator_endpoint_gdtc_list`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum StagesAuthenticatorEndpointGdtcListError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`stages_authenticator_endpoint_gdtc_partial_update`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum StagesAuthenticatorEndpointGdtcPartialUpdateError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`stages_authenticator_endpoint_gdtc_retrieve`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum StagesAuthenticatorEndpointGdtcRetrieveError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`stages_authenticator_endpoint_gdtc_update`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum StagesAuthenticatorEndpointGdtcUpdateError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`stages_authenticator_endpoint_gdtc_used_by_list`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum StagesAuthenticatorEndpointGdtcUsedByListError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`stages_authenticator_sms_create`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum StagesAuthenticatorSmsCreateError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`stages_authenticator_sms_destroy`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum StagesAuthenticatorSmsDestroyError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`stages_authenticator_sms_list`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum StagesAuthenticatorSmsListError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`stages_authenticator_sms_partial_update`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum StagesAuthenticatorSmsPartialUpdateError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`stages_authenticator_sms_retrieve`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum StagesAuthenticatorSmsRetrieveError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`stages_authenticator_sms_update`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum StagesAuthenticatorSmsUpdateError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`stages_authenticator_sms_used_by_list`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum StagesAuthenticatorSmsUsedByListError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`stages_authenticator_static_create`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum StagesAuthenticatorStaticCreateError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`stages_authenticator_static_destroy`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum StagesAuthenticatorStaticDestroyError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`stages_authenticator_static_list`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum StagesAuthenticatorStaticListError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`stages_authenticator_static_partial_update`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum StagesAuthenticatorStaticPartialUpdateError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`stages_authenticator_static_retrieve`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum StagesAuthenticatorStaticRetrieveError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`stages_authenticator_static_update`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum StagesAuthenticatorStaticUpdateError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`stages_authenticator_static_used_by_list`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum StagesAuthenticatorStaticUsedByListError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`stages_authenticator_totp_create`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum StagesAuthenticatorTotpCreateError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`stages_authenticator_totp_destroy`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum StagesAuthenticatorTotpDestroyError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`stages_authenticator_totp_list`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum StagesAuthenticatorTotpListError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`stages_authenticator_totp_partial_update`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum StagesAuthenticatorTotpPartialUpdateError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`stages_authenticator_totp_retrieve`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum StagesAuthenticatorTotpRetrieveError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`stages_authenticator_totp_update`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum StagesAuthenticatorTotpUpdateError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`stages_authenticator_totp_used_by_list`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum StagesAuthenticatorTotpUsedByListError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`stages_authenticator_validate_create`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum StagesAuthenticatorValidateCreateError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`stages_authenticator_validate_destroy`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum StagesAuthenticatorValidateDestroyError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`stages_authenticator_validate_list`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum StagesAuthenticatorValidateListError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`stages_authenticator_validate_partial_update`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum StagesAuthenticatorValidatePartialUpdateError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`stages_authenticator_validate_retrieve`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum StagesAuthenticatorValidateRetrieveError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`stages_authenticator_validate_update`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum StagesAuthenticatorValidateUpdateError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`stages_authenticator_validate_used_by_list`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum StagesAuthenticatorValidateUsedByListError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`stages_authenticator_webauthn_create`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum StagesAuthenticatorWebauthnCreateError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`stages_authenticator_webauthn_destroy`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum StagesAuthenticatorWebauthnDestroyError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`stages_authenticator_webauthn_device_types_list`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum StagesAuthenticatorWebauthnDeviceTypesListError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`stages_authenticator_webauthn_device_types_retrieve`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum StagesAuthenticatorWebauthnDeviceTypesRetrieveError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`stages_authenticator_webauthn_list`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum StagesAuthenticatorWebauthnListError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`stages_authenticator_webauthn_partial_update`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum StagesAuthenticatorWebauthnPartialUpdateError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`stages_authenticator_webauthn_retrieve`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum StagesAuthenticatorWebauthnRetrieveError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`stages_authenticator_webauthn_update`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum StagesAuthenticatorWebauthnUpdateError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`stages_authenticator_webauthn_used_by_list`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum StagesAuthenticatorWebauthnUsedByListError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`stages_captcha_create`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum StagesCaptchaCreateError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`stages_captcha_destroy`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum StagesCaptchaDestroyError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`stages_captcha_list`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum StagesCaptchaListError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`stages_captcha_partial_update`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum StagesCaptchaPartialUpdateError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`stages_captcha_retrieve`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum StagesCaptchaRetrieveError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`stages_captcha_update`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum StagesCaptchaUpdateError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`stages_captcha_used_by_list`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum StagesCaptchaUsedByListError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`stages_consent_create`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum StagesConsentCreateError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`stages_consent_destroy`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum StagesConsentDestroyError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`stages_consent_list`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum StagesConsentListError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`stages_consent_partial_update`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum StagesConsentPartialUpdateError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`stages_consent_retrieve`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum StagesConsentRetrieveError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`stages_consent_update`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum StagesConsentUpdateError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`stages_consent_used_by_list`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum StagesConsentUsedByListError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`stages_deny_create`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum StagesDenyCreateError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`stages_deny_destroy`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum StagesDenyDestroyError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`stages_deny_list`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum StagesDenyListError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`stages_deny_partial_update`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum StagesDenyPartialUpdateError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`stages_deny_retrieve`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum StagesDenyRetrieveError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`stages_deny_update`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum StagesDenyUpdateError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`stages_deny_used_by_list`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum StagesDenyUsedByListError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`stages_dummy_create`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum StagesDummyCreateError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`stages_dummy_destroy`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum StagesDummyDestroyError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`stages_dummy_list`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum StagesDummyListError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`stages_dummy_partial_update`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum StagesDummyPartialUpdateError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`stages_dummy_retrieve`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum StagesDummyRetrieveError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`stages_dummy_update`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum StagesDummyUpdateError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`stages_dummy_used_by_list`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum StagesDummyUsedByListError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`stages_email_create`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum StagesEmailCreateError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`stages_email_destroy`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum StagesEmailDestroyError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`stages_email_list`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum StagesEmailListError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`stages_email_partial_update`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum StagesEmailPartialUpdateError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`stages_email_retrieve`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum StagesEmailRetrieveError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`stages_email_templates_list`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum StagesEmailTemplatesListError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`stages_email_update`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum StagesEmailUpdateError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`stages_email_used_by_list`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum StagesEmailUsedByListError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`stages_endpoints_create`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum StagesEndpointsCreateError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`stages_endpoints_destroy`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum StagesEndpointsDestroyError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`stages_endpoints_list`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum StagesEndpointsListError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`stages_endpoints_partial_update`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum StagesEndpointsPartialUpdateError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`stages_endpoints_retrieve`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum StagesEndpointsRetrieveError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`stages_endpoints_update`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum StagesEndpointsUpdateError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`stages_endpoints_used_by_list`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum StagesEndpointsUsedByListError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`stages_identification_create`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum StagesIdentificationCreateError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`stages_identification_destroy`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum StagesIdentificationDestroyError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`stages_identification_list`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum StagesIdentificationListError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`stages_identification_partial_update`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum StagesIdentificationPartialUpdateError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`stages_identification_retrieve`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum StagesIdentificationRetrieveError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`stages_identification_update`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum StagesIdentificationUpdateError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`stages_identification_used_by_list`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum StagesIdentificationUsedByListError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`stages_invitation_invitations_create`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum StagesInvitationInvitationsCreateError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`stages_invitation_invitations_destroy`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum StagesInvitationInvitationsDestroyError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`stages_invitation_invitations_list`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum StagesInvitationInvitationsListError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`stages_invitation_invitations_partial_update`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum StagesInvitationInvitationsPartialUpdateError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`stages_invitation_invitations_retrieve`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum StagesInvitationInvitationsRetrieveError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`stages_invitation_invitations_send_email_create`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum StagesInvitationInvitationsSendEmailCreateError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`stages_invitation_invitations_update`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum StagesInvitationInvitationsUpdateError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`stages_invitation_invitations_used_by_list`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum StagesInvitationInvitationsUsedByListError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`stages_invitation_stages_create`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum StagesInvitationStagesCreateError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`stages_invitation_stages_destroy`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum StagesInvitationStagesDestroyError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`stages_invitation_stages_list`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum StagesInvitationStagesListError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`stages_invitation_stages_partial_update`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum StagesInvitationStagesPartialUpdateError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`stages_invitation_stages_retrieve`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum StagesInvitationStagesRetrieveError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`stages_invitation_stages_update`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum StagesInvitationStagesUpdateError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`stages_invitation_stages_used_by_list`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum StagesInvitationStagesUsedByListError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`stages_mtls_create`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum StagesMtlsCreateError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`stages_mtls_destroy`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum StagesMtlsDestroyError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`stages_mtls_list`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum StagesMtlsListError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`stages_mtls_partial_update`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum StagesMtlsPartialUpdateError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`stages_mtls_retrieve`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum StagesMtlsRetrieveError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`stages_mtls_update`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum StagesMtlsUpdateError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`stages_mtls_used_by_list`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum StagesMtlsUsedByListError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`stages_password_create`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum StagesPasswordCreateError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`stages_password_destroy`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum StagesPasswordDestroyError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`stages_password_list`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum StagesPasswordListError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`stages_password_partial_update`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum StagesPasswordPartialUpdateError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`stages_password_retrieve`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum StagesPasswordRetrieveError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`stages_password_update`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum StagesPasswordUpdateError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`stages_password_used_by_list`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum StagesPasswordUsedByListError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`stages_prompt_prompts_create`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum StagesPromptPromptsCreateError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`stages_prompt_prompts_destroy`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum StagesPromptPromptsDestroyError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`stages_prompt_prompts_list`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum StagesPromptPromptsListError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`stages_prompt_prompts_partial_update`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum StagesPromptPromptsPartialUpdateError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`stages_prompt_prompts_preview_create`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum StagesPromptPromptsPreviewCreateError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`stages_prompt_prompts_retrieve`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum StagesPromptPromptsRetrieveError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`stages_prompt_prompts_update`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum StagesPromptPromptsUpdateError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`stages_prompt_prompts_used_by_list`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum StagesPromptPromptsUsedByListError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`stages_prompt_stages_create`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum StagesPromptStagesCreateError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`stages_prompt_stages_destroy`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum StagesPromptStagesDestroyError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`stages_prompt_stages_list`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum StagesPromptStagesListError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`stages_prompt_stages_partial_update`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum StagesPromptStagesPartialUpdateError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`stages_prompt_stages_retrieve`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum StagesPromptStagesRetrieveError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`stages_prompt_stages_update`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum StagesPromptStagesUpdateError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`stages_prompt_stages_used_by_list`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum StagesPromptStagesUsedByListError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`stages_redirect_create`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum StagesRedirectCreateError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`stages_redirect_destroy`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum StagesRedirectDestroyError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`stages_redirect_list`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum StagesRedirectListError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`stages_redirect_partial_update`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum StagesRedirectPartialUpdateError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`stages_redirect_retrieve`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum StagesRedirectRetrieveError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`stages_redirect_update`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum StagesRedirectUpdateError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`stages_redirect_used_by_list`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum StagesRedirectUsedByListError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`stages_source_create`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum StagesSourceCreateError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`stages_source_destroy`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum StagesSourceDestroyError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`stages_source_list`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum StagesSourceListError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`stages_source_partial_update`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum StagesSourcePartialUpdateError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`stages_source_retrieve`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum StagesSourceRetrieveError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`stages_source_update`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum StagesSourceUpdateError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`stages_source_used_by_list`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum StagesSourceUsedByListError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`stages_user_delete_create`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum StagesUserDeleteCreateError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`stages_user_delete_destroy`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum StagesUserDeleteDestroyError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`stages_user_delete_list`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum StagesUserDeleteListError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`stages_user_delete_partial_update`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum StagesUserDeletePartialUpdateError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`stages_user_delete_retrieve`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum StagesUserDeleteRetrieveError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`stages_user_delete_update`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum StagesUserDeleteUpdateError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`stages_user_delete_used_by_list`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum StagesUserDeleteUsedByListError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`stages_user_login_create`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum StagesUserLoginCreateError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`stages_user_login_destroy`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum StagesUserLoginDestroyError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`stages_user_login_list`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum StagesUserLoginListError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`stages_user_login_partial_update`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum StagesUserLoginPartialUpdateError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`stages_user_login_retrieve`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum StagesUserLoginRetrieveError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`stages_user_login_update`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum StagesUserLoginUpdateError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`stages_user_login_used_by_list`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum StagesUserLoginUsedByListError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`stages_user_logout_create`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum StagesUserLogoutCreateError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`stages_user_logout_destroy`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum StagesUserLogoutDestroyError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`stages_user_logout_list`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum StagesUserLogoutListError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`stages_user_logout_partial_update`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum StagesUserLogoutPartialUpdateError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`stages_user_logout_retrieve`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum StagesUserLogoutRetrieveError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`stages_user_logout_update`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum StagesUserLogoutUpdateError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`stages_user_logout_used_by_list`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum StagesUserLogoutUsedByListError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`stages_user_write_create`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum StagesUserWriteCreateError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`stages_user_write_destroy`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum StagesUserWriteDestroyError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`stages_user_write_list`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum StagesUserWriteListError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`stages_user_write_partial_update`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum StagesUserWritePartialUpdateError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`stages_user_write_retrieve`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum StagesUserWriteRetrieveError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`stages_user_write_update`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum StagesUserWriteUpdateError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`stages_user_write_used_by_list`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum StagesUserWriteUsedByListError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// Stage Viewset -pub async fn stages_all_destroy( - configuration: &configuration::Configuration, - stage_uuid: &str, -) -> Result<(), Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_stage_uuid = stage_uuid; - - let uri_str = format!( - "{}/stages/all/{stage_uuid}/", - configuration.base_path, - stage_uuid = crate::apis::urlencode(p_path_stage_uuid) - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::DELETE, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - - if !status.is_client_error() && !status.is_server_error() { - Ok(()) - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Stage Viewset -pub async fn stages_all_list( - configuration: &configuration::Configuration, - name: Option<&str>, - ordering: Option<&str>, - page: Option, - page_size: Option, - search: Option<&str>, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_query_name = name; - let p_query_ordering = ordering; - let p_query_page = page; - let p_query_page_size = page_size; - let p_query_search = search; - - let uri_str = format!("{}/stages/all/", configuration.base_path); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref param_value) = p_query_name { - req_builder = req_builder.query(&[("name", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_ordering { - req_builder = req_builder.query(&[("ordering", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_page { - req_builder = req_builder.query(&[("page", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_page_size { - req_builder = req_builder.query(&[("page_size", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_search { - req_builder = req_builder.query(&[("search", ¶m_value.to_string())]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::PaginatedStageList`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::PaginatedStageList`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Stage Viewset -pub async fn stages_all_retrieve( - configuration: &configuration::Configuration, - stage_uuid: &str, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_stage_uuid = stage_uuid; - - let uri_str = format!( - "{}/stages/all/{stage_uuid}/", - configuration.base_path, - stage_uuid = crate::apis::urlencode(p_path_stage_uuid) - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::Stage`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::Stage`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Get all creatable types -pub async fn stages_all_types_list( - configuration: &configuration::Configuration, -) -> Result, Error> { - let uri_str = format!("{}/stages/all/types/", configuration.base_path); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `Vec<models::TypeCreate>`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `Vec<models::TypeCreate>`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Get a list of all objects that use this object -pub async fn stages_all_used_by_list( - configuration: &configuration::Configuration, - stage_uuid: &str, -) -> Result, Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_stage_uuid = stage_uuid; - - let uri_str = format!( - "{}/stages/all/{stage_uuid}/used_by/", - configuration.base_path, - stage_uuid = crate::apis::urlencode(p_path_stage_uuid) - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `Vec<models::UsedBy>`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `Vec<models::UsedBy>`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Get all stages the user can configure -pub async fn stages_all_user_settings_list( - configuration: &configuration::Configuration, -) -> Result, Error> { - let uri_str = format!("{}/stages/all/user_settings/", configuration.base_path); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `Vec<models::UserSetting>`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `Vec<models::UserSetting>`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// AuthenticatorDuoStage Viewset -pub async fn stages_authenticator_duo_create( - configuration: &configuration::Configuration, - authenticator_duo_stage_request: models::AuthenticatorDuoStageRequest, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_body_authenticator_duo_stage_request = authenticator_duo_stage_request; - - let uri_str = format!("{}/stages/authenticator/duo/", configuration.base_path); - let mut req_builder = configuration - .client - .request(reqwest::Method::POST, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - req_builder = req_builder.json(&p_body_authenticator_duo_stage_request); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::AuthenticatorDuoStage`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::AuthenticatorDuoStage`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// AuthenticatorDuoStage Viewset -pub async fn stages_authenticator_duo_destroy( - configuration: &configuration::Configuration, - stage_uuid: &str, -) -> Result<(), Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_stage_uuid = stage_uuid; - - let uri_str = format!( - "{}/stages/authenticator/duo/{stage_uuid}/", - configuration.base_path, - stage_uuid = crate::apis::urlencode(p_path_stage_uuid) - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::DELETE, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - - if !status.is_client_error() && !status.is_server_error() { - Ok(()) - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Check enrollment status of user details in current session -pub async fn stages_authenticator_duo_enrollment_status_create( - configuration: &configuration::Configuration, - stage_uuid: &str, -) -> Result< - models::DuoDeviceEnrollmentStatus, - Error, -> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_stage_uuid = stage_uuid; - - let uri_str = format!( - "{}/stages/authenticator/duo/{stage_uuid}/enrollment_status/", - configuration.base_path, - stage_uuid = crate::apis::urlencode(p_path_stage_uuid) - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::POST, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::DuoDeviceEnrollmentStatus`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::DuoDeviceEnrollmentStatus`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Import duo devices into authentik -pub async fn stages_authenticator_duo_import_device_manual_create( - configuration: &configuration::Configuration, - stage_uuid: &str, - authenticator_duo_stage_manual_device_import_request: models::AuthenticatorDuoStageManualDeviceImportRequest, -) -> Result<(), Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_stage_uuid = stage_uuid; - let p_body_authenticator_duo_stage_manual_device_import_request = - authenticator_duo_stage_manual_device_import_request; - - let uri_str = format!( - "{}/stages/authenticator/duo/{stage_uuid}/import_device_manual/", - configuration.base_path, - stage_uuid = crate::apis::urlencode(p_path_stage_uuid) - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::POST, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - req_builder = req_builder.json(&p_body_authenticator_duo_stage_manual_device_import_request); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - - if !status.is_client_error() && !status.is_server_error() { - Ok(()) - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Import duo devices into authentik -pub async fn stages_authenticator_duo_import_devices_automatic_create( - configuration: &configuration::Configuration, - stage_uuid: &str, -) -> Result< - models::AuthenticatorDuoStageDeviceImportResponse, - Error, -> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_stage_uuid = stage_uuid; - - let uri_str = format!( - "{}/stages/authenticator/duo/{stage_uuid}/import_devices_automatic/", - configuration.base_path, - stage_uuid = crate::apis::urlencode(p_path_stage_uuid) - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::POST, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::AuthenticatorDuoStageDeviceImportResponse`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::AuthenticatorDuoStageDeviceImportResponse`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// AuthenticatorDuoStage Viewset -pub async fn stages_authenticator_duo_list( - configuration: &configuration::Configuration, - api_hostname: Option<&str>, - client_id: Option<&str>, - configure_flow: Option<&str>, - name: Option<&str>, - ordering: Option<&str>, - page: Option, - page_size: Option, - search: Option<&str>, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_query_api_hostname = api_hostname; - let p_query_client_id = client_id; - let p_query_configure_flow = configure_flow; - let p_query_name = name; - let p_query_ordering = ordering; - let p_query_page = page; - let p_query_page_size = page_size; - let p_query_search = search; - - let uri_str = format!("{}/stages/authenticator/duo/", configuration.base_path); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref param_value) = p_query_api_hostname { - req_builder = req_builder.query(&[("api_hostname", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_client_id { - req_builder = req_builder.query(&[("client_id", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_configure_flow { - req_builder = req_builder.query(&[("configure_flow", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_name { - req_builder = req_builder.query(&[("name", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_ordering { - req_builder = req_builder.query(&[("ordering", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_page { - req_builder = req_builder.query(&[("page", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_page_size { - req_builder = req_builder.query(&[("page_size", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_search { - req_builder = req_builder.query(&[("search", ¶m_value.to_string())]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::PaginatedAuthenticatorDuoStageList`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::PaginatedAuthenticatorDuoStageList`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// AuthenticatorDuoStage Viewset -pub async fn stages_authenticator_duo_partial_update( - configuration: &configuration::Configuration, - stage_uuid: &str, - patched_authenticator_duo_stage_request: Option, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_stage_uuid = stage_uuid; - let p_body_patched_authenticator_duo_stage_request = patched_authenticator_duo_stage_request; - - let uri_str = format!( - "{}/stages/authenticator/duo/{stage_uuid}/", - configuration.base_path, - stage_uuid = crate::apis::urlencode(p_path_stage_uuid) - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::PATCH, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - req_builder = req_builder.json(&p_body_patched_authenticator_duo_stage_request); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::AuthenticatorDuoStage`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::AuthenticatorDuoStage`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// AuthenticatorDuoStage Viewset -pub async fn stages_authenticator_duo_retrieve( - configuration: &configuration::Configuration, - stage_uuid: &str, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_stage_uuid = stage_uuid; - - let uri_str = format!( - "{}/stages/authenticator/duo/{stage_uuid}/", - configuration.base_path, - stage_uuid = crate::apis::urlencode(p_path_stage_uuid) - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::AuthenticatorDuoStage`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::AuthenticatorDuoStage`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// AuthenticatorDuoStage Viewset -pub async fn stages_authenticator_duo_update( - configuration: &configuration::Configuration, - stage_uuid: &str, - authenticator_duo_stage_request: models::AuthenticatorDuoStageRequest, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_stage_uuid = stage_uuid; - let p_body_authenticator_duo_stage_request = authenticator_duo_stage_request; - - let uri_str = format!( - "{}/stages/authenticator/duo/{stage_uuid}/", - configuration.base_path, - stage_uuid = crate::apis::urlencode(p_path_stage_uuid) - ); - let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - req_builder = req_builder.json(&p_body_authenticator_duo_stage_request); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::AuthenticatorDuoStage`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::AuthenticatorDuoStage`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Get a list of all objects that use this object -pub async fn stages_authenticator_duo_used_by_list( - configuration: &configuration::Configuration, - stage_uuid: &str, -) -> Result, Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_stage_uuid = stage_uuid; - - let uri_str = format!( - "{}/stages/authenticator/duo/{stage_uuid}/used_by/", - configuration.base_path, - stage_uuid = crate::apis::urlencode(p_path_stage_uuid) - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `Vec<models::UsedBy>`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `Vec<models::UsedBy>`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// AuthenticatorEmailStage Viewset -pub async fn stages_authenticator_email_create( - configuration: &configuration::Configuration, - authenticator_email_stage_request: models::AuthenticatorEmailStageRequest, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_body_authenticator_email_stage_request = authenticator_email_stage_request; - - let uri_str = format!("{}/stages/authenticator/email/", configuration.base_path); - let mut req_builder = configuration - .client - .request(reqwest::Method::POST, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - req_builder = req_builder.json(&p_body_authenticator_email_stage_request); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::AuthenticatorEmailStage`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::AuthenticatorEmailStage`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// AuthenticatorEmailStage Viewset -pub async fn stages_authenticator_email_destroy( - configuration: &configuration::Configuration, - stage_uuid: &str, -) -> Result<(), Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_stage_uuid = stage_uuid; - - let uri_str = format!( - "{}/stages/authenticator/email/{stage_uuid}/", - configuration.base_path, - stage_uuid = crate::apis::urlencode(p_path_stage_uuid) - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::DELETE, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - - if !status.is_client_error() && !status.is_server_error() { - Ok(()) - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// AuthenticatorEmailStage Viewset -pub async fn stages_authenticator_email_list( - configuration: &configuration::Configuration, - configure_flow: Option<&str>, - friendly_name: Option<&str>, - from_address: Option<&str>, - host: Option<&str>, - name: Option<&str>, - ordering: Option<&str>, - page: Option, - page_size: Option, - password: Option<&str>, - port: Option, - search: Option<&str>, - stage_uuid: Option<&str>, - subject: Option<&str>, - template: Option<&str>, - timeout: Option, - token_expiry: Option<&str>, - use_global_settings: Option, - use_ssl: Option, - use_tls: Option, - username: Option<&str>, -) -> Result> -{ - // add a prefix to parameters to efficiently prevent name collisions - let p_query_configure_flow = configure_flow; - let p_query_friendly_name = friendly_name; - let p_query_from_address = from_address; - let p_query_host = host; - let p_query_name = name; - let p_query_ordering = ordering; - let p_query_page = page; - let p_query_page_size = page_size; - let p_query_password = password; - let p_query_port = port; - let p_query_search = search; - let p_query_stage_uuid = stage_uuid; - let p_query_subject = subject; - let p_query_template = template; - let p_query_timeout = timeout; - let p_query_token_expiry = token_expiry; - let p_query_use_global_settings = use_global_settings; - let p_query_use_ssl = use_ssl; - let p_query_use_tls = use_tls; - let p_query_username = username; - - let uri_str = format!("{}/stages/authenticator/email/", configuration.base_path); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref param_value) = p_query_configure_flow { - req_builder = req_builder.query(&[("configure_flow", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_friendly_name { - req_builder = req_builder.query(&[("friendly_name", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_from_address { - req_builder = req_builder.query(&[("from_address", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_host { - req_builder = req_builder.query(&[("host", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_name { - req_builder = req_builder.query(&[("name", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_ordering { - req_builder = req_builder.query(&[("ordering", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_page { - req_builder = req_builder.query(&[("page", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_page_size { - req_builder = req_builder.query(&[("page_size", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_password { - req_builder = req_builder.query(&[("password", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_port { - req_builder = req_builder.query(&[("port", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_search { - req_builder = req_builder.query(&[("search", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_stage_uuid { - req_builder = req_builder.query(&[("stage_uuid", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_subject { - req_builder = req_builder.query(&[("subject", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_template { - req_builder = req_builder.query(&[("template", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_timeout { - req_builder = req_builder.query(&[("timeout", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_token_expiry { - req_builder = req_builder.query(&[("token_expiry", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_use_global_settings { - req_builder = req_builder.query(&[("use_global_settings", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_use_ssl { - req_builder = req_builder.query(&[("use_ssl", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_use_tls { - req_builder = req_builder.query(&[("use_tls", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_username { - req_builder = req_builder.query(&[("username", ¶m_value.to_string())]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::PaginatedAuthenticatorEmailStageList`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::PaginatedAuthenticatorEmailStageList`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// AuthenticatorEmailStage Viewset -pub async fn stages_authenticator_email_partial_update( - configuration: &configuration::Configuration, - stage_uuid: &str, - patched_authenticator_email_stage_request: Option< - models::PatchedAuthenticatorEmailStageRequest, - >, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_stage_uuid = stage_uuid; - let p_body_patched_authenticator_email_stage_request = - patched_authenticator_email_stage_request; - - let uri_str = format!( - "{}/stages/authenticator/email/{stage_uuid}/", - configuration.base_path, - stage_uuid = crate::apis::urlencode(p_path_stage_uuid) - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::PATCH, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - req_builder = req_builder.json(&p_body_patched_authenticator_email_stage_request); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::AuthenticatorEmailStage`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::AuthenticatorEmailStage`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// AuthenticatorEmailStage Viewset -pub async fn stages_authenticator_email_retrieve( - configuration: &configuration::Configuration, - stage_uuid: &str, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_stage_uuid = stage_uuid; - - let uri_str = format!( - "{}/stages/authenticator/email/{stage_uuid}/", - configuration.base_path, - stage_uuid = crate::apis::urlencode(p_path_stage_uuid) - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::AuthenticatorEmailStage`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::AuthenticatorEmailStage`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// AuthenticatorEmailStage Viewset -pub async fn stages_authenticator_email_update( - configuration: &configuration::Configuration, - stage_uuid: &str, - authenticator_email_stage_request: models::AuthenticatorEmailStageRequest, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_stage_uuid = stage_uuid; - let p_body_authenticator_email_stage_request = authenticator_email_stage_request; - - let uri_str = format!( - "{}/stages/authenticator/email/{stage_uuid}/", - configuration.base_path, - stage_uuid = crate::apis::urlencode(p_path_stage_uuid) - ); - let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - req_builder = req_builder.json(&p_body_authenticator_email_stage_request); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::AuthenticatorEmailStage`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::AuthenticatorEmailStage`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Get a list of all objects that use this object -pub async fn stages_authenticator_email_used_by_list( - configuration: &configuration::Configuration, - stage_uuid: &str, -) -> Result, Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_stage_uuid = stage_uuid; - - let uri_str = format!( - "{}/stages/authenticator/email/{stage_uuid}/used_by/", - configuration.base_path, - stage_uuid = crate::apis::urlencode(p_path_stage_uuid) - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `Vec<models::UsedBy>`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `Vec<models::UsedBy>`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// AuthenticatorEndpointGDTCStage Viewset -pub async fn stages_authenticator_endpoint_gdtc_create( - configuration: &configuration::Configuration, - authenticator_endpoint_gdtc_stage_request: models::AuthenticatorEndpointGdtcStageRequest, -) -> Result> -{ - // add a prefix to parameters to efficiently prevent name collisions - let p_body_authenticator_endpoint_gdtc_stage_request = - authenticator_endpoint_gdtc_stage_request; - - let uri_str = format!( - "{}/stages/authenticator/endpoint_gdtc/", - configuration.base_path - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::POST, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - req_builder = req_builder.json(&p_body_authenticator_endpoint_gdtc_stage_request); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::AuthenticatorEndpointGdtcStage`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::AuthenticatorEndpointGdtcStage`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// AuthenticatorEndpointGDTCStage Viewset -pub async fn stages_authenticator_endpoint_gdtc_destroy( - configuration: &configuration::Configuration, - stage_uuid: &str, -) -> Result<(), Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_stage_uuid = stage_uuid; - - let uri_str = format!( - "{}/stages/authenticator/endpoint_gdtc/{stage_uuid}/", - configuration.base_path, - stage_uuid = crate::apis::urlencode(p_path_stage_uuid) - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::DELETE, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - - if !status.is_client_error() && !status.is_server_error() { - Ok(()) - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// AuthenticatorEndpointGDTCStage Viewset -pub async fn stages_authenticator_endpoint_gdtc_list( - configuration: &configuration::Configuration, - configure_flow: Option<&str>, - name: Option<&str>, - ordering: Option<&str>, - page: Option, - page_size: Option, - search: Option<&str>, -) -> Result< - models::PaginatedAuthenticatorEndpointGdtcStageList, - Error, -> { - // add a prefix to parameters to efficiently prevent name collisions - let p_query_configure_flow = configure_flow; - let p_query_name = name; - let p_query_ordering = ordering; - let p_query_page = page; - let p_query_page_size = page_size; - let p_query_search = search; - - let uri_str = format!( - "{}/stages/authenticator/endpoint_gdtc/", - configuration.base_path - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref param_value) = p_query_configure_flow { - req_builder = req_builder.query(&[("configure_flow", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_name { - req_builder = req_builder.query(&[("name", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_ordering { - req_builder = req_builder.query(&[("ordering", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_page { - req_builder = req_builder.query(&[("page", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_page_size { - req_builder = req_builder.query(&[("page_size", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_search { - req_builder = req_builder.query(&[("search", ¶m_value.to_string())]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::PaginatedAuthenticatorEndpointGdtcStageList`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::PaginatedAuthenticatorEndpointGdtcStageList`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// AuthenticatorEndpointGDTCStage Viewset -pub async fn stages_authenticator_endpoint_gdtc_partial_update( - configuration: &configuration::Configuration, - stage_uuid: &str, - patched_authenticator_endpoint_gdtc_stage_request: Option< - models::PatchedAuthenticatorEndpointGdtcStageRequest, - >, -) -> Result< - models::AuthenticatorEndpointGdtcStage, - Error, -> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_stage_uuid = stage_uuid; - let p_body_patched_authenticator_endpoint_gdtc_stage_request = - patched_authenticator_endpoint_gdtc_stage_request; - - let uri_str = format!( - "{}/stages/authenticator/endpoint_gdtc/{stage_uuid}/", - configuration.base_path, - stage_uuid = crate::apis::urlencode(p_path_stage_uuid) - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::PATCH, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - req_builder = req_builder.json(&p_body_patched_authenticator_endpoint_gdtc_stage_request); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::AuthenticatorEndpointGdtcStage`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::AuthenticatorEndpointGdtcStage`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// AuthenticatorEndpointGDTCStage Viewset -pub async fn stages_authenticator_endpoint_gdtc_retrieve( - configuration: &configuration::Configuration, - stage_uuid: &str, -) -> Result< - models::AuthenticatorEndpointGdtcStage, - Error, -> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_stage_uuid = stage_uuid; - - let uri_str = format!( - "{}/stages/authenticator/endpoint_gdtc/{stage_uuid}/", - configuration.base_path, - stage_uuid = crate::apis::urlencode(p_path_stage_uuid) - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::AuthenticatorEndpointGdtcStage`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::AuthenticatorEndpointGdtcStage`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// AuthenticatorEndpointGDTCStage Viewset -pub async fn stages_authenticator_endpoint_gdtc_update( - configuration: &configuration::Configuration, - stage_uuid: &str, - authenticator_endpoint_gdtc_stage_request: models::AuthenticatorEndpointGdtcStageRequest, -) -> Result> -{ - // add a prefix to parameters to efficiently prevent name collisions - let p_path_stage_uuid = stage_uuid; - let p_body_authenticator_endpoint_gdtc_stage_request = - authenticator_endpoint_gdtc_stage_request; - - let uri_str = format!( - "{}/stages/authenticator/endpoint_gdtc/{stage_uuid}/", - configuration.base_path, - stage_uuid = crate::apis::urlencode(p_path_stage_uuid) - ); - let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - req_builder = req_builder.json(&p_body_authenticator_endpoint_gdtc_stage_request); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::AuthenticatorEndpointGdtcStage`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::AuthenticatorEndpointGdtcStage`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Get a list of all objects that use this object -pub async fn stages_authenticator_endpoint_gdtc_used_by_list( - configuration: &configuration::Configuration, - stage_uuid: &str, -) -> Result, Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_stage_uuid = stage_uuid; - - let uri_str = format!( - "{}/stages/authenticator/endpoint_gdtc/{stage_uuid}/used_by/", - configuration.base_path, - stage_uuid = crate::apis::urlencode(p_path_stage_uuid) - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `Vec<models::UsedBy>`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `Vec<models::UsedBy>`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// AuthenticatorSMSStage Viewset -pub async fn stages_authenticator_sms_create( - configuration: &configuration::Configuration, - authenticator_sms_stage_request: models::AuthenticatorSmsStageRequest, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_body_authenticator_sms_stage_request = authenticator_sms_stage_request; - - let uri_str = format!("{}/stages/authenticator/sms/", configuration.base_path); - let mut req_builder = configuration - .client - .request(reqwest::Method::POST, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - req_builder = req_builder.json(&p_body_authenticator_sms_stage_request); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::AuthenticatorSmsStage`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::AuthenticatorSmsStage`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// AuthenticatorSMSStage Viewset -pub async fn stages_authenticator_sms_destroy( - configuration: &configuration::Configuration, - stage_uuid: &str, -) -> Result<(), Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_stage_uuid = stage_uuid; - - let uri_str = format!( - "{}/stages/authenticator/sms/{stage_uuid}/", - configuration.base_path, - stage_uuid = crate::apis::urlencode(p_path_stage_uuid) - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::DELETE, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - - if !status.is_client_error() && !status.is_server_error() { - Ok(()) - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// AuthenticatorSMSStage Viewset -pub async fn stages_authenticator_sms_list( - configuration: &configuration::Configuration, - account_sid: Option<&str>, - auth: Option<&str>, - auth_password: Option<&str>, - auth_type: Option, - configure_flow: Option<&str>, - friendly_name: Option<&str>, - from_number: Option<&str>, - mapping: Option<&str>, - name: Option<&str>, - ordering: Option<&str>, - page: Option, - page_size: Option, - provider: Option, - search: Option<&str>, - stage_uuid: Option<&str>, - verify_only: Option, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_query_account_sid = account_sid; - let p_query_auth = auth; - let p_query_auth_password = auth_password; - let p_query_auth_type = auth_type; - let p_query_configure_flow = configure_flow; - let p_query_friendly_name = friendly_name; - let p_query_from_number = from_number; - let p_query_mapping = mapping; - let p_query_name = name; - let p_query_ordering = ordering; - let p_query_page = page; - let p_query_page_size = page_size; - let p_query_provider = provider; - let p_query_search = search; - let p_query_stage_uuid = stage_uuid; - let p_query_verify_only = verify_only; - - let uri_str = format!("{}/stages/authenticator/sms/", configuration.base_path); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref param_value) = p_query_account_sid { - req_builder = req_builder.query(&[("account_sid", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_auth { - req_builder = req_builder.query(&[("auth", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_auth_password { - req_builder = req_builder.query(&[("auth_password", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_auth_type { - req_builder = req_builder.query(&[("auth_type", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_configure_flow { - req_builder = req_builder.query(&[("configure_flow", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_friendly_name { - req_builder = req_builder.query(&[("friendly_name", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_from_number { - req_builder = req_builder.query(&[("from_number", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_mapping { - req_builder = req_builder.query(&[("mapping", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_name { - req_builder = req_builder.query(&[("name", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_ordering { - req_builder = req_builder.query(&[("ordering", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_page { - req_builder = req_builder.query(&[("page", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_page_size { - req_builder = req_builder.query(&[("page_size", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_provider { - req_builder = req_builder.query(&[("provider", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_search { - req_builder = req_builder.query(&[("search", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_stage_uuid { - req_builder = req_builder.query(&[("stage_uuid", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_verify_only { - req_builder = req_builder.query(&[("verify_only", ¶m_value.to_string())]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::PaginatedAuthenticatorSmsStageList`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::PaginatedAuthenticatorSmsStageList`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// AuthenticatorSMSStage Viewset -pub async fn stages_authenticator_sms_partial_update( - configuration: &configuration::Configuration, - stage_uuid: &str, - patched_authenticator_sms_stage_request: Option, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_stage_uuid = stage_uuid; - let p_body_patched_authenticator_sms_stage_request = patched_authenticator_sms_stage_request; - - let uri_str = format!( - "{}/stages/authenticator/sms/{stage_uuid}/", - configuration.base_path, - stage_uuid = crate::apis::urlencode(p_path_stage_uuid) - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::PATCH, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - req_builder = req_builder.json(&p_body_patched_authenticator_sms_stage_request); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::AuthenticatorSmsStage`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::AuthenticatorSmsStage`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// AuthenticatorSMSStage Viewset -pub async fn stages_authenticator_sms_retrieve( - configuration: &configuration::Configuration, - stage_uuid: &str, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_stage_uuid = stage_uuid; - - let uri_str = format!( - "{}/stages/authenticator/sms/{stage_uuid}/", - configuration.base_path, - stage_uuid = crate::apis::urlencode(p_path_stage_uuid) - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::AuthenticatorSmsStage`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::AuthenticatorSmsStage`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// AuthenticatorSMSStage Viewset -pub async fn stages_authenticator_sms_update( - configuration: &configuration::Configuration, - stage_uuid: &str, - authenticator_sms_stage_request: models::AuthenticatorSmsStageRequest, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_stage_uuid = stage_uuid; - let p_body_authenticator_sms_stage_request = authenticator_sms_stage_request; - - let uri_str = format!( - "{}/stages/authenticator/sms/{stage_uuid}/", - configuration.base_path, - stage_uuid = crate::apis::urlencode(p_path_stage_uuid) - ); - let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - req_builder = req_builder.json(&p_body_authenticator_sms_stage_request); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::AuthenticatorSmsStage`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::AuthenticatorSmsStage`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Get a list of all objects that use this object -pub async fn stages_authenticator_sms_used_by_list( - configuration: &configuration::Configuration, - stage_uuid: &str, -) -> Result, Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_stage_uuid = stage_uuid; - - let uri_str = format!( - "{}/stages/authenticator/sms/{stage_uuid}/used_by/", - configuration.base_path, - stage_uuid = crate::apis::urlencode(p_path_stage_uuid) - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `Vec<models::UsedBy>`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `Vec<models::UsedBy>`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// AuthenticatorStaticStage Viewset -pub async fn stages_authenticator_static_create( - configuration: &configuration::Configuration, - authenticator_static_stage_request: models::AuthenticatorStaticStageRequest, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_body_authenticator_static_stage_request = authenticator_static_stage_request; - - let uri_str = format!("{}/stages/authenticator/static/", configuration.base_path); - let mut req_builder = configuration - .client - .request(reqwest::Method::POST, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - req_builder = req_builder.json(&p_body_authenticator_static_stage_request); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::AuthenticatorStaticStage`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::AuthenticatorStaticStage`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// AuthenticatorStaticStage Viewset -pub async fn stages_authenticator_static_destroy( - configuration: &configuration::Configuration, - stage_uuid: &str, -) -> Result<(), Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_stage_uuid = stage_uuid; - - let uri_str = format!( - "{}/stages/authenticator/static/{stage_uuid}/", - configuration.base_path, - stage_uuid = crate::apis::urlencode(p_path_stage_uuid) - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::DELETE, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - - if !status.is_client_error() && !status.is_server_error() { - Ok(()) - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// AuthenticatorStaticStage Viewset -pub async fn stages_authenticator_static_list( - configuration: &configuration::Configuration, - configure_flow: Option<&str>, - friendly_name: Option<&str>, - name: Option<&str>, - ordering: Option<&str>, - page: Option, - page_size: Option, - search: Option<&str>, - stage_uuid: Option<&str>, - token_count: Option, - token_length: Option, -) -> Result> -{ - // add a prefix to parameters to efficiently prevent name collisions - let p_query_configure_flow = configure_flow; - let p_query_friendly_name = friendly_name; - let p_query_name = name; - let p_query_ordering = ordering; - let p_query_page = page; - let p_query_page_size = page_size; - let p_query_search = search; - let p_query_stage_uuid = stage_uuid; - let p_query_token_count = token_count; - let p_query_token_length = token_length; - - let uri_str = format!("{}/stages/authenticator/static/", configuration.base_path); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref param_value) = p_query_configure_flow { - req_builder = req_builder.query(&[("configure_flow", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_friendly_name { - req_builder = req_builder.query(&[("friendly_name", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_name { - req_builder = req_builder.query(&[("name", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_ordering { - req_builder = req_builder.query(&[("ordering", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_page { - req_builder = req_builder.query(&[("page", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_page_size { - req_builder = req_builder.query(&[("page_size", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_search { - req_builder = req_builder.query(&[("search", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_stage_uuid { - req_builder = req_builder.query(&[("stage_uuid", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_token_count { - req_builder = req_builder.query(&[("token_count", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_token_length { - req_builder = req_builder.query(&[("token_length", ¶m_value.to_string())]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::PaginatedAuthenticatorStaticStageList`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::PaginatedAuthenticatorStaticStageList`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// AuthenticatorStaticStage Viewset -pub async fn stages_authenticator_static_partial_update( - configuration: &configuration::Configuration, - stage_uuid: &str, - patched_authenticator_static_stage_request: Option< - models::PatchedAuthenticatorStaticStageRequest, - >, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_stage_uuid = stage_uuid; - let p_body_patched_authenticator_static_stage_request = - patched_authenticator_static_stage_request; - - let uri_str = format!( - "{}/stages/authenticator/static/{stage_uuid}/", - configuration.base_path, - stage_uuid = crate::apis::urlencode(p_path_stage_uuid) - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::PATCH, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - req_builder = req_builder.json(&p_body_patched_authenticator_static_stage_request); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::AuthenticatorStaticStage`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::AuthenticatorStaticStage`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// AuthenticatorStaticStage Viewset -pub async fn stages_authenticator_static_retrieve( - configuration: &configuration::Configuration, - stage_uuid: &str, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_stage_uuid = stage_uuid; - - let uri_str = format!( - "{}/stages/authenticator/static/{stage_uuid}/", - configuration.base_path, - stage_uuid = crate::apis::urlencode(p_path_stage_uuid) - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::AuthenticatorStaticStage`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::AuthenticatorStaticStage`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// AuthenticatorStaticStage Viewset -pub async fn stages_authenticator_static_update( - configuration: &configuration::Configuration, - stage_uuid: &str, - authenticator_static_stage_request: models::AuthenticatorStaticStageRequest, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_stage_uuid = stage_uuid; - let p_body_authenticator_static_stage_request = authenticator_static_stage_request; - - let uri_str = format!( - "{}/stages/authenticator/static/{stage_uuid}/", - configuration.base_path, - stage_uuid = crate::apis::urlencode(p_path_stage_uuid) - ); - let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - req_builder = req_builder.json(&p_body_authenticator_static_stage_request); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::AuthenticatorStaticStage`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::AuthenticatorStaticStage`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Get a list of all objects that use this object -pub async fn stages_authenticator_static_used_by_list( - configuration: &configuration::Configuration, - stage_uuid: &str, -) -> Result, Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_stage_uuid = stage_uuid; - - let uri_str = format!( - "{}/stages/authenticator/static/{stage_uuid}/used_by/", - configuration.base_path, - stage_uuid = crate::apis::urlencode(p_path_stage_uuid) - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `Vec<models::UsedBy>`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `Vec<models::UsedBy>`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// AuthenticatorTOTPStage Viewset -pub async fn stages_authenticator_totp_create( - configuration: &configuration::Configuration, - authenticator_totp_stage_request: models::AuthenticatorTotpStageRequest, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_body_authenticator_totp_stage_request = authenticator_totp_stage_request; - - let uri_str = format!("{}/stages/authenticator/totp/", configuration.base_path); - let mut req_builder = configuration - .client - .request(reqwest::Method::POST, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - req_builder = req_builder.json(&p_body_authenticator_totp_stage_request); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::AuthenticatorTotpStage`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::AuthenticatorTotpStage`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// AuthenticatorTOTPStage Viewset -pub async fn stages_authenticator_totp_destroy( - configuration: &configuration::Configuration, - stage_uuid: &str, -) -> Result<(), Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_stage_uuid = stage_uuid; - - let uri_str = format!( - "{}/stages/authenticator/totp/{stage_uuid}/", - configuration.base_path, - stage_uuid = crate::apis::urlencode(p_path_stage_uuid) - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::DELETE, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - - if !status.is_client_error() && !status.is_server_error() { - Ok(()) - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// AuthenticatorTOTPStage Viewset -pub async fn stages_authenticator_totp_list( - configuration: &configuration::Configuration, - configure_flow: Option<&str>, - digits: Option, - friendly_name: Option<&str>, - name: Option<&str>, - ordering: Option<&str>, - page: Option, - page_size: Option, - search: Option<&str>, - stage_uuid: Option<&str>, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_query_configure_flow = configure_flow; - let p_query_digits = digits; - let p_query_friendly_name = friendly_name; - let p_query_name = name; - let p_query_ordering = ordering; - let p_query_page = page; - let p_query_page_size = page_size; - let p_query_search = search; - let p_query_stage_uuid = stage_uuid; - - let uri_str = format!("{}/stages/authenticator/totp/", configuration.base_path); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref param_value) = p_query_configure_flow { - req_builder = req_builder.query(&[("configure_flow", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_digits { - req_builder = req_builder.query(&[("digits", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_friendly_name { - req_builder = req_builder.query(&[("friendly_name", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_name { - req_builder = req_builder.query(&[("name", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_ordering { - req_builder = req_builder.query(&[("ordering", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_page { - req_builder = req_builder.query(&[("page", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_page_size { - req_builder = req_builder.query(&[("page_size", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_search { - req_builder = req_builder.query(&[("search", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_stage_uuid { - req_builder = req_builder.query(&[("stage_uuid", ¶m_value.to_string())]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::PaginatedAuthenticatorTotpStageList`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::PaginatedAuthenticatorTotpStageList`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// AuthenticatorTOTPStage Viewset -pub async fn stages_authenticator_totp_partial_update( - configuration: &configuration::Configuration, - stage_uuid: &str, - patched_authenticator_totp_stage_request: Option, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_stage_uuid = stage_uuid; - let p_body_patched_authenticator_totp_stage_request = patched_authenticator_totp_stage_request; - - let uri_str = format!( - "{}/stages/authenticator/totp/{stage_uuid}/", - configuration.base_path, - stage_uuid = crate::apis::urlencode(p_path_stage_uuid) - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::PATCH, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - req_builder = req_builder.json(&p_body_patched_authenticator_totp_stage_request); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::AuthenticatorTotpStage`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::AuthenticatorTotpStage`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// AuthenticatorTOTPStage Viewset -pub async fn stages_authenticator_totp_retrieve( - configuration: &configuration::Configuration, - stage_uuid: &str, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_stage_uuid = stage_uuid; - - let uri_str = format!( - "{}/stages/authenticator/totp/{stage_uuid}/", - configuration.base_path, - stage_uuid = crate::apis::urlencode(p_path_stage_uuid) - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::AuthenticatorTotpStage`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::AuthenticatorTotpStage`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// AuthenticatorTOTPStage Viewset -pub async fn stages_authenticator_totp_update( - configuration: &configuration::Configuration, - stage_uuid: &str, - authenticator_totp_stage_request: models::AuthenticatorTotpStageRequest, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_stage_uuid = stage_uuid; - let p_body_authenticator_totp_stage_request = authenticator_totp_stage_request; - - let uri_str = format!( - "{}/stages/authenticator/totp/{stage_uuid}/", - configuration.base_path, - stage_uuid = crate::apis::urlencode(p_path_stage_uuid) - ); - let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - req_builder = req_builder.json(&p_body_authenticator_totp_stage_request); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::AuthenticatorTotpStage`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::AuthenticatorTotpStage`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Get a list of all objects that use this object -pub async fn stages_authenticator_totp_used_by_list( - configuration: &configuration::Configuration, - stage_uuid: &str, -) -> Result, Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_stage_uuid = stage_uuid; - - let uri_str = format!( - "{}/stages/authenticator/totp/{stage_uuid}/used_by/", - configuration.base_path, - stage_uuid = crate::apis::urlencode(p_path_stage_uuid) - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `Vec<models::UsedBy>`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `Vec<models::UsedBy>`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// AuthenticatorValidateStage Viewset -pub async fn stages_authenticator_validate_create( - configuration: &configuration::Configuration, - authenticator_validate_stage_request: models::AuthenticatorValidateStageRequest, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_body_authenticator_validate_stage_request = authenticator_validate_stage_request; - - let uri_str = format!("{}/stages/authenticator/validate/", configuration.base_path); - let mut req_builder = configuration - .client - .request(reqwest::Method::POST, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - req_builder = req_builder.json(&p_body_authenticator_validate_stage_request); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::AuthenticatorValidateStage`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::AuthenticatorValidateStage`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// AuthenticatorValidateStage Viewset -pub async fn stages_authenticator_validate_destroy( - configuration: &configuration::Configuration, - stage_uuid: &str, -) -> Result<(), Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_stage_uuid = stage_uuid; - - let uri_str = format!( - "{}/stages/authenticator/validate/{stage_uuid}/", - configuration.base_path, - stage_uuid = crate::apis::urlencode(p_path_stage_uuid) - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::DELETE, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - - if !status.is_client_error() && !status.is_server_error() { - Ok(()) - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// AuthenticatorValidateStage Viewset -pub async fn stages_authenticator_validate_list( - configuration: &configuration::Configuration, - configuration_stages: Option>, - name: Option<&str>, - not_configured_action: Option, - ordering: Option<&str>, - page: Option, - page_size: Option, - search: Option<&str>, -) -> Result< - models::PaginatedAuthenticatorValidateStageList, - Error, -> { - // add a prefix to parameters to efficiently prevent name collisions - let p_query_configuration_stages = configuration_stages; - let p_query_name = name; - let p_query_not_configured_action = not_configured_action; - let p_query_ordering = ordering; - let p_query_page = page; - let p_query_page_size = page_size; - let p_query_search = search; - - let uri_str = format!("{}/stages/authenticator/validate/", configuration.base_path); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref param_value) = p_query_configuration_stages { - req_builder = match "multi" { - "multi" => req_builder.query( - ¶m_value - .into_iter() - .map(|p| ("configuration_stages".to_owned(), p.to_string())) - .collect::>(), - ), - _ => req_builder.query(&[( - "configuration_stages", - ¶m_value - .into_iter() - .map(|p| p.to_string()) - .collect::>() - .join(",") - .to_string(), - )]), - }; - } - if let Some(ref param_value) = p_query_name { - req_builder = req_builder.query(&[("name", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_not_configured_action { - req_builder = req_builder.query(&[("not_configured_action", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_ordering { - req_builder = req_builder.query(&[("ordering", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_page { - req_builder = req_builder.query(&[("page", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_page_size { - req_builder = req_builder.query(&[("page_size", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_search { - req_builder = req_builder.query(&[("search", ¶m_value.to_string())]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::PaginatedAuthenticatorValidateStageList`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::PaginatedAuthenticatorValidateStageList`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// AuthenticatorValidateStage Viewset -pub async fn stages_authenticator_validate_partial_update( - configuration: &configuration::Configuration, - stage_uuid: &str, - patched_authenticator_validate_stage_request: Option< - models::PatchedAuthenticatorValidateStageRequest, - >, -) -> Result> -{ - // add a prefix to parameters to efficiently prevent name collisions - let p_path_stage_uuid = stage_uuid; - let p_body_patched_authenticator_validate_stage_request = - patched_authenticator_validate_stage_request; - - let uri_str = format!( - "{}/stages/authenticator/validate/{stage_uuid}/", - configuration.base_path, - stage_uuid = crate::apis::urlencode(p_path_stage_uuid) - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::PATCH, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - req_builder = req_builder.json(&p_body_patched_authenticator_validate_stage_request); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::AuthenticatorValidateStage`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::AuthenticatorValidateStage`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// AuthenticatorValidateStage Viewset -pub async fn stages_authenticator_validate_retrieve( - configuration: &configuration::Configuration, - stage_uuid: &str, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_stage_uuid = stage_uuid; - - let uri_str = format!( - "{}/stages/authenticator/validate/{stage_uuid}/", - configuration.base_path, - stage_uuid = crate::apis::urlencode(p_path_stage_uuid) - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::AuthenticatorValidateStage`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::AuthenticatorValidateStage`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// AuthenticatorValidateStage Viewset -pub async fn stages_authenticator_validate_update( - configuration: &configuration::Configuration, - stage_uuid: &str, - authenticator_validate_stage_request: models::AuthenticatorValidateStageRequest, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_stage_uuid = stage_uuid; - let p_body_authenticator_validate_stage_request = authenticator_validate_stage_request; - - let uri_str = format!( - "{}/stages/authenticator/validate/{stage_uuid}/", - configuration.base_path, - stage_uuid = crate::apis::urlencode(p_path_stage_uuid) - ); - let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - req_builder = req_builder.json(&p_body_authenticator_validate_stage_request); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::AuthenticatorValidateStage`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::AuthenticatorValidateStage`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Get a list of all objects that use this object -pub async fn stages_authenticator_validate_used_by_list( - configuration: &configuration::Configuration, - stage_uuid: &str, -) -> Result, Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_stage_uuid = stage_uuid; - - let uri_str = format!( - "{}/stages/authenticator/validate/{stage_uuid}/used_by/", - configuration.base_path, - stage_uuid = crate::apis::urlencode(p_path_stage_uuid) - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `Vec<models::UsedBy>`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `Vec<models::UsedBy>`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// AuthenticatorWebAuthnStage Viewset -pub async fn stages_authenticator_webauthn_create( - configuration: &configuration::Configuration, - authenticator_web_authn_stage_request: models::AuthenticatorWebAuthnStageRequest, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_body_authenticator_web_authn_stage_request = authenticator_web_authn_stage_request; - - let uri_str = format!("{}/stages/authenticator/webauthn/", configuration.base_path); - let mut req_builder = configuration - .client - .request(reqwest::Method::POST, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - req_builder = req_builder.json(&p_body_authenticator_web_authn_stage_request); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::AuthenticatorWebAuthnStage`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::AuthenticatorWebAuthnStage`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// AuthenticatorWebAuthnStage Viewset -pub async fn stages_authenticator_webauthn_destroy( - configuration: &configuration::Configuration, - stage_uuid: &str, -) -> Result<(), Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_stage_uuid = stage_uuid; - - let uri_str = format!( - "{}/stages/authenticator/webauthn/{stage_uuid}/", - configuration.base_path, - stage_uuid = crate::apis::urlencode(p_path_stage_uuid) - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::DELETE, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - - if !status.is_client_error() && !status.is_server_error() { - Ok(()) - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// WebAuthnDeviceType Viewset -pub async fn stages_authenticator_webauthn_device_types_list( - configuration: &configuration::Configuration, - aaguid: Option<&str>, - description: Option<&str>, - icon: Option<&str>, - ordering: Option<&str>, - page: Option, - page_size: Option, - search: Option<&str>, -) -> Result< - models::PaginatedWebAuthnDeviceTypeList, - Error, -> { - // add a prefix to parameters to efficiently prevent name collisions - let p_query_aaguid = aaguid; - let p_query_description = description; - let p_query_icon = icon; - let p_query_ordering = ordering; - let p_query_page = page; - let p_query_page_size = page_size; - let p_query_search = search; - - let uri_str = format!( - "{}/stages/authenticator/webauthn_device_types/", - configuration.base_path - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref param_value) = p_query_aaguid { - req_builder = req_builder.query(&[("aaguid", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_description { - req_builder = req_builder.query(&[("description", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_icon { - req_builder = req_builder.query(&[("icon", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_ordering { - req_builder = req_builder.query(&[("ordering", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_page { - req_builder = req_builder.query(&[("page", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_page_size { - req_builder = req_builder.query(&[("page_size", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_search { - req_builder = req_builder.query(&[("search", ¶m_value.to_string())]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::PaginatedWebAuthnDeviceTypeList`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::PaginatedWebAuthnDeviceTypeList`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// WebAuthnDeviceType Viewset -pub async fn stages_authenticator_webauthn_device_types_retrieve( - configuration: &configuration::Configuration, - aaguid: &str, -) -> Result> -{ - // add a prefix to parameters to efficiently prevent name collisions - let p_path_aaguid = aaguid; - - let uri_str = format!( - "{}/stages/authenticator/webauthn_device_types/{aaguid}/", - configuration.base_path, - aaguid = crate::apis::urlencode(p_path_aaguid) - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::WebAuthnDeviceType`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::WebAuthnDeviceType`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// AuthenticatorWebAuthnStage Viewset -pub async fn stages_authenticator_webauthn_list( - configuration: &configuration::Configuration, - authenticator_attachment: Option, - configure_flow: Option<&str>, - device_type_restrictions: Option>, - max_attempts: Option, - name: Option<&str>, - ordering: Option<&str>, - page: Option, - page_size: Option, - resident_key_requirement: Option, - search: Option<&str>, - user_verification: Option, -) -> Result< - models::PaginatedAuthenticatorWebAuthnStageList, - Error, -> { - // add a prefix to parameters to efficiently prevent name collisions - let p_query_authenticator_attachment = authenticator_attachment; - let p_query_configure_flow = configure_flow; - let p_query_device_type_restrictions = device_type_restrictions; - let p_query_max_attempts = max_attempts; - let p_query_name = name; - let p_query_ordering = ordering; - let p_query_page = page; - let p_query_page_size = page_size; - let p_query_resident_key_requirement = resident_key_requirement; - let p_query_search = search; - let p_query_user_verification = user_verification; - - let uri_str = format!("{}/stages/authenticator/webauthn/", configuration.base_path); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref param_value) = p_query_authenticator_attachment { - req_builder = req_builder.query(&[("authenticator_attachment", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_configure_flow { - req_builder = req_builder.query(&[("configure_flow", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_device_type_restrictions { - req_builder = match "multi" { - "multi" => req_builder.query( - ¶m_value - .into_iter() - .map(|p| ("device_type_restrictions".to_owned(), p.to_string())) - .collect::>(), - ), - _ => req_builder.query(&[( - "device_type_restrictions", - ¶m_value - .into_iter() - .map(|p| p.to_string()) - .collect::>() - .join(",") - .to_string(), - )]), - }; - } - if let Some(ref param_value) = p_query_max_attempts { - req_builder = req_builder.query(&[("max_attempts", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_name { - req_builder = req_builder.query(&[("name", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_ordering { - req_builder = req_builder.query(&[("ordering", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_page { - req_builder = req_builder.query(&[("page", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_page_size { - req_builder = req_builder.query(&[("page_size", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_resident_key_requirement { - req_builder = req_builder.query(&[("resident_key_requirement", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_search { - req_builder = req_builder.query(&[("search", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_user_verification { - req_builder = req_builder.query(&[("user_verification", ¶m_value.to_string())]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::PaginatedAuthenticatorWebAuthnStageList`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::PaginatedAuthenticatorWebAuthnStageList`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// AuthenticatorWebAuthnStage Viewset -pub async fn stages_authenticator_webauthn_partial_update( - configuration: &configuration::Configuration, - stage_uuid: &str, - patched_authenticator_web_authn_stage_request: Option< - models::PatchedAuthenticatorWebAuthnStageRequest, - >, -) -> Result> -{ - // add a prefix to parameters to efficiently prevent name collisions - let p_path_stage_uuid = stage_uuid; - let p_body_patched_authenticator_web_authn_stage_request = - patched_authenticator_web_authn_stage_request; - - let uri_str = format!( - "{}/stages/authenticator/webauthn/{stage_uuid}/", - configuration.base_path, - stage_uuid = crate::apis::urlencode(p_path_stage_uuid) - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::PATCH, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - req_builder = req_builder.json(&p_body_patched_authenticator_web_authn_stage_request); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::AuthenticatorWebAuthnStage`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::AuthenticatorWebAuthnStage`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// AuthenticatorWebAuthnStage Viewset -pub async fn stages_authenticator_webauthn_retrieve( - configuration: &configuration::Configuration, - stage_uuid: &str, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_stage_uuid = stage_uuid; - - let uri_str = format!( - "{}/stages/authenticator/webauthn/{stage_uuid}/", - configuration.base_path, - stage_uuid = crate::apis::urlencode(p_path_stage_uuid) - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::AuthenticatorWebAuthnStage`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::AuthenticatorWebAuthnStage`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// AuthenticatorWebAuthnStage Viewset -pub async fn stages_authenticator_webauthn_update( - configuration: &configuration::Configuration, - stage_uuid: &str, - authenticator_web_authn_stage_request: models::AuthenticatorWebAuthnStageRequest, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_stage_uuid = stage_uuid; - let p_body_authenticator_web_authn_stage_request = authenticator_web_authn_stage_request; - - let uri_str = format!( - "{}/stages/authenticator/webauthn/{stage_uuid}/", - configuration.base_path, - stage_uuid = crate::apis::urlencode(p_path_stage_uuid) - ); - let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - req_builder = req_builder.json(&p_body_authenticator_web_authn_stage_request); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::AuthenticatorWebAuthnStage`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::AuthenticatorWebAuthnStage`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Get a list of all objects that use this object -pub async fn stages_authenticator_webauthn_used_by_list( - configuration: &configuration::Configuration, - stage_uuid: &str, -) -> Result, Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_stage_uuid = stage_uuid; - - let uri_str = format!( - "{}/stages/authenticator/webauthn/{stage_uuid}/used_by/", - configuration.base_path, - stage_uuid = crate::apis::urlencode(p_path_stage_uuid) - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `Vec<models::UsedBy>`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `Vec<models::UsedBy>`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// CaptchaStage Viewset -pub async fn stages_captcha_create( - configuration: &configuration::Configuration, - captcha_stage_request: models::CaptchaStageRequest, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_body_captcha_stage_request = captcha_stage_request; - - let uri_str = format!("{}/stages/captcha/", configuration.base_path); - let mut req_builder = configuration - .client - .request(reqwest::Method::POST, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - req_builder = req_builder.json(&p_body_captcha_stage_request); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::CaptchaStage`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::CaptchaStage`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// CaptchaStage Viewset -pub async fn stages_captcha_destroy( - configuration: &configuration::Configuration, - stage_uuid: &str, -) -> Result<(), Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_stage_uuid = stage_uuid; - - let uri_str = format!( - "{}/stages/captcha/{stage_uuid}/", - configuration.base_path, - stage_uuid = crate::apis::urlencode(p_path_stage_uuid) - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::DELETE, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - - if !status.is_client_error() && !status.is_server_error() { - Ok(()) - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// CaptchaStage Viewset -pub async fn stages_captcha_list( - configuration: &configuration::Configuration, - name: Option<&str>, - ordering: Option<&str>, - page: Option, - page_size: Option, - public_key: Option<&str>, - search: Option<&str>, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_query_name = name; - let p_query_ordering = ordering; - let p_query_page = page; - let p_query_page_size = page_size; - let p_query_public_key = public_key; - let p_query_search = search; - - let uri_str = format!("{}/stages/captcha/", configuration.base_path); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref param_value) = p_query_name { - req_builder = req_builder.query(&[("name", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_ordering { - req_builder = req_builder.query(&[("ordering", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_page { - req_builder = req_builder.query(&[("page", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_page_size { - req_builder = req_builder.query(&[("page_size", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_public_key { - req_builder = req_builder.query(&[("public_key", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_search { - req_builder = req_builder.query(&[("search", ¶m_value.to_string())]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::PaginatedCaptchaStageList`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::PaginatedCaptchaStageList`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// CaptchaStage Viewset -pub async fn stages_captcha_partial_update( - configuration: &configuration::Configuration, - stage_uuid: &str, - patched_captcha_stage_request: Option, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_stage_uuid = stage_uuid; - let p_body_patched_captcha_stage_request = patched_captcha_stage_request; - - let uri_str = format!( - "{}/stages/captcha/{stage_uuid}/", - configuration.base_path, - stage_uuid = crate::apis::urlencode(p_path_stage_uuid) - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::PATCH, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - req_builder = req_builder.json(&p_body_patched_captcha_stage_request); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::CaptchaStage`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::CaptchaStage`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// CaptchaStage Viewset -pub async fn stages_captcha_retrieve( - configuration: &configuration::Configuration, - stage_uuid: &str, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_stage_uuid = stage_uuid; - - let uri_str = format!( - "{}/stages/captcha/{stage_uuid}/", - configuration.base_path, - stage_uuid = crate::apis::urlencode(p_path_stage_uuid) - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::CaptchaStage`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::CaptchaStage`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// CaptchaStage Viewset -pub async fn stages_captcha_update( - configuration: &configuration::Configuration, - stage_uuid: &str, - captcha_stage_request: models::CaptchaStageRequest, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_stage_uuid = stage_uuid; - let p_body_captcha_stage_request = captcha_stage_request; - - let uri_str = format!( - "{}/stages/captcha/{stage_uuid}/", - configuration.base_path, - stage_uuid = crate::apis::urlencode(p_path_stage_uuid) - ); - let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - req_builder = req_builder.json(&p_body_captcha_stage_request); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::CaptchaStage`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::CaptchaStage`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Get a list of all objects that use this object -pub async fn stages_captcha_used_by_list( - configuration: &configuration::Configuration, - stage_uuid: &str, -) -> Result, Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_stage_uuid = stage_uuid; - - let uri_str = format!( - "{}/stages/captcha/{stage_uuid}/used_by/", - configuration.base_path, - stage_uuid = crate::apis::urlencode(p_path_stage_uuid) - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `Vec<models::UsedBy>`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `Vec<models::UsedBy>`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// ConsentStage Viewset -pub async fn stages_consent_create( - configuration: &configuration::Configuration, - consent_stage_request: models::ConsentStageRequest, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_body_consent_stage_request = consent_stage_request; - - let uri_str = format!("{}/stages/consent/", configuration.base_path); - let mut req_builder = configuration - .client - .request(reqwest::Method::POST, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - req_builder = req_builder.json(&p_body_consent_stage_request); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::ConsentStage`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::ConsentStage`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// ConsentStage Viewset -pub async fn stages_consent_destroy( - configuration: &configuration::Configuration, - stage_uuid: &str, -) -> Result<(), Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_stage_uuid = stage_uuid; - - let uri_str = format!( - "{}/stages/consent/{stage_uuid}/", - configuration.base_path, - stage_uuid = crate::apis::urlencode(p_path_stage_uuid) - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::DELETE, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - - if !status.is_client_error() && !status.is_server_error() { - Ok(()) - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// ConsentStage Viewset -pub async fn stages_consent_list( - configuration: &configuration::Configuration, - consent_expire_in: Option<&str>, - mode: Option, - name: Option<&str>, - ordering: Option<&str>, - page: Option, - page_size: Option, - search: Option<&str>, - stage_uuid: Option<&str>, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_query_consent_expire_in = consent_expire_in; - let p_query_mode = mode; - let p_query_name = name; - let p_query_ordering = ordering; - let p_query_page = page; - let p_query_page_size = page_size; - let p_query_search = search; - let p_query_stage_uuid = stage_uuid; - - let uri_str = format!("{}/stages/consent/", configuration.base_path); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref param_value) = p_query_consent_expire_in { - req_builder = req_builder.query(&[("consent_expire_in", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_mode { - req_builder = req_builder.query(&[("mode", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_name { - req_builder = req_builder.query(&[("name", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_ordering { - req_builder = req_builder.query(&[("ordering", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_page { - req_builder = req_builder.query(&[("page", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_page_size { - req_builder = req_builder.query(&[("page_size", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_search { - req_builder = req_builder.query(&[("search", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_stage_uuid { - req_builder = req_builder.query(&[("stage_uuid", ¶m_value.to_string())]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::PaginatedConsentStageList`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::PaginatedConsentStageList`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// ConsentStage Viewset -pub async fn stages_consent_partial_update( - configuration: &configuration::Configuration, - stage_uuid: &str, - patched_consent_stage_request: Option, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_stage_uuid = stage_uuid; - let p_body_patched_consent_stage_request = patched_consent_stage_request; - - let uri_str = format!( - "{}/stages/consent/{stage_uuid}/", - configuration.base_path, - stage_uuid = crate::apis::urlencode(p_path_stage_uuid) - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::PATCH, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - req_builder = req_builder.json(&p_body_patched_consent_stage_request); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::ConsentStage`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::ConsentStage`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// ConsentStage Viewset -pub async fn stages_consent_retrieve( - configuration: &configuration::Configuration, - stage_uuid: &str, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_stage_uuid = stage_uuid; - - let uri_str = format!( - "{}/stages/consent/{stage_uuid}/", - configuration.base_path, - stage_uuid = crate::apis::urlencode(p_path_stage_uuid) - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::ConsentStage`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::ConsentStage`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// ConsentStage Viewset -pub async fn stages_consent_update( - configuration: &configuration::Configuration, - stage_uuid: &str, - consent_stage_request: models::ConsentStageRequest, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_stage_uuid = stage_uuid; - let p_body_consent_stage_request = consent_stage_request; - - let uri_str = format!( - "{}/stages/consent/{stage_uuid}/", - configuration.base_path, - stage_uuid = crate::apis::urlencode(p_path_stage_uuid) - ); - let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - req_builder = req_builder.json(&p_body_consent_stage_request); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::ConsentStage`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::ConsentStage`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Get a list of all objects that use this object -pub async fn stages_consent_used_by_list( - configuration: &configuration::Configuration, - stage_uuid: &str, -) -> Result, Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_stage_uuid = stage_uuid; - - let uri_str = format!( - "{}/stages/consent/{stage_uuid}/used_by/", - configuration.base_path, - stage_uuid = crate::apis::urlencode(p_path_stage_uuid) - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `Vec<models::UsedBy>`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `Vec<models::UsedBy>`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// DenyStage Viewset -pub async fn stages_deny_create( - configuration: &configuration::Configuration, - deny_stage_request: models::DenyStageRequest, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_body_deny_stage_request = deny_stage_request; - - let uri_str = format!("{}/stages/deny/", configuration.base_path); - let mut req_builder = configuration - .client - .request(reqwest::Method::POST, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - req_builder = req_builder.json(&p_body_deny_stage_request); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::DenyStage`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::DenyStage`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// DenyStage Viewset -pub async fn stages_deny_destroy( - configuration: &configuration::Configuration, - stage_uuid: &str, -) -> Result<(), Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_stage_uuid = stage_uuid; - - let uri_str = format!( - "{}/stages/deny/{stage_uuid}/", - configuration.base_path, - stage_uuid = crate::apis::urlencode(p_path_stage_uuid) - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::DELETE, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - - if !status.is_client_error() && !status.is_server_error() { - Ok(()) - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// DenyStage Viewset -pub async fn stages_deny_list( - configuration: &configuration::Configuration, - deny_message: Option<&str>, - name: Option<&str>, - ordering: Option<&str>, - page: Option, - page_size: Option, - search: Option<&str>, - stage_uuid: Option<&str>, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_query_deny_message = deny_message; - let p_query_name = name; - let p_query_ordering = ordering; - let p_query_page = page; - let p_query_page_size = page_size; - let p_query_search = search; - let p_query_stage_uuid = stage_uuid; - - let uri_str = format!("{}/stages/deny/", configuration.base_path); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref param_value) = p_query_deny_message { - req_builder = req_builder.query(&[("deny_message", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_name { - req_builder = req_builder.query(&[("name", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_ordering { - req_builder = req_builder.query(&[("ordering", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_page { - req_builder = req_builder.query(&[("page", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_page_size { - req_builder = req_builder.query(&[("page_size", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_search { - req_builder = req_builder.query(&[("search", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_stage_uuid { - req_builder = req_builder.query(&[("stage_uuid", ¶m_value.to_string())]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::PaginatedDenyStageList`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::PaginatedDenyStageList`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// DenyStage Viewset -pub async fn stages_deny_partial_update( - configuration: &configuration::Configuration, - stage_uuid: &str, - patched_deny_stage_request: Option, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_stage_uuid = stage_uuid; - let p_body_patched_deny_stage_request = patched_deny_stage_request; - - let uri_str = format!( - "{}/stages/deny/{stage_uuid}/", - configuration.base_path, - stage_uuid = crate::apis::urlencode(p_path_stage_uuid) - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::PATCH, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - req_builder = req_builder.json(&p_body_patched_deny_stage_request); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::DenyStage`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::DenyStage`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// DenyStage Viewset -pub async fn stages_deny_retrieve( - configuration: &configuration::Configuration, - stage_uuid: &str, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_stage_uuid = stage_uuid; - - let uri_str = format!( - "{}/stages/deny/{stage_uuid}/", - configuration.base_path, - stage_uuid = crate::apis::urlencode(p_path_stage_uuid) - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::DenyStage`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::DenyStage`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// DenyStage Viewset -pub async fn stages_deny_update( - configuration: &configuration::Configuration, - stage_uuid: &str, - deny_stage_request: models::DenyStageRequest, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_stage_uuid = stage_uuid; - let p_body_deny_stage_request = deny_stage_request; - - let uri_str = format!( - "{}/stages/deny/{stage_uuid}/", - configuration.base_path, - stage_uuid = crate::apis::urlencode(p_path_stage_uuid) - ); - let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - req_builder = req_builder.json(&p_body_deny_stage_request); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::DenyStage`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::DenyStage`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Get a list of all objects that use this object -pub async fn stages_deny_used_by_list( - configuration: &configuration::Configuration, - stage_uuid: &str, -) -> Result, Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_stage_uuid = stage_uuid; - - let uri_str = format!( - "{}/stages/deny/{stage_uuid}/used_by/", - configuration.base_path, - stage_uuid = crate::apis::urlencode(p_path_stage_uuid) - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `Vec<models::UsedBy>`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `Vec<models::UsedBy>`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// DummyStage Viewset -pub async fn stages_dummy_create( - configuration: &configuration::Configuration, - dummy_stage_request: models::DummyStageRequest, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_body_dummy_stage_request = dummy_stage_request; - - let uri_str = format!("{}/stages/dummy/", configuration.base_path); - let mut req_builder = configuration - .client - .request(reqwest::Method::POST, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - req_builder = req_builder.json(&p_body_dummy_stage_request); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::DummyStage`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::DummyStage`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// DummyStage Viewset -pub async fn stages_dummy_destroy( - configuration: &configuration::Configuration, - stage_uuid: &str, -) -> Result<(), Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_stage_uuid = stage_uuid; - - let uri_str = format!( - "{}/stages/dummy/{stage_uuid}/", - configuration.base_path, - stage_uuid = crate::apis::urlencode(p_path_stage_uuid) - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::DELETE, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - - if !status.is_client_error() && !status.is_server_error() { - Ok(()) - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// DummyStage Viewset -pub async fn stages_dummy_list( - configuration: &configuration::Configuration, - name: Option<&str>, - ordering: Option<&str>, - page: Option, - page_size: Option, - search: Option<&str>, - stage_uuid: Option<&str>, - throw_error: Option, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_query_name = name; - let p_query_ordering = ordering; - let p_query_page = page; - let p_query_page_size = page_size; - let p_query_search = search; - let p_query_stage_uuid = stage_uuid; - let p_query_throw_error = throw_error; - - let uri_str = format!("{}/stages/dummy/", configuration.base_path); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref param_value) = p_query_name { - req_builder = req_builder.query(&[("name", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_ordering { - req_builder = req_builder.query(&[("ordering", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_page { - req_builder = req_builder.query(&[("page", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_page_size { - req_builder = req_builder.query(&[("page_size", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_search { - req_builder = req_builder.query(&[("search", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_stage_uuid { - req_builder = req_builder.query(&[("stage_uuid", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_throw_error { - req_builder = req_builder.query(&[("throw_error", ¶m_value.to_string())]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::PaginatedDummyStageList`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::PaginatedDummyStageList`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// DummyStage Viewset -pub async fn stages_dummy_partial_update( - configuration: &configuration::Configuration, - stage_uuid: &str, - patched_dummy_stage_request: Option, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_stage_uuid = stage_uuid; - let p_body_patched_dummy_stage_request = patched_dummy_stage_request; - - let uri_str = format!( - "{}/stages/dummy/{stage_uuid}/", - configuration.base_path, - stage_uuid = crate::apis::urlencode(p_path_stage_uuid) - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::PATCH, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - req_builder = req_builder.json(&p_body_patched_dummy_stage_request); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::DummyStage`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::DummyStage`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// DummyStage Viewset -pub async fn stages_dummy_retrieve( - configuration: &configuration::Configuration, - stage_uuid: &str, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_stage_uuid = stage_uuid; - - let uri_str = format!( - "{}/stages/dummy/{stage_uuid}/", - configuration.base_path, - stage_uuid = crate::apis::urlencode(p_path_stage_uuid) - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::DummyStage`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::DummyStage`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// DummyStage Viewset -pub async fn stages_dummy_update( - configuration: &configuration::Configuration, - stage_uuid: &str, - dummy_stage_request: models::DummyStageRequest, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_stage_uuid = stage_uuid; - let p_body_dummy_stage_request = dummy_stage_request; - - let uri_str = format!( - "{}/stages/dummy/{stage_uuid}/", - configuration.base_path, - stage_uuid = crate::apis::urlencode(p_path_stage_uuid) - ); - let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - req_builder = req_builder.json(&p_body_dummy_stage_request); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::DummyStage`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::DummyStage`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Get a list of all objects that use this object -pub async fn stages_dummy_used_by_list( - configuration: &configuration::Configuration, - stage_uuid: &str, -) -> Result, Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_stage_uuid = stage_uuid; - - let uri_str = format!( - "{}/stages/dummy/{stage_uuid}/used_by/", - configuration.base_path, - stage_uuid = crate::apis::urlencode(p_path_stage_uuid) - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `Vec<models::UsedBy>`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `Vec<models::UsedBy>`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// EmailStage Viewset -pub async fn stages_email_create( - configuration: &configuration::Configuration, - email_stage_request: models::EmailStageRequest, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_body_email_stage_request = email_stage_request; - - let uri_str = format!("{}/stages/email/", configuration.base_path); - let mut req_builder = configuration - .client - .request(reqwest::Method::POST, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - req_builder = req_builder.json(&p_body_email_stage_request); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::EmailStage`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::EmailStage`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// EmailStage Viewset -pub async fn stages_email_destroy( - configuration: &configuration::Configuration, - stage_uuid: &str, -) -> Result<(), Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_stage_uuid = stage_uuid; - - let uri_str = format!( - "{}/stages/email/{stage_uuid}/", - configuration.base_path, - stage_uuid = crate::apis::urlencode(p_path_stage_uuid) - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::DELETE, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - - if !status.is_client_error() && !status.is_server_error() { - Ok(()) - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// EmailStage Viewset -pub async fn stages_email_list( - configuration: &configuration::Configuration, - activate_user_on_success: Option, - from_address: Option<&str>, - host: Option<&str>, - name: Option<&str>, - ordering: Option<&str>, - page: Option, - page_size: Option, - port: Option, - search: Option<&str>, - subject: Option<&str>, - template: Option<&str>, - timeout: Option, - token_expiry: Option<&str>, - use_global_settings: Option, - use_ssl: Option, - use_tls: Option, - username: Option<&str>, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_query_activate_user_on_success = activate_user_on_success; - let p_query_from_address = from_address; - let p_query_host = host; - let p_query_name = name; - let p_query_ordering = ordering; - let p_query_page = page; - let p_query_page_size = page_size; - let p_query_port = port; - let p_query_search = search; - let p_query_subject = subject; - let p_query_template = template; - let p_query_timeout = timeout; - let p_query_token_expiry = token_expiry; - let p_query_use_global_settings = use_global_settings; - let p_query_use_ssl = use_ssl; - let p_query_use_tls = use_tls; - let p_query_username = username; - - let uri_str = format!("{}/stages/email/", configuration.base_path); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref param_value) = p_query_activate_user_on_success { - req_builder = req_builder.query(&[("activate_user_on_success", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_from_address { - req_builder = req_builder.query(&[("from_address", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_host { - req_builder = req_builder.query(&[("host", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_name { - req_builder = req_builder.query(&[("name", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_ordering { - req_builder = req_builder.query(&[("ordering", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_page { - req_builder = req_builder.query(&[("page", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_page_size { - req_builder = req_builder.query(&[("page_size", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_port { - req_builder = req_builder.query(&[("port", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_search { - req_builder = req_builder.query(&[("search", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_subject { - req_builder = req_builder.query(&[("subject", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_template { - req_builder = req_builder.query(&[("template", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_timeout { - req_builder = req_builder.query(&[("timeout", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_token_expiry { - req_builder = req_builder.query(&[("token_expiry", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_use_global_settings { - req_builder = req_builder.query(&[("use_global_settings", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_use_ssl { - req_builder = req_builder.query(&[("use_ssl", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_use_tls { - req_builder = req_builder.query(&[("use_tls", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_username { - req_builder = req_builder.query(&[("username", ¶m_value.to_string())]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::PaginatedEmailStageList`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::PaginatedEmailStageList`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// EmailStage Viewset -pub async fn stages_email_partial_update( - configuration: &configuration::Configuration, - stage_uuid: &str, - patched_email_stage_request: Option, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_stage_uuid = stage_uuid; - let p_body_patched_email_stage_request = patched_email_stage_request; - - let uri_str = format!( - "{}/stages/email/{stage_uuid}/", - configuration.base_path, - stage_uuid = crate::apis::urlencode(p_path_stage_uuid) - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::PATCH, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - req_builder = req_builder.json(&p_body_patched_email_stage_request); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::EmailStage`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::EmailStage`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// EmailStage Viewset -pub async fn stages_email_retrieve( - configuration: &configuration::Configuration, - stage_uuid: &str, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_stage_uuid = stage_uuid; - - let uri_str = format!( - "{}/stages/email/{stage_uuid}/", - configuration.base_path, - stage_uuid = crate::apis::urlencode(p_path_stage_uuid) - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::EmailStage`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::EmailStage`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Get all available templates, including custom templates -pub async fn stages_email_templates_list( - configuration: &configuration::Configuration, -) -> Result, Error> { - let uri_str = format!("{}/stages/email/templates/", configuration.base_path); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `Vec<models::TypeCreate>`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `Vec<models::TypeCreate>`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// EmailStage Viewset -pub async fn stages_email_update( - configuration: &configuration::Configuration, - stage_uuid: &str, - email_stage_request: models::EmailStageRequest, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_stage_uuid = stage_uuid; - let p_body_email_stage_request = email_stage_request; - - let uri_str = format!( - "{}/stages/email/{stage_uuid}/", - configuration.base_path, - stage_uuid = crate::apis::urlencode(p_path_stage_uuid) - ); - let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - req_builder = req_builder.json(&p_body_email_stage_request); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::EmailStage`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::EmailStage`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Get a list of all objects that use this object -pub async fn stages_email_used_by_list( - configuration: &configuration::Configuration, - stage_uuid: &str, -) -> Result, Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_stage_uuid = stage_uuid; - - let uri_str = format!( - "{}/stages/email/{stage_uuid}/used_by/", - configuration.base_path, - stage_uuid = crate::apis::urlencode(p_path_stage_uuid) - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `Vec<models::UsedBy>`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `Vec<models::UsedBy>`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// EndpointStage Viewset -pub async fn stages_endpoints_create( - configuration: &configuration::Configuration, - endpoint_stage_request: models::EndpointStageRequest, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_body_endpoint_stage_request = endpoint_stage_request; - - let uri_str = format!("{}/stages/endpoints/", configuration.base_path); - let mut req_builder = configuration - .client - .request(reqwest::Method::POST, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - req_builder = req_builder.json(&p_body_endpoint_stage_request); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::EndpointStage`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::EndpointStage`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// EndpointStage Viewset -pub async fn stages_endpoints_destroy( - configuration: &configuration::Configuration, - stage_uuid: &str, -) -> Result<(), Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_stage_uuid = stage_uuid; - - let uri_str = format!( - "{}/stages/endpoints/{stage_uuid}/", - configuration.base_path, - stage_uuid = crate::apis::urlencode(p_path_stage_uuid) - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::DELETE, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - - if !status.is_client_error() && !status.is_server_error() { - Ok(()) - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// EndpointStage Viewset -pub async fn stages_endpoints_list( - configuration: &configuration::Configuration, - name: Option<&str>, - ordering: Option<&str>, - page: Option, - page_size: Option, - search: Option<&str>, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_query_name = name; - let p_query_ordering = ordering; - let p_query_page = page; - let p_query_page_size = page_size; - let p_query_search = search; - - let uri_str = format!("{}/stages/endpoints/", configuration.base_path); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref param_value) = p_query_name { - req_builder = req_builder.query(&[("name", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_ordering { - req_builder = req_builder.query(&[("ordering", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_page { - req_builder = req_builder.query(&[("page", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_page_size { - req_builder = req_builder.query(&[("page_size", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_search { - req_builder = req_builder.query(&[("search", ¶m_value.to_string())]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::PaginatedEndpointStageList`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::PaginatedEndpointStageList`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// EndpointStage Viewset -pub async fn stages_endpoints_partial_update( - configuration: &configuration::Configuration, - stage_uuid: &str, - patched_endpoint_stage_request: Option, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_stage_uuid = stage_uuid; - let p_body_patched_endpoint_stage_request = patched_endpoint_stage_request; - - let uri_str = format!( - "{}/stages/endpoints/{stage_uuid}/", - configuration.base_path, - stage_uuid = crate::apis::urlencode(p_path_stage_uuid) - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::PATCH, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - req_builder = req_builder.json(&p_body_patched_endpoint_stage_request); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::EndpointStage`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::EndpointStage`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// EndpointStage Viewset -pub async fn stages_endpoints_retrieve( - configuration: &configuration::Configuration, - stage_uuid: &str, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_stage_uuid = stage_uuid; - - let uri_str = format!( - "{}/stages/endpoints/{stage_uuid}/", - configuration.base_path, - stage_uuid = crate::apis::urlencode(p_path_stage_uuid) - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::EndpointStage`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::EndpointStage`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// EndpointStage Viewset -pub async fn stages_endpoints_update( - configuration: &configuration::Configuration, - stage_uuid: &str, - endpoint_stage_request: models::EndpointStageRequest, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_stage_uuid = stage_uuid; - let p_body_endpoint_stage_request = endpoint_stage_request; - - let uri_str = format!( - "{}/stages/endpoints/{stage_uuid}/", - configuration.base_path, - stage_uuid = crate::apis::urlencode(p_path_stage_uuid) - ); - let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - req_builder = req_builder.json(&p_body_endpoint_stage_request); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::EndpointStage`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::EndpointStage`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Get a list of all objects that use this object -pub async fn stages_endpoints_used_by_list( - configuration: &configuration::Configuration, - stage_uuid: &str, -) -> Result, Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_stage_uuid = stage_uuid; - - let uri_str = format!( - "{}/stages/endpoints/{stage_uuid}/used_by/", - configuration.base_path, - stage_uuid = crate::apis::urlencode(p_path_stage_uuid) - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `Vec<models::UsedBy>`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `Vec<models::UsedBy>`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// IdentificationStage Viewset -pub async fn stages_identification_create( - configuration: &configuration::Configuration, - identification_stage_request: models::IdentificationStageRequest, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_body_identification_stage_request = identification_stage_request; - - let uri_str = format!("{}/stages/identification/", configuration.base_path); - let mut req_builder = configuration - .client - .request(reqwest::Method::POST, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - req_builder = req_builder.json(&p_body_identification_stage_request); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::IdentificationStage`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::IdentificationStage`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// IdentificationStage Viewset -pub async fn stages_identification_destroy( - configuration: &configuration::Configuration, - stage_uuid: &str, -) -> Result<(), Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_stage_uuid = stage_uuid; - - let uri_str = format!( - "{}/stages/identification/{stage_uuid}/", - configuration.base_path, - stage_uuid = crate::apis::urlencode(p_path_stage_uuid) - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::DELETE, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - - if !status.is_client_error() && !status.is_server_error() { - Ok(()) - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// IdentificationStage Viewset -pub async fn stages_identification_list( - configuration: &configuration::Configuration, - captcha_stage: Option<&str>, - case_insensitive_matching: Option, - enrollment_flow: Option<&str>, - name: Option<&str>, - ordering: Option<&str>, - page: Option, - page_size: Option, - password_stage: Option<&str>, - passwordless_flow: Option<&str>, - recovery_flow: Option<&str>, - search: Option<&str>, - show_matched_user: Option, - show_source_labels: Option, - webauthn_stage: Option<&str>, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_query_captcha_stage = captcha_stage; - let p_query_case_insensitive_matching = case_insensitive_matching; - let p_query_enrollment_flow = enrollment_flow; - let p_query_name = name; - let p_query_ordering = ordering; - let p_query_page = page; - let p_query_page_size = page_size; - let p_query_password_stage = password_stage; - let p_query_passwordless_flow = passwordless_flow; - let p_query_recovery_flow = recovery_flow; - let p_query_search = search; - let p_query_show_matched_user = show_matched_user; - let p_query_show_source_labels = show_source_labels; - let p_query_webauthn_stage = webauthn_stage; - - let uri_str = format!("{}/stages/identification/", configuration.base_path); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref param_value) = p_query_captcha_stage { - req_builder = req_builder.query(&[("captcha_stage", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_case_insensitive_matching { - req_builder = req_builder.query(&[("case_insensitive_matching", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_enrollment_flow { - req_builder = req_builder.query(&[("enrollment_flow", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_name { - req_builder = req_builder.query(&[("name", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_ordering { - req_builder = req_builder.query(&[("ordering", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_page { - req_builder = req_builder.query(&[("page", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_page_size { - req_builder = req_builder.query(&[("page_size", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_password_stage { - req_builder = req_builder.query(&[("password_stage", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_passwordless_flow { - req_builder = req_builder.query(&[("passwordless_flow", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_recovery_flow { - req_builder = req_builder.query(&[("recovery_flow", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_search { - req_builder = req_builder.query(&[("search", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_show_matched_user { - req_builder = req_builder.query(&[("show_matched_user", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_show_source_labels { - req_builder = req_builder.query(&[("show_source_labels", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_webauthn_stage { - req_builder = req_builder.query(&[("webauthn_stage", ¶m_value.to_string())]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::PaginatedIdentificationStageList`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::PaginatedIdentificationStageList`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// IdentificationStage Viewset -pub async fn stages_identification_partial_update( - configuration: &configuration::Configuration, - stage_uuid: &str, - patched_identification_stage_request: Option, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_stage_uuid = stage_uuid; - let p_body_patched_identification_stage_request = patched_identification_stage_request; - - let uri_str = format!( - "{}/stages/identification/{stage_uuid}/", - configuration.base_path, - stage_uuid = crate::apis::urlencode(p_path_stage_uuid) - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::PATCH, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - req_builder = req_builder.json(&p_body_patched_identification_stage_request); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::IdentificationStage`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::IdentificationStage`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// IdentificationStage Viewset -pub async fn stages_identification_retrieve( - configuration: &configuration::Configuration, - stage_uuid: &str, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_stage_uuid = stage_uuid; - - let uri_str = format!( - "{}/stages/identification/{stage_uuid}/", - configuration.base_path, - stage_uuid = crate::apis::urlencode(p_path_stage_uuid) - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::IdentificationStage`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::IdentificationStage`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// IdentificationStage Viewset -pub async fn stages_identification_update( - configuration: &configuration::Configuration, - stage_uuid: &str, - identification_stage_request: models::IdentificationStageRequest, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_stage_uuid = stage_uuid; - let p_body_identification_stage_request = identification_stage_request; - - let uri_str = format!( - "{}/stages/identification/{stage_uuid}/", - configuration.base_path, - stage_uuid = crate::apis::urlencode(p_path_stage_uuid) - ); - let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - req_builder = req_builder.json(&p_body_identification_stage_request); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::IdentificationStage`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::IdentificationStage`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Get a list of all objects that use this object -pub async fn stages_identification_used_by_list( - configuration: &configuration::Configuration, - stage_uuid: &str, -) -> Result, Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_stage_uuid = stage_uuid; - - let uri_str = format!( - "{}/stages/identification/{stage_uuid}/used_by/", - configuration.base_path, - stage_uuid = crate::apis::urlencode(p_path_stage_uuid) - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `Vec<models::UsedBy>`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `Vec<models::UsedBy>`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Invitation Viewset -pub async fn stages_invitation_invitations_create( - configuration: &configuration::Configuration, - invitation_request: models::InvitationRequest, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_body_invitation_request = invitation_request; - - let uri_str = format!("{}/stages/invitation/invitations/", configuration.base_path); - let mut req_builder = configuration - .client - .request(reqwest::Method::POST, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - req_builder = req_builder.json(&p_body_invitation_request); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::Invitation`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::Invitation`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Invitation Viewset -pub async fn stages_invitation_invitations_destroy( - configuration: &configuration::Configuration, - invite_uuid: &str, -) -> Result<(), Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_invite_uuid = invite_uuid; - - let uri_str = format!( - "{}/stages/invitation/invitations/{invite_uuid}/", - configuration.base_path, - invite_uuid = crate::apis::urlencode(p_path_invite_uuid) - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::DELETE, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - - if !status.is_client_error() && !status.is_server_error() { - Ok(()) - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Invitation Viewset -pub async fn stages_invitation_invitations_list( - configuration: &configuration::Configuration, - created_by__username: Option<&str>, - expires: Option, - flow__slug: Option<&str>, - name: Option<&str>, - ordering: Option<&str>, - page: Option, - page_size: Option, - search: Option<&str>, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_query_created_by__username = created_by__username; - let p_query_expires = expires; - let p_query_flow__slug = flow__slug; - let p_query_name = name; - let p_query_ordering = ordering; - let p_query_page = page; - let p_query_page_size = page_size; - let p_query_search = search; - - let uri_str = format!("{}/stages/invitation/invitations/", configuration.base_path); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref param_value) = p_query_created_by__username { - req_builder = req_builder.query(&[("created_by__username", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_expires { - req_builder = req_builder.query(&[("expires", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_flow__slug { - req_builder = req_builder.query(&[("flow__slug", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_name { - req_builder = req_builder.query(&[("name", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_ordering { - req_builder = req_builder.query(&[("ordering", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_page { - req_builder = req_builder.query(&[("page", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_page_size { - req_builder = req_builder.query(&[("page_size", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_search { - req_builder = req_builder.query(&[("search", ¶m_value.to_string())]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::PaginatedInvitationList`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::PaginatedInvitationList`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Invitation Viewset -pub async fn stages_invitation_invitations_partial_update( - configuration: &configuration::Configuration, - invite_uuid: &str, - patched_invitation_request: Option, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_invite_uuid = invite_uuid; - let p_body_patched_invitation_request = patched_invitation_request; - - let uri_str = format!( - "{}/stages/invitation/invitations/{invite_uuid}/", - configuration.base_path, - invite_uuid = crate::apis::urlencode(p_path_invite_uuid) - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::PATCH, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - req_builder = req_builder.json(&p_body_patched_invitation_request); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::Invitation`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::Invitation`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Invitation Viewset -pub async fn stages_invitation_invitations_retrieve( - configuration: &configuration::Configuration, - invite_uuid: &str, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_invite_uuid = invite_uuid; - - let uri_str = format!( - "{}/stages/invitation/invitations/{invite_uuid}/", - configuration.base_path, - invite_uuid = crate::apis::urlencode(p_path_invite_uuid) - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::Invitation`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::Invitation`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Send invitation link via email to one or more addresses -pub async fn stages_invitation_invitations_send_email_create( - configuration: &configuration::Configuration, - invite_uuid: &str, - invitation_send_email_request: models::InvitationSendEmailRequest, -) -> Result<(), Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_invite_uuid = invite_uuid; - let p_body_invitation_send_email_request = invitation_send_email_request; - - let uri_str = format!( - "{}/stages/invitation/invitations/{invite_uuid}/send_email/", - configuration.base_path, - invite_uuid = crate::apis::urlencode(p_path_invite_uuid) - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::POST, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - req_builder = req_builder.json(&p_body_invitation_send_email_request); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - - if !status.is_client_error() && !status.is_server_error() { - Ok(()) - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Invitation Viewset -pub async fn stages_invitation_invitations_update( - configuration: &configuration::Configuration, - invite_uuid: &str, - invitation_request: models::InvitationRequest, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_invite_uuid = invite_uuid; - let p_body_invitation_request = invitation_request; - - let uri_str = format!( - "{}/stages/invitation/invitations/{invite_uuid}/", - configuration.base_path, - invite_uuid = crate::apis::urlencode(p_path_invite_uuid) - ); - let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - req_builder = req_builder.json(&p_body_invitation_request); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::Invitation`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::Invitation`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Get a list of all objects that use this object -pub async fn stages_invitation_invitations_used_by_list( - configuration: &configuration::Configuration, - invite_uuid: &str, -) -> Result, Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_invite_uuid = invite_uuid; - - let uri_str = format!( - "{}/stages/invitation/invitations/{invite_uuid}/used_by/", - configuration.base_path, - invite_uuid = crate::apis::urlencode(p_path_invite_uuid) - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `Vec<models::UsedBy>`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `Vec<models::UsedBy>`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// InvitationStage Viewset -pub async fn stages_invitation_stages_create( - configuration: &configuration::Configuration, - invitation_stage_request: models::InvitationStageRequest, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_body_invitation_stage_request = invitation_stage_request; - - let uri_str = format!("{}/stages/invitation/stages/", configuration.base_path); - let mut req_builder = configuration - .client - .request(reqwest::Method::POST, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - req_builder = req_builder.json(&p_body_invitation_stage_request); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::InvitationStage`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::InvitationStage`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// InvitationStage Viewset -pub async fn stages_invitation_stages_destroy( - configuration: &configuration::Configuration, - stage_uuid: &str, -) -> Result<(), Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_stage_uuid = stage_uuid; - - let uri_str = format!( - "{}/stages/invitation/stages/{stage_uuid}/", - configuration.base_path, - stage_uuid = crate::apis::urlencode(p_path_stage_uuid) - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::DELETE, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - - if !status.is_client_error() && !status.is_server_error() { - Ok(()) - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// InvitationStage Viewset -pub async fn stages_invitation_stages_list( - configuration: &configuration::Configuration, - continue_flow_without_invitation: Option, - name: Option<&str>, - no_flows: Option, - ordering: Option<&str>, - page: Option, - page_size: Option, - search: Option<&str>, - stage_uuid: Option<&str>, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_query_continue_flow_without_invitation = continue_flow_without_invitation; - let p_query_name = name; - let p_query_no_flows = no_flows; - let p_query_ordering = ordering; - let p_query_page = page; - let p_query_page_size = page_size; - let p_query_search = search; - let p_query_stage_uuid = stage_uuid; - - let uri_str = format!("{}/stages/invitation/stages/", configuration.base_path); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref param_value) = p_query_continue_flow_without_invitation { - req_builder = - req_builder.query(&[("continue_flow_without_invitation", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_name { - req_builder = req_builder.query(&[("name", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_no_flows { - req_builder = req_builder.query(&[("no_flows", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_ordering { - req_builder = req_builder.query(&[("ordering", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_page { - req_builder = req_builder.query(&[("page", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_page_size { - req_builder = req_builder.query(&[("page_size", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_search { - req_builder = req_builder.query(&[("search", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_stage_uuid { - req_builder = req_builder.query(&[("stage_uuid", ¶m_value.to_string())]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::PaginatedInvitationStageList`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::PaginatedInvitationStageList`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// InvitationStage Viewset -pub async fn stages_invitation_stages_partial_update( - configuration: &configuration::Configuration, - stage_uuid: &str, - patched_invitation_stage_request: Option, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_stage_uuid = stage_uuid; - let p_body_patched_invitation_stage_request = patched_invitation_stage_request; - - let uri_str = format!( - "{}/stages/invitation/stages/{stage_uuid}/", - configuration.base_path, - stage_uuid = crate::apis::urlencode(p_path_stage_uuid) - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::PATCH, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - req_builder = req_builder.json(&p_body_patched_invitation_stage_request); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::InvitationStage`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::InvitationStage`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// InvitationStage Viewset -pub async fn stages_invitation_stages_retrieve( - configuration: &configuration::Configuration, - stage_uuid: &str, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_stage_uuid = stage_uuid; - - let uri_str = format!( - "{}/stages/invitation/stages/{stage_uuid}/", - configuration.base_path, - stage_uuid = crate::apis::urlencode(p_path_stage_uuid) - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::InvitationStage`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::InvitationStage`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// InvitationStage Viewset -pub async fn stages_invitation_stages_update( - configuration: &configuration::Configuration, - stage_uuid: &str, - invitation_stage_request: models::InvitationStageRequest, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_stage_uuid = stage_uuid; - let p_body_invitation_stage_request = invitation_stage_request; - - let uri_str = format!( - "{}/stages/invitation/stages/{stage_uuid}/", - configuration.base_path, - stage_uuid = crate::apis::urlencode(p_path_stage_uuid) - ); - let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - req_builder = req_builder.json(&p_body_invitation_stage_request); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::InvitationStage`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::InvitationStage`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Get a list of all objects that use this object -pub async fn stages_invitation_stages_used_by_list( - configuration: &configuration::Configuration, - stage_uuid: &str, -) -> Result, Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_stage_uuid = stage_uuid; - - let uri_str = format!( - "{}/stages/invitation/stages/{stage_uuid}/used_by/", - configuration.base_path, - stage_uuid = crate::apis::urlencode(p_path_stage_uuid) - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `Vec<models::UsedBy>`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `Vec<models::UsedBy>`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// MutualTLSStage Viewset -pub async fn stages_mtls_create( - configuration: &configuration::Configuration, - mutual_tls_stage_request: models::MutualTlsStageRequest, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_body_mutual_tls_stage_request = mutual_tls_stage_request; - - let uri_str = format!("{}/stages/mtls/", configuration.base_path); - let mut req_builder = configuration - .client - .request(reqwest::Method::POST, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - req_builder = req_builder.json(&p_body_mutual_tls_stage_request); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::MutualTlsStage`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::MutualTlsStage`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// MutualTLSStage Viewset -pub async fn stages_mtls_destroy( - configuration: &configuration::Configuration, - stage_uuid: &str, -) -> Result<(), Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_stage_uuid = stage_uuid; - - let uri_str = format!( - "{}/stages/mtls/{stage_uuid}/", - configuration.base_path, - stage_uuid = crate::apis::urlencode(p_path_stage_uuid) - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::DELETE, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - - if !status.is_client_error() && !status.is_server_error() { - Ok(()) - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// MutualTLSStage Viewset -pub async fn stages_mtls_list( - configuration: &configuration::Configuration, - cert_attribute: Option, - certificate_authorities: Option>, - mode: Option, - name: Option<&str>, - ordering: Option<&str>, - page: Option, - page_size: Option, - search: Option<&str>, - stage_uuid: Option<&str>, - user_attribute: Option, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_query_cert_attribute = cert_attribute; - let p_query_certificate_authorities = certificate_authorities; - let p_query_mode = mode; - let p_query_name = name; - let p_query_ordering = ordering; - let p_query_page = page; - let p_query_page_size = page_size; - let p_query_search = search; - let p_query_stage_uuid = stage_uuid; - let p_query_user_attribute = user_attribute; - - let uri_str = format!("{}/stages/mtls/", configuration.base_path); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref param_value) = p_query_cert_attribute { - req_builder = req_builder.query(&[("cert_attribute", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_certificate_authorities { - req_builder = match "multi" { - "multi" => req_builder.query( - ¶m_value - .into_iter() - .map(|p| ("certificate_authorities".to_owned(), p.to_string())) - .collect::>(), - ), - _ => req_builder.query(&[( - "certificate_authorities", - ¶m_value - .into_iter() - .map(|p| p.to_string()) - .collect::>() - .join(",") - .to_string(), - )]), - }; - } - if let Some(ref param_value) = p_query_mode { - req_builder = req_builder.query(&[("mode", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_name { - req_builder = req_builder.query(&[("name", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_ordering { - req_builder = req_builder.query(&[("ordering", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_page { - req_builder = req_builder.query(&[("page", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_page_size { - req_builder = req_builder.query(&[("page_size", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_search { - req_builder = req_builder.query(&[("search", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_stage_uuid { - req_builder = req_builder.query(&[("stage_uuid", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_user_attribute { - req_builder = req_builder.query(&[("user_attribute", ¶m_value.to_string())]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::PaginatedMutualTlsStageList`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::PaginatedMutualTlsStageList`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// MutualTLSStage Viewset -pub async fn stages_mtls_partial_update( - configuration: &configuration::Configuration, - stage_uuid: &str, - patched_mutual_tls_stage_request: Option, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_stage_uuid = stage_uuid; - let p_body_patched_mutual_tls_stage_request = patched_mutual_tls_stage_request; - - let uri_str = format!( - "{}/stages/mtls/{stage_uuid}/", - configuration.base_path, - stage_uuid = crate::apis::urlencode(p_path_stage_uuid) - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::PATCH, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - req_builder = req_builder.json(&p_body_patched_mutual_tls_stage_request); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::MutualTlsStage`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::MutualTlsStage`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// MutualTLSStage Viewset -pub async fn stages_mtls_retrieve( - configuration: &configuration::Configuration, - stage_uuid: &str, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_stage_uuid = stage_uuid; - - let uri_str = format!( - "{}/stages/mtls/{stage_uuid}/", - configuration.base_path, - stage_uuid = crate::apis::urlencode(p_path_stage_uuid) - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::MutualTlsStage`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::MutualTlsStage`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// MutualTLSStage Viewset -pub async fn stages_mtls_update( - configuration: &configuration::Configuration, - stage_uuid: &str, - mutual_tls_stage_request: models::MutualTlsStageRequest, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_stage_uuid = stage_uuid; - let p_body_mutual_tls_stage_request = mutual_tls_stage_request; - - let uri_str = format!( - "{}/stages/mtls/{stage_uuid}/", - configuration.base_path, - stage_uuid = crate::apis::urlencode(p_path_stage_uuid) - ); - let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - req_builder = req_builder.json(&p_body_mutual_tls_stage_request); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::MutualTlsStage`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::MutualTlsStage`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Get a list of all objects that use this object -pub async fn stages_mtls_used_by_list( - configuration: &configuration::Configuration, - stage_uuid: &str, -) -> Result, Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_stage_uuid = stage_uuid; - - let uri_str = format!( - "{}/stages/mtls/{stage_uuid}/used_by/", - configuration.base_path, - stage_uuid = crate::apis::urlencode(p_path_stage_uuid) - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `Vec<models::UsedBy>`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `Vec<models::UsedBy>`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// PasswordStage Viewset -pub async fn stages_password_create( - configuration: &configuration::Configuration, - password_stage_request: models::PasswordStageRequest, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_body_password_stage_request = password_stage_request; - - let uri_str = format!("{}/stages/password/", configuration.base_path); - let mut req_builder = configuration - .client - .request(reqwest::Method::POST, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - req_builder = req_builder.json(&p_body_password_stage_request); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::PasswordStage`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::PasswordStage`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// PasswordStage Viewset -pub async fn stages_password_destroy( - configuration: &configuration::Configuration, - stage_uuid: &str, -) -> Result<(), Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_stage_uuid = stage_uuid; - - let uri_str = format!( - "{}/stages/password/{stage_uuid}/", - configuration.base_path, - stage_uuid = crate::apis::urlencode(p_path_stage_uuid) - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::DELETE, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - - if !status.is_client_error() && !status.is_server_error() { - Ok(()) - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// PasswordStage Viewset -pub async fn stages_password_list( - configuration: &configuration::Configuration, - allow_show_password: Option, - configure_flow: Option<&str>, - failed_attempts_before_cancel: Option, - name: Option<&str>, - ordering: Option<&str>, - page: Option, - page_size: Option, - search: Option<&str>, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_query_allow_show_password = allow_show_password; - let p_query_configure_flow = configure_flow; - let p_query_failed_attempts_before_cancel = failed_attempts_before_cancel; - let p_query_name = name; - let p_query_ordering = ordering; - let p_query_page = page; - let p_query_page_size = page_size; - let p_query_search = search; - - let uri_str = format!("{}/stages/password/", configuration.base_path); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref param_value) = p_query_allow_show_password { - req_builder = req_builder.query(&[("allow_show_password", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_configure_flow { - req_builder = req_builder.query(&[("configure_flow", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_failed_attempts_before_cancel { - req_builder = - req_builder.query(&[("failed_attempts_before_cancel", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_name { - req_builder = req_builder.query(&[("name", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_ordering { - req_builder = req_builder.query(&[("ordering", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_page { - req_builder = req_builder.query(&[("page", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_page_size { - req_builder = req_builder.query(&[("page_size", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_search { - req_builder = req_builder.query(&[("search", ¶m_value.to_string())]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::PaginatedPasswordStageList`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::PaginatedPasswordStageList`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// PasswordStage Viewset -pub async fn stages_password_partial_update( - configuration: &configuration::Configuration, - stage_uuid: &str, - patched_password_stage_request: Option, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_stage_uuid = stage_uuid; - let p_body_patched_password_stage_request = patched_password_stage_request; - - let uri_str = format!( - "{}/stages/password/{stage_uuid}/", - configuration.base_path, - stage_uuid = crate::apis::urlencode(p_path_stage_uuid) - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::PATCH, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - req_builder = req_builder.json(&p_body_patched_password_stage_request); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::PasswordStage`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::PasswordStage`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// PasswordStage Viewset -pub async fn stages_password_retrieve( - configuration: &configuration::Configuration, - stage_uuid: &str, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_stage_uuid = stage_uuid; - - let uri_str = format!( - "{}/stages/password/{stage_uuid}/", - configuration.base_path, - stage_uuid = crate::apis::urlencode(p_path_stage_uuid) - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::PasswordStage`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::PasswordStage`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// PasswordStage Viewset -pub async fn stages_password_update( - configuration: &configuration::Configuration, - stage_uuid: &str, - password_stage_request: models::PasswordStageRequest, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_stage_uuid = stage_uuid; - let p_body_password_stage_request = password_stage_request; - - let uri_str = format!( - "{}/stages/password/{stage_uuid}/", - configuration.base_path, - stage_uuid = crate::apis::urlencode(p_path_stage_uuid) - ); - let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - req_builder = req_builder.json(&p_body_password_stage_request); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::PasswordStage`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::PasswordStage`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Get a list of all objects that use this object -pub async fn stages_password_used_by_list( - configuration: &configuration::Configuration, - stage_uuid: &str, -) -> Result, Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_stage_uuid = stage_uuid; - - let uri_str = format!( - "{}/stages/password/{stage_uuid}/used_by/", - configuration.base_path, - stage_uuid = crate::apis::urlencode(p_path_stage_uuid) - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `Vec<models::UsedBy>`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `Vec<models::UsedBy>`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Prompt Viewset -pub async fn stages_prompt_prompts_create( - configuration: &configuration::Configuration, - prompt_request: models::PromptRequest, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_body_prompt_request = prompt_request; - - let uri_str = format!("{}/stages/prompt/prompts/", configuration.base_path); - let mut req_builder = configuration - .client - .request(reqwest::Method::POST, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - req_builder = req_builder.json(&p_body_prompt_request); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::Prompt`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::Prompt`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Prompt Viewset -pub async fn stages_prompt_prompts_destroy( - configuration: &configuration::Configuration, - prompt_uuid: &str, -) -> Result<(), Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_prompt_uuid = prompt_uuid; - - let uri_str = format!( - "{}/stages/prompt/prompts/{prompt_uuid}/", - configuration.base_path, - prompt_uuid = crate::apis::urlencode(p_path_prompt_uuid) - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::DELETE, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - - if !status.is_client_error() && !status.is_server_error() { - Ok(()) - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Prompt Viewset -pub async fn stages_prompt_prompts_list( - configuration: &configuration::Configuration, - field_key: Option<&str>, - label: Option<&str>, - name: Option<&str>, - ordering: Option<&str>, - page: Option, - page_size: Option, - placeholder: Option<&str>, - search: Option<&str>, - r#type: Option, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_query_field_key = field_key; - let p_query_label = label; - let p_query_name = name; - let p_query_ordering = ordering; - let p_query_page = page; - let p_query_page_size = page_size; - let p_query_placeholder = placeholder; - let p_query_search = search; - let p_query_type = r#type; - - let uri_str = format!("{}/stages/prompt/prompts/", configuration.base_path); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref param_value) = p_query_field_key { - req_builder = req_builder.query(&[("field_key", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_label { - req_builder = req_builder.query(&[("label", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_name { - req_builder = req_builder.query(&[("name", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_ordering { - req_builder = req_builder.query(&[("ordering", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_page { - req_builder = req_builder.query(&[("page", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_page_size { - req_builder = req_builder.query(&[("page_size", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_placeholder { - req_builder = req_builder.query(&[("placeholder", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_search { - req_builder = req_builder.query(&[("search", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_type { - req_builder = req_builder.query(&[("type", ¶m_value.to_string())]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::PaginatedPromptList`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::PaginatedPromptList`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Prompt Viewset -pub async fn stages_prompt_prompts_partial_update( - configuration: &configuration::Configuration, - prompt_uuid: &str, - patched_prompt_request: Option, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_prompt_uuid = prompt_uuid; - let p_body_patched_prompt_request = patched_prompt_request; - - let uri_str = format!( - "{}/stages/prompt/prompts/{prompt_uuid}/", - configuration.base_path, - prompt_uuid = crate::apis::urlencode(p_path_prompt_uuid) - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::PATCH, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - req_builder = req_builder.json(&p_body_patched_prompt_request); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::Prompt`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::Prompt`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Preview a prompt as a challenge, just like a flow would receive -pub async fn stages_prompt_prompts_preview_create( - configuration: &configuration::Configuration, - prompt_request: models::PromptRequest, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_body_prompt_request = prompt_request; - - let uri_str = format!("{}/stages/prompt/prompts/preview/", configuration.base_path); - let mut req_builder = configuration - .client - .request(reqwest::Method::POST, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - req_builder = req_builder.json(&p_body_prompt_request); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::PromptChallenge`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::PromptChallenge`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Prompt Viewset -pub async fn stages_prompt_prompts_retrieve( - configuration: &configuration::Configuration, - prompt_uuid: &str, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_prompt_uuid = prompt_uuid; - - let uri_str = format!( - "{}/stages/prompt/prompts/{prompt_uuid}/", - configuration.base_path, - prompt_uuid = crate::apis::urlencode(p_path_prompt_uuid) - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::Prompt`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::Prompt`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Prompt Viewset -pub async fn stages_prompt_prompts_update( - configuration: &configuration::Configuration, - prompt_uuid: &str, - prompt_request: models::PromptRequest, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_prompt_uuid = prompt_uuid; - let p_body_prompt_request = prompt_request; - - let uri_str = format!( - "{}/stages/prompt/prompts/{prompt_uuid}/", - configuration.base_path, - prompt_uuid = crate::apis::urlencode(p_path_prompt_uuid) - ); - let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - req_builder = req_builder.json(&p_body_prompt_request); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::Prompt`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::Prompt`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Get a list of all objects that use this object -pub async fn stages_prompt_prompts_used_by_list( - configuration: &configuration::Configuration, - prompt_uuid: &str, -) -> Result, Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_prompt_uuid = prompt_uuid; - - let uri_str = format!( - "{}/stages/prompt/prompts/{prompt_uuid}/used_by/", - configuration.base_path, - prompt_uuid = crate::apis::urlencode(p_path_prompt_uuid) - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `Vec<models::UsedBy>`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `Vec<models::UsedBy>`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// PromptStage Viewset -pub async fn stages_prompt_stages_create( - configuration: &configuration::Configuration, - prompt_stage_request: models::PromptStageRequest, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_body_prompt_stage_request = prompt_stage_request; - - let uri_str = format!("{}/stages/prompt/stages/", configuration.base_path); - let mut req_builder = configuration - .client - .request(reqwest::Method::POST, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - req_builder = req_builder.json(&p_body_prompt_stage_request); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::PromptStage`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::PromptStage`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// PromptStage Viewset -pub async fn stages_prompt_stages_destroy( - configuration: &configuration::Configuration, - stage_uuid: &str, -) -> Result<(), Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_stage_uuid = stage_uuid; - - let uri_str = format!( - "{}/stages/prompt/stages/{stage_uuid}/", - configuration.base_path, - stage_uuid = crate::apis::urlencode(p_path_stage_uuid) - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::DELETE, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - - if !status.is_client_error() && !status.is_server_error() { - Ok(()) - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// PromptStage Viewset -pub async fn stages_prompt_stages_list( - configuration: &configuration::Configuration, - fields: Option>, - name: Option<&str>, - ordering: Option<&str>, - page: Option, - page_size: Option, - search: Option<&str>, - stage_uuid: Option<&str>, - validation_policies: Option>, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_query_fields = fields; - let p_query_name = name; - let p_query_ordering = ordering; - let p_query_page = page; - let p_query_page_size = page_size; - let p_query_search = search; - let p_query_stage_uuid = stage_uuid; - let p_query_validation_policies = validation_policies; - - let uri_str = format!("{}/stages/prompt/stages/", configuration.base_path); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref param_value) = p_query_fields { - req_builder = match "multi" { - "multi" => req_builder.query( - ¶m_value - .into_iter() - .map(|p| ("fields".to_owned(), p.to_string())) - .collect::>(), - ), - _ => req_builder.query(&[( - "fields", - ¶m_value - .into_iter() - .map(|p| p.to_string()) - .collect::>() - .join(",") - .to_string(), - )]), - }; - } - if let Some(ref param_value) = p_query_name { - req_builder = req_builder.query(&[("name", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_ordering { - req_builder = req_builder.query(&[("ordering", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_page { - req_builder = req_builder.query(&[("page", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_page_size { - req_builder = req_builder.query(&[("page_size", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_search { - req_builder = req_builder.query(&[("search", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_stage_uuid { - req_builder = req_builder.query(&[("stage_uuid", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_validation_policies { - req_builder = match "multi" { - "multi" => req_builder.query( - ¶m_value - .into_iter() - .map(|p| ("validation_policies".to_owned(), p.to_string())) - .collect::>(), - ), - _ => req_builder.query(&[( - "validation_policies", - ¶m_value - .into_iter() - .map(|p| p.to_string()) - .collect::>() - .join(",") - .to_string(), - )]), - }; - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::PaginatedPromptStageList`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::PaginatedPromptStageList`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// PromptStage Viewset -pub async fn stages_prompt_stages_partial_update( - configuration: &configuration::Configuration, - stage_uuid: &str, - patched_prompt_stage_request: Option, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_stage_uuid = stage_uuid; - let p_body_patched_prompt_stage_request = patched_prompt_stage_request; - - let uri_str = format!( - "{}/stages/prompt/stages/{stage_uuid}/", - configuration.base_path, - stage_uuid = crate::apis::urlencode(p_path_stage_uuid) - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::PATCH, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - req_builder = req_builder.json(&p_body_patched_prompt_stage_request); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::PromptStage`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::PromptStage`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// PromptStage Viewset -pub async fn stages_prompt_stages_retrieve( - configuration: &configuration::Configuration, - stage_uuid: &str, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_stage_uuid = stage_uuid; - - let uri_str = format!( - "{}/stages/prompt/stages/{stage_uuid}/", - configuration.base_path, - stage_uuid = crate::apis::urlencode(p_path_stage_uuid) - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::PromptStage`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::PromptStage`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// PromptStage Viewset -pub async fn stages_prompt_stages_update( - configuration: &configuration::Configuration, - stage_uuid: &str, - prompt_stage_request: models::PromptStageRequest, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_stage_uuid = stage_uuid; - let p_body_prompt_stage_request = prompt_stage_request; - - let uri_str = format!( - "{}/stages/prompt/stages/{stage_uuid}/", - configuration.base_path, - stage_uuid = crate::apis::urlencode(p_path_stage_uuid) - ); - let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - req_builder = req_builder.json(&p_body_prompt_stage_request); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::PromptStage`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::PromptStage`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Get a list of all objects that use this object -pub async fn stages_prompt_stages_used_by_list( - configuration: &configuration::Configuration, - stage_uuid: &str, -) -> Result, Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_stage_uuid = stage_uuid; - - let uri_str = format!( - "{}/stages/prompt/stages/{stage_uuid}/used_by/", - configuration.base_path, - stage_uuid = crate::apis::urlencode(p_path_stage_uuid) - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `Vec<models::UsedBy>`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `Vec<models::UsedBy>`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// RedirectStage Viewset -pub async fn stages_redirect_create( - configuration: &configuration::Configuration, - redirect_stage_request: models::RedirectStageRequest, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_body_redirect_stage_request = redirect_stage_request; - - let uri_str = format!("{}/stages/redirect/", configuration.base_path); - let mut req_builder = configuration - .client - .request(reqwest::Method::POST, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - req_builder = req_builder.json(&p_body_redirect_stage_request); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::RedirectStage`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::RedirectStage`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// RedirectStage Viewset -pub async fn stages_redirect_destroy( - configuration: &configuration::Configuration, - stage_uuid: &str, -) -> Result<(), Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_stage_uuid = stage_uuid; - - let uri_str = format!( - "{}/stages/redirect/{stage_uuid}/", - configuration.base_path, - stage_uuid = crate::apis::urlencode(p_path_stage_uuid) - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::DELETE, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - - if !status.is_client_error() && !status.is_server_error() { - Ok(()) - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// RedirectStage Viewset -pub async fn stages_redirect_list( - configuration: &configuration::Configuration, - name: Option<&str>, - ordering: Option<&str>, - page: Option, - page_size: Option, - search: Option<&str>, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_query_name = name; - let p_query_ordering = ordering; - let p_query_page = page; - let p_query_page_size = page_size; - let p_query_search = search; - - let uri_str = format!("{}/stages/redirect/", configuration.base_path); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref param_value) = p_query_name { - req_builder = req_builder.query(&[("name", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_ordering { - req_builder = req_builder.query(&[("ordering", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_page { - req_builder = req_builder.query(&[("page", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_page_size { - req_builder = req_builder.query(&[("page_size", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_search { - req_builder = req_builder.query(&[("search", ¶m_value.to_string())]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::PaginatedRedirectStageList`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::PaginatedRedirectStageList`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// RedirectStage Viewset -pub async fn stages_redirect_partial_update( - configuration: &configuration::Configuration, - stage_uuid: &str, - patched_redirect_stage_request: Option, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_stage_uuid = stage_uuid; - let p_body_patched_redirect_stage_request = patched_redirect_stage_request; - - let uri_str = format!( - "{}/stages/redirect/{stage_uuid}/", - configuration.base_path, - stage_uuid = crate::apis::urlencode(p_path_stage_uuid) - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::PATCH, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - req_builder = req_builder.json(&p_body_patched_redirect_stage_request); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::RedirectStage`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::RedirectStage`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// RedirectStage Viewset -pub async fn stages_redirect_retrieve( - configuration: &configuration::Configuration, - stage_uuid: &str, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_stage_uuid = stage_uuid; - - let uri_str = format!( - "{}/stages/redirect/{stage_uuid}/", - configuration.base_path, - stage_uuid = crate::apis::urlencode(p_path_stage_uuid) - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::RedirectStage`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::RedirectStage`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// RedirectStage Viewset -pub async fn stages_redirect_update( - configuration: &configuration::Configuration, - stage_uuid: &str, - redirect_stage_request: models::RedirectStageRequest, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_stage_uuid = stage_uuid; - let p_body_redirect_stage_request = redirect_stage_request; - - let uri_str = format!( - "{}/stages/redirect/{stage_uuid}/", - configuration.base_path, - stage_uuid = crate::apis::urlencode(p_path_stage_uuid) - ); - let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - req_builder = req_builder.json(&p_body_redirect_stage_request); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::RedirectStage`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::RedirectStage`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Get a list of all objects that use this object -pub async fn stages_redirect_used_by_list( - configuration: &configuration::Configuration, - stage_uuid: &str, -) -> Result, Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_stage_uuid = stage_uuid; - - let uri_str = format!( - "{}/stages/redirect/{stage_uuid}/used_by/", - configuration.base_path, - stage_uuid = crate::apis::urlencode(p_path_stage_uuid) - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `Vec<models::UsedBy>`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `Vec<models::UsedBy>`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// SourceStage Viewset -pub async fn stages_source_create( - configuration: &configuration::Configuration, - source_stage_request: models::SourceStageRequest, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_body_source_stage_request = source_stage_request; - - let uri_str = format!("{}/stages/source/", configuration.base_path); - let mut req_builder = configuration - .client - .request(reqwest::Method::POST, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - req_builder = req_builder.json(&p_body_source_stage_request); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::SourceStage`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::SourceStage`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// SourceStage Viewset -pub async fn stages_source_destroy( - configuration: &configuration::Configuration, - stage_uuid: &str, -) -> Result<(), Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_stage_uuid = stage_uuid; - - let uri_str = format!( - "{}/stages/source/{stage_uuid}/", - configuration.base_path, - stage_uuid = crate::apis::urlencode(p_path_stage_uuid) - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::DELETE, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - - if !status.is_client_error() && !status.is_server_error() { - Ok(()) - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// SourceStage Viewset -pub async fn stages_source_list( - configuration: &configuration::Configuration, - name: Option<&str>, - ordering: Option<&str>, - page: Option, - page_size: Option, - resume_timeout: Option<&str>, - search: Option<&str>, - source: Option<&str>, - stage_uuid: Option<&str>, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_query_name = name; - let p_query_ordering = ordering; - let p_query_page = page; - let p_query_page_size = page_size; - let p_query_resume_timeout = resume_timeout; - let p_query_search = search; - let p_query_source = source; - let p_query_stage_uuid = stage_uuid; - - let uri_str = format!("{}/stages/source/", configuration.base_path); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref param_value) = p_query_name { - req_builder = req_builder.query(&[("name", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_ordering { - req_builder = req_builder.query(&[("ordering", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_page { - req_builder = req_builder.query(&[("page", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_page_size { - req_builder = req_builder.query(&[("page_size", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_resume_timeout { - req_builder = req_builder.query(&[("resume_timeout", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_search { - req_builder = req_builder.query(&[("search", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_source { - req_builder = req_builder.query(&[("source", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_stage_uuid { - req_builder = req_builder.query(&[("stage_uuid", ¶m_value.to_string())]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::PaginatedSourceStageList`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::PaginatedSourceStageList`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// SourceStage Viewset -pub async fn stages_source_partial_update( - configuration: &configuration::Configuration, - stage_uuid: &str, - patched_source_stage_request: Option, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_stage_uuid = stage_uuid; - let p_body_patched_source_stage_request = patched_source_stage_request; - - let uri_str = format!( - "{}/stages/source/{stage_uuid}/", - configuration.base_path, - stage_uuid = crate::apis::urlencode(p_path_stage_uuid) - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::PATCH, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - req_builder = req_builder.json(&p_body_patched_source_stage_request); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::SourceStage`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::SourceStage`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// SourceStage Viewset -pub async fn stages_source_retrieve( - configuration: &configuration::Configuration, - stage_uuid: &str, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_stage_uuid = stage_uuid; - - let uri_str = format!( - "{}/stages/source/{stage_uuid}/", - configuration.base_path, - stage_uuid = crate::apis::urlencode(p_path_stage_uuid) - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::SourceStage`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::SourceStage`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// SourceStage Viewset -pub async fn stages_source_update( - configuration: &configuration::Configuration, - stage_uuid: &str, - source_stage_request: models::SourceStageRequest, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_stage_uuid = stage_uuid; - let p_body_source_stage_request = source_stage_request; - - let uri_str = format!( - "{}/stages/source/{stage_uuid}/", - configuration.base_path, - stage_uuid = crate::apis::urlencode(p_path_stage_uuid) - ); - let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - req_builder = req_builder.json(&p_body_source_stage_request); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::SourceStage`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::SourceStage`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Get a list of all objects that use this object -pub async fn stages_source_used_by_list( - configuration: &configuration::Configuration, - stage_uuid: &str, -) -> Result, Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_stage_uuid = stage_uuid; - - let uri_str = format!( - "{}/stages/source/{stage_uuid}/used_by/", - configuration.base_path, - stage_uuid = crate::apis::urlencode(p_path_stage_uuid) - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `Vec<models::UsedBy>`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `Vec<models::UsedBy>`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// UserDeleteStage Viewset -pub async fn stages_user_delete_create( - configuration: &configuration::Configuration, - user_delete_stage_request: models::UserDeleteStageRequest, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_body_user_delete_stage_request = user_delete_stage_request; - - let uri_str = format!("{}/stages/user_delete/", configuration.base_path); - let mut req_builder = configuration - .client - .request(reqwest::Method::POST, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - req_builder = req_builder.json(&p_body_user_delete_stage_request); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::UserDeleteStage`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::UserDeleteStage`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// UserDeleteStage Viewset -pub async fn stages_user_delete_destroy( - configuration: &configuration::Configuration, - stage_uuid: &str, -) -> Result<(), Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_stage_uuid = stage_uuid; - - let uri_str = format!( - "{}/stages/user_delete/{stage_uuid}/", - configuration.base_path, - stage_uuid = crate::apis::urlencode(p_path_stage_uuid) - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::DELETE, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - - if !status.is_client_error() && !status.is_server_error() { - Ok(()) - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// UserDeleteStage Viewset -pub async fn stages_user_delete_list( - configuration: &configuration::Configuration, - name: Option<&str>, - ordering: Option<&str>, - page: Option, - page_size: Option, - search: Option<&str>, - stage_uuid: Option<&str>, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_query_name = name; - let p_query_ordering = ordering; - let p_query_page = page; - let p_query_page_size = page_size; - let p_query_search = search; - let p_query_stage_uuid = stage_uuid; - - let uri_str = format!("{}/stages/user_delete/", configuration.base_path); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref param_value) = p_query_name { - req_builder = req_builder.query(&[("name", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_ordering { - req_builder = req_builder.query(&[("ordering", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_page { - req_builder = req_builder.query(&[("page", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_page_size { - req_builder = req_builder.query(&[("page_size", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_search { - req_builder = req_builder.query(&[("search", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_stage_uuid { - req_builder = req_builder.query(&[("stage_uuid", ¶m_value.to_string())]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::PaginatedUserDeleteStageList`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::PaginatedUserDeleteStageList`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// UserDeleteStage Viewset -pub async fn stages_user_delete_partial_update( - configuration: &configuration::Configuration, - stage_uuid: &str, - patched_user_delete_stage_request: Option, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_stage_uuid = stage_uuid; - let p_body_patched_user_delete_stage_request = patched_user_delete_stage_request; - - let uri_str = format!( - "{}/stages/user_delete/{stage_uuid}/", - configuration.base_path, - stage_uuid = crate::apis::urlencode(p_path_stage_uuid) - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::PATCH, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - req_builder = req_builder.json(&p_body_patched_user_delete_stage_request); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::UserDeleteStage`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::UserDeleteStage`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// UserDeleteStage Viewset -pub async fn stages_user_delete_retrieve( - configuration: &configuration::Configuration, - stage_uuid: &str, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_stage_uuid = stage_uuid; - - let uri_str = format!( - "{}/stages/user_delete/{stage_uuid}/", - configuration.base_path, - stage_uuid = crate::apis::urlencode(p_path_stage_uuid) - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::UserDeleteStage`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::UserDeleteStage`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// UserDeleteStage Viewset -pub async fn stages_user_delete_update( - configuration: &configuration::Configuration, - stage_uuid: &str, - user_delete_stage_request: models::UserDeleteStageRequest, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_stage_uuid = stage_uuid; - let p_body_user_delete_stage_request = user_delete_stage_request; - - let uri_str = format!( - "{}/stages/user_delete/{stage_uuid}/", - configuration.base_path, - stage_uuid = crate::apis::urlencode(p_path_stage_uuid) - ); - let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - req_builder = req_builder.json(&p_body_user_delete_stage_request); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::UserDeleteStage`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::UserDeleteStage`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Get a list of all objects that use this object -pub async fn stages_user_delete_used_by_list( - configuration: &configuration::Configuration, - stage_uuid: &str, -) -> Result, Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_stage_uuid = stage_uuid; - - let uri_str = format!( - "{}/stages/user_delete/{stage_uuid}/used_by/", - configuration.base_path, - stage_uuid = crate::apis::urlencode(p_path_stage_uuid) - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `Vec<models::UsedBy>`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `Vec<models::UsedBy>`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// UserLoginStage Viewset -pub async fn stages_user_login_create( - configuration: &configuration::Configuration, - user_login_stage_request: models::UserLoginStageRequest, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_body_user_login_stage_request = user_login_stage_request; - - let uri_str = format!("{}/stages/user_login/", configuration.base_path); - let mut req_builder = configuration - .client - .request(reqwest::Method::POST, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - req_builder = req_builder.json(&p_body_user_login_stage_request); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::UserLoginStage`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::UserLoginStage`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// UserLoginStage Viewset -pub async fn stages_user_login_destroy( - configuration: &configuration::Configuration, - stage_uuid: &str, -) -> Result<(), Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_stage_uuid = stage_uuid; - - let uri_str = format!( - "{}/stages/user_login/{stage_uuid}/", - configuration.base_path, - stage_uuid = crate::apis::urlencode(p_path_stage_uuid) - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::DELETE, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - - if !status.is_client_error() && !status.is_server_error() { - Ok(()) - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// UserLoginStage Viewset -pub async fn stages_user_login_list( - configuration: &configuration::Configuration, - geoip_binding: Option, - name: Option<&str>, - network_binding: Option, - ordering: Option<&str>, - page: Option, - page_size: Option, - remember_device: Option<&str>, - remember_me_offset: Option<&str>, - search: Option<&str>, - session_duration: Option<&str>, - stage_uuid: Option<&str>, - terminate_other_sessions: Option, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_query_geoip_binding = geoip_binding; - let p_query_name = name; - let p_query_network_binding = network_binding; - let p_query_ordering = ordering; - let p_query_page = page; - let p_query_page_size = page_size; - let p_query_remember_device = remember_device; - let p_query_remember_me_offset = remember_me_offset; - let p_query_search = search; - let p_query_session_duration = session_duration; - let p_query_stage_uuid = stage_uuid; - let p_query_terminate_other_sessions = terminate_other_sessions; - - let uri_str = format!("{}/stages/user_login/", configuration.base_path); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref param_value) = p_query_geoip_binding { - req_builder = req_builder.query(&[("geoip_binding", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_name { - req_builder = req_builder.query(&[("name", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_network_binding { - req_builder = req_builder.query(&[("network_binding", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_ordering { - req_builder = req_builder.query(&[("ordering", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_page { - req_builder = req_builder.query(&[("page", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_page_size { - req_builder = req_builder.query(&[("page_size", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_remember_device { - req_builder = req_builder.query(&[("remember_device", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_remember_me_offset { - req_builder = req_builder.query(&[("remember_me_offset", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_search { - req_builder = req_builder.query(&[("search", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_session_duration { - req_builder = req_builder.query(&[("session_duration", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_stage_uuid { - req_builder = req_builder.query(&[("stage_uuid", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_terminate_other_sessions { - req_builder = req_builder.query(&[("terminate_other_sessions", ¶m_value.to_string())]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::PaginatedUserLoginStageList`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::PaginatedUserLoginStageList`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// UserLoginStage Viewset -pub async fn stages_user_login_partial_update( - configuration: &configuration::Configuration, - stage_uuid: &str, - patched_user_login_stage_request: Option, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_stage_uuid = stage_uuid; - let p_body_patched_user_login_stage_request = patched_user_login_stage_request; - - let uri_str = format!( - "{}/stages/user_login/{stage_uuid}/", - configuration.base_path, - stage_uuid = crate::apis::urlencode(p_path_stage_uuid) - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::PATCH, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - req_builder = req_builder.json(&p_body_patched_user_login_stage_request); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::UserLoginStage`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::UserLoginStage`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// UserLoginStage Viewset -pub async fn stages_user_login_retrieve( - configuration: &configuration::Configuration, - stage_uuid: &str, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_stage_uuid = stage_uuid; - - let uri_str = format!( - "{}/stages/user_login/{stage_uuid}/", - configuration.base_path, - stage_uuid = crate::apis::urlencode(p_path_stage_uuid) - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::UserLoginStage`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::UserLoginStage`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// UserLoginStage Viewset -pub async fn stages_user_login_update( - configuration: &configuration::Configuration, - stage_uuid: &str, - user_login_stage_request: models::UserLoginStageRequest, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_stage_uuid = stage_uuid; - let p_body_user_login_stage_request = user_login_stage_request; - - let uri_str = format!( - "{}/stages/user_login/{stage_uuid}/", - configuration.base_path, - stage_uuid = crate::apis::urlencode(p_path_stage_uuid) - ); - let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - req_builder = req_builder.json(&p_body_user_login_stage_request); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::UserLoginStage`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::UserLoginStage`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Get a list of all objects that use this object -pub async fn stages_user_login_used_by_list( - configuration: &configuration::Configuration, - stage_uuid: &str, -) -> Result, Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_stage_uuid = stage_uuid; - - let uri_str = format!( - "{}/stages/user_login/{stage_uuid}/used_by/", - configuration.base_path, - stage_uuid = crate::apis::urlencode(p_path_stage_uuid) - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `Vec<models::UsedBy>`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `Vec<models::UsedBy>`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// UserLogoutStage Viewset -pub async fn stages_user_logout_create( - configuration: &configuration::Configuration, - user_logout_stage_request: models::UserLogoutStageRequest, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_body_user_logout_stage_request = user_logout_stage_request; - - let uri_str = format!("{}/stages/user_logout/", configuration.base_path); - let mut req_builder = configuration - .client - .request(reqwest::Method::POST, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - req_builder = req_builder.json(&p_body_user_logout_stage_request); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::UserLogoutStage`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::UserLogoutStage`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// UserLogoutStage Viewset -pub async fn stages_user_logout_destroy( - configuration: &configuration::Configuration, - stage_uuid: &str, -) -> Result<(), Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_stage_uuid = stage_uuid; - - let uri_str = format!( - "{}/stages/user_logout/{stage_uuid}/", - configuration.base_path, - stage_uuid = crate::apis::urlencode(p_path_stage_uuid) - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::DELETE, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - - if !status.is_client_error() && !status.is_server_error() { - Ok(()) - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// UserLogoutStage Viewset -pub async fn stages_user_logout_list( - configuration: &configuration::Configuration, - name: Option<&str>, - ordering: Option<&str>, - page: Option, - page_size: Option, - search: Option<&str>, - stage_uuid: Option<&str>, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_query_name = name; - let p_query_ordering = ordering; - let p_query_page = page; - let p_query_page_size = page_size; - let p_query_search = search; - let p_query_stage_uuid = stage_uuid; - - let uri_str = format!("{}/stages/user_logout/", configuration.base_path); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref param_value) = p_query_name { - req_builder = req_builder.query(&[("name", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_ordering { - req_builder = req_builder.query(&[("ordering", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_page { - req_builder = req_builder.query(&[("page", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_page_size { - req_builder = req_builder.query(&[("page_size", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_search { - req_builder = req_builder.query(&[("search", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_stage_uuid { - req_builder = req_builder.query(&[("stage_uuid", ¶m_value.to_string())]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::PaginatedUserLogoutStageList`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::PaginatedUserLogoutStageList`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// UserLogoutStage Viewset -pub async fn stages_user_logout_partial_update( - configuration: &configuration::Configuration, - stage_uuid: &str, - patched_user_logout_stage_request: Option, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_stage_uuid = stage_uuid; - let p_body_patched_user_logout_stage_request = patched_user_logout_stage_request; - - let uri_str = format!( - "{}/stages/user_logout/{stage_uuid}/", - configuration.base_path, - stage_uuid = crate::apis::urlencode(p_path_stage_uuid) - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::PATCH, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - req_builder = req_builder.json(&p_body_patched_user_logout_stage_request); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::UserLogoutStage`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::UserLogoutStage`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// UserLogoutStage Viewset -pub async fn stages_user_logout_retrieve( - configuration: &configuration::Configuration, - stage_uuid: &str, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_stage_uuid = stage_uuid; - - let uri_str = format!( - "{}/stages/user_logout/{stage_uuid}/", - configuration.base_path, - stage_uuid = crate::apis::urlencode(p_path_stage_uuid) - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::UserLogoutStage`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::UserLogoutStage`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// UserLogoutStage Viewset -pub async fn stages_user_logout_update( - configuration: &configuration::Configuration, - stage_uuid: &str, - user_logout_stage_request: models::UserLogoutStageRequest, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_stage_uuid = stage_uuid; - let p_body_user_logout_stage_request = user_logout_stage_request; - - let uri_str = format!( - "{}/stages/user_logout/{stage_uuid}/", - configuration.base_path, - stage_uuid = crate::apis::urlencode(p_path_stage_uuid) - ); - let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - req_builder = req_builder.json(&p_body_user_logout_stage_request); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::UserLogoutStage`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::UserLogoutStage`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Get a list of all objects that use this object -pub async fn stages_user_logout_used_by_list( - configuration: &configuration::Configuration, - stage_uuid: &str, -) -> Result, Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_stage_uuid = stage_uuid; - - let uri_str = format!( - "{}/stages/user_logout/{stage_uuid}/used_by/", - configuration.base_path, - stage_uuid = crate::apis::urlencode(p_path_stage_uuid) - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `Vec<models::UsedBy>`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `Vec<models::UsedBy>`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// UserWriteStage Viewset -pub async fn stages_user_write_create( - configuration: &configuration::Configuration, - user_write_stage_request: models::UserWriteStageRequest, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_body_user_write_stage_request = user_write_stage_request; - - let uri_str = format!("{}/stages/user_write/", configuration.base_path); - let mut req_builder = configuration - .client - .request(reqwest::Method::POST, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - req_builder = req_builder.json(&p_body_user_write_stage_request); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::UserWriteStage`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::UserWriteStage`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// UserWriteStage Viewset -pub async fn stages_user_write_destroy( - configuration: &configuration::Configuration, - stage_uuid: &str, -) -> Result<(), Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_stage_uuid = stage_uuid; - - let uri_str = format!( - "{}/stages/user_write/{stage_uuid}/", - configuration.base_path, - stage_uuid = crate::apis::urlencode(p_path_stage_uuid) - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::DELETE, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - - if !status.is_client_error() && !status.is_server_error() { - Ok(()) - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// UserWriteStage Viewset -pub async fn stages_user_write_list( - configuration: &configuration::Configuration, - create_users_as_inactive: Option, - create_users_group: Option<&str>, - name: Option<&str>, - ordering: Option<&str>, - page: Option, - page_size: Option, - search: Option<&str>, - stage_uuid: Option<&str>, - user_creation_mode: Option, - user_path_template: Option<&str>, - user_type: Option, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_query_create_users_as_inactive = create_users_as_inactive; - let p_query_create_users_group = create_users_group; - let p_query_name = name; - let p_query_ordering = ordering; - let p_query_page = page; - let p_query_page_size = page_size; - let p_query_search = search; - let p_query_stage_uuid = stage_uuid; - let p_query_user_creation_mode = user_creation_mode; - let p_query_user_path_template = user_path_template; - let p_query_user_type = user_type; - - let uri_str = format!("{}/stages/user_write/", configuration.base_path); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref param_value) = p_query_create_users_as_inactive { - req_builder = req_builder.query(&[("create_users_as_inactive", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_create_users_group { - req_builder = req_builder.query(&[("create_users_group", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_name { - req_builder = req_builder.query(&[("name", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_ordering { - req_builder = req_builder.query(&[("ordering", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_page { - req_builder = req_builder.query(&[("page", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_page_size { - req_builder = req_builder.query(&[("page_size", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_search { - req_builder = req_builder.query(&[("search", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_stage_uuid { - req_builder = req_builder.query(&[("stage_uuid", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_user_creation_mode { - req_builder = req_builder.query(&[("user_creation_mode", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_user_path_template { - req_builder = req_builder.query(&[("user_path_template", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_user_type { - req_builder = req_builder.query(&[("user_type", ¶m_value.to_string())]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::PaginatedUserWriteStageList`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::PaginatedUserWriteStageList`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// UserWriteStage Viewset -pub async fn stages_user_write_partial_update( - configuration: &configuration::Configuration, - stage_uuid: &str, - patched_user_write_stage_request: Option, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_stage_uuid = stage_uuid; - let p_body_patched_user_write_stage_request = patched_user_write_stage_request; - - let uri_str = format!( - "{}/stages/user_write/{stage_uuid}/", - configuration.base_path, - stage_uuid = crate::apis::urlencode(p_path_stage_uuid) - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::PATCH, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - req_builder = req_builder.json(&p_body_patched_user_write_stage_request); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::UserWriteStage`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::UserWriteStage`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// UserWriteStage Viewset -pub async fn stages_user_write_retrieve( - configuration: &configuration::Configuration, - stage_uuid: &str, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_stage_uuid = stage_uuid; - - let uri_str = format!( - "{}/stages/user_write/{stage_uuid}/", - configuration.base_path, - stage_uuid = crate::apis::urlencode(p_path_stage_uuid) - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::UserWriteStage`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::UserWriteStage`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// UserWriteStage Viewset -pub async fn stages_user_write_update( - configuration: &configuration::Configuration, - stage_uuid: &str, - user_write_stage_request: models::UserWriteStageRequest, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_stage_uuid = stage_uuid; - let p_body_user_write_stage_request = user_write_stage_request; - - let uri_str = format!( - "{}/stages/user_write/{stage_uuid}/", - configuration.base_path, - stage_uuid = crate::apis::urlencode(p_path_stage_uuid) - ); - let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - req_builder = req_builder.json(&p_body_user_write_stage_request); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::UserWriteStage`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::UserWriteStage`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Get a list of all objects that use this object -pub async fn stages_user_write_used_by_list( - configuration: &configuration::Configuration, - stage_uuid: &str, -) -> Result, Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_stage_uuid = stage_uuid; - - let uri_str = format!( - "{}/stages/user_write/{stage_uuid}/used_by/", - configuration.base_path, - stage_uuid = crate::apis::urlencode(p_path_stage_uuid) - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `Vec<models::UsedBy>`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `Vec<models::UsedBy>`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} diff --git a/packages/client-rust/src/apis/tasks_api.rs b/packages/client-rust/src/apis/tasks_api.rs deleted file mode 100644 index c561a750b0..0000000000 --- a/packages/client-rust/src/apis/tasks_api.rs +++ /dev/null @@ -1,782 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use reqwest; -use serde::{Deserialize, Serialize, de::Error as _}; - -use super::{ContentType, Error, configuration}; -use crate::{apis::ResponseContent, models}; - -/// struct for typed errors of method [`tasks_schedules_list`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum TasksSchedulesListError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`tasks_schedules_partial_update`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum TasksSchedulesPartialUpdateError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`tasks_schedules_retrieve`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum TasksSchedulesRetrieveError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`tasks_schedules_send_create`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum TasksSchedulesSendCreateError { - Status404(), - Status500(), - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`tasks_schedules_update`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum TasksSchedulesUpdateError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`tasks_tasks_list`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum TasksTasksListError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`tasks_tasks_retrieve`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum TasksTasksRetrieveError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`tasks_tasks_retry_create`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum TasksTasksRetryCreateError { - Status400(), - Status404(), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`tasks_tasks_status_retrieve`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum TasksTasksStatusRetrieveError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`tasks_workers_list`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum TasksWorkersListError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -pub async fn tasks_schedules_list( - configuration: &configuration::Configuration, - actor_name: Option<&str>, - ordering: Option<&str>, - page: Option, - page_size: Option, - paused: Option, - rel_obj_content_type__app_label: Option<&str>, - rel_obj_content_type__model: Option<&str>, - rel_obj_id: Option<&str>, - rel_obj_id__isnull: Option, - search: Option<&str>, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_query_actor_name = actor_name; - let p_query_ordering = ordering; - let p_query_page = page; - let p_query_page_size = page_size; - let p_query_paused = paused; - let p_query_rel_obj_content_type__app_label = rel_obj_content_type__app_label; - let p_query_rel_obj_content_type__model = rel_obj_content_type__model; - let p_query_rel_obj_id = rel_obj_id; - let p_query_rel_obj_id__isnull = rel_obj_id__isnull; - let p_query_search = search; - - let uri_str = format!("{}/tasks/schedules/", configuration.base_path); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref param_value) = p_query_actor_name { - req_builder = req_builder.query(&[("actor_name", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_ordering { - req_builder = req_builder.query(&[("ordering", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_page { - req_builder = req_builder.query(&[("page", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_page_size { - req_builder = req_builder.query(&[("page_size", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_paused { - req_builder = req_builder.query(&[("paused", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_rel_obj_content_type__app_label { - req_builder = - req_builder.query(&[("rel_obj_content_type__app_label", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_rel_obj_content_type__model { - req_builder = - req_builder.query(&[("rel_obj_content_type__model", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_rel_obj_id { - req_builder = req_builder.query(&[("rel_obj_id", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_rel_obj_id__isnull { - req_builder = req_builder.query(&[("rel_obj_id__isnull", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_search { - req_builder = req_builder.query(&[("search", ¶m_value.to_string())]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::PaginatedScheduleList`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::PaginatedScheduleList`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -pub async fn tasks_schedules_partial_update( - configuration: &configuration::Configuration, - id: &str, - patched_schedule_request: Option, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_id = id; - let p_body_patched_schedule_request = patched_schedule_request; - - let uri_str = format!( - "{}/tasks/schedules/{id}/", - configuration.base_path, - id = crate::apis::urlencode(p_path_id) - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::PATCH, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - req_builder = req_builder.json(&p_body_patched_schedule_request); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::Schedule`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::Schedule`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -pub async fn tasks_schedules_retrieve( - configuration: &configuration::Configuration, - id: &str, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_id = id; - - let uri_str = format!( - "{}/tasks/schedules/{id}/", - configuration.base_path, - id = crate::apis::urlencode(p_path_id) - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::Schedule`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::Schedule`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Trigger this schedule now -pub async fn tasks_schedules_send_create( - configuration: &configuration::Configuration, - id: &str, -) -> Result<(), Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_id = id; - - let uri_str = format!( - "{}/tasks/schedules/{id}/send/", - configuration.base_path, - id = crate::apis::urlencode(p_path_id) - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::POST, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - - if !status.is_client_error() && !status.is_server_error() { - Ok(()) - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -pub async fn tasks_schedules_update( - configuration: &configuration::Configuration, - id: &str, - schedule_request: models::ScheduleRequest, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_id = id; - let p_body_schedule_request = schedule_request; - - let uri_str = format!( - "{}/tasks/schedules/{id}/", - configuration.base_path, - id = crate::apis::urlencode(p_path_id) - ); - let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - req_builder = req_builder.json(&p_body_schedule_request); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::Schedule`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::Schedule`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -pub async fn tasks_tasks_list( - configuration: &configuration::Configuration, - actor_name: Option<&str>, - aggregated_status: Option>, - ordering: Option<&str>, - page: Option, - page_size: Option, - queue_name: Option<&str>, - rel_obj_content_type__app_label: Option<&str>, - rel_obj_content_type__model: Option<&str>, - rel_obj_id: Option<&str>, - rel_obj_id__isnull: Option, - search: Option<&str>, - state: Option, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_query_actor_name = actor_name; - let p_query_aggregated_status = aggregated_status; - let p_query_ordering = ordering; - let p_query_page = page; - let p_query_page_size = page_size; - let p_query_queue_name = queue_name; - let p_query_rel_obj_content_type__app_label = rel_obj_content_type__app_label; - let p_query_rel_obj_content_type__model = rel_obj_content_type__model; - let p_query_rel_obj_id = rel_obj_id; - let p_query_rel_obj_id__isnull = rel_obj_id__isnull; - let p_query_search = search; - let p_query_state = state; - - let uri_str = format!("{}/tasks/tasks/", configuration.base_path); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref param_value) = p_query_actor_name { - req_builder = req_builder.query(&[("actor_name", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_aggregated_status { - req_builder = match "multi" { - "multi" => req_builder.query( - ¶m_value - .into_iter() - .map(|p| ("aggregated_status".to_owned(), p.to_string())) - .collect::>(), - ), - _ => req_builder.query(&[( - "aggregated_status", - ¶m_value - .into_iter() - .map(|p| p.to_string()) - .collect::>() - .join(",") - .to_string(), - )]), - }; - } - if let Some(ref param_value) = p_query_ordering { - req_builder = req_builder.query(&[("ordering", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_page { - req_builder = req_builder.query(&[("page", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_page_size { - req_builder = req_builder.query(&[("page_size", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_queue_name { - req_builder = req_builder.query(&[("queue_name", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_rel_obj_content_type__app_label { - req_builder = - req_builder.query(&[("rel_obj_content_type__app_label", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_rel_obj_content_type__model { - req_builder = - req_builder.query(&[("rel_obj_content_type__model", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_rel_obj_id { - req_builder = req_builder.query(&[("rel_obj_id", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_rel_obj_id__isnull { - req_builder = req_builder.query(&[("rel_obj_id__isnull", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_search { - req_builder = req_builder.query(&[("search", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_state { - req_builder = req_builder.query(&[("state", ¶m_value.to_string())]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::PaginatedTaskList`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::PaginatedTaskList`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -pub async fn tasks_tasks_retrieve( - configuration: &configuration::Configuration, - message_id: &str, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_message_id = message_id; - - let uri_str = format!( - "{}/tasks/tasks/{message_id}/", - configuration.base_path, - message_id = crate::apis::urlencode(p_path_message_id) - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::Task`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::Task`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Retry task -pub async fn tasks_tasks_retry_create( - configuration: &configuration::Configuration, - message_id: &str, -) -> Result<(), Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_message_id = message_id; - - let uri_str = format!( - "{}/tasks/tasks/{message_id}/retry/", - configuration.base_path, - message_id = crate::apis::urlencode(p_path_message_id) - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::POST, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - - if !status.is_client_error() && !status.is_server_error() { - Ok(()) - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Global status summary for all tasks -pub async fn tasks_tasks_status_retrieve( - configuration: &configuration::Configuration, -) -> Result> { - let uri_str = format!("{}/tasks/tasks/status/", configuration.base_path); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::GlobalTaskStatus`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::GlobalTaskStatus`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Get currently connected worker count. -pub async fn tasks_workers_list( - configuration: &configuration::Configuration, -) -> Result, Error> { - let uri_str = format!("{}/tasks/workers/", configuration.base_path); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `Vec<models::Worker>`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `Vec<models::Worker>`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} diff --git a/packages/client-rust/src/apis/tenants_api.rs b/packages/client-rust/src/apis/tenants_api.rs deleted file mode 100644 index 5344c33ac7..0000000000 --- a/packages/client-rust/src/apis/tenants_api.rs +++ /dev/null @@ -1,948 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use reqwest; -use serde::{Deserialize, Serialize, de::Error as _}; - -use super::{ContentType, Error, configuration}; -use crate::{apis::ResponseContent, models}; - -/// struct for typed errors of method [`tenants_domains_create`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum TenantsDomainsCreateError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`tenants_domains_destroy`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum TenantsDomainsDestroyError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`tenants_domains_list`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum TenantsDomainsListError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`tenants_domains_partial_update`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum TenantsDomainsPartialUpdateError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`tenants_domains_retrieve`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum TenantsDomainsRetrieveError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`tenants_domains_update`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum TenantsDomainsUpdateError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`tenants_tenants_create`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum TenantsTenantsCreateError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`tenants_tenants_create_admin_group_create`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum TenantsTenantsCreateAdminGroupCreateError { - Status400(), - Status404(), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`tenants_tenants_create_recovery_key_create`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum TenantsTenantsCreateRecoveryKeyCreateError { - Status400(), - Status404(), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`tenants_tenants_destroy`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum TenantsTenantsDestroyError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`tenants_tenants_list`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum TenantsTenantsListError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`tenants_tenants_partial_update`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum TenantsTenantsPartialUpdateError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`tenants_tenants_retrieve`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum TenantsTenantsRetrieveError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`tenants_tenants_update`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum TenantsTenantsUpdateError { - Status400(models::ValidationError), - Status403(models::GenericError), - UnknownValue(serde_json::Value), -} - -/// Domain ViewSet -pub async fn tenants_domains_create( - configuration: &configuration::Configuration, - domain_request: models::DomainRequest, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_body_domain_request = domain_request; - - let uri_str = format!("{}/tenants/domains/", configuration.base_path); - let mut req_builder = configuration - .client - .request(reqwest::Method::POST, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - req_builder = req_builder.json(&p_body_domain_request); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::Domain`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::Domain`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Domain ViewSet -pub async fn tenants_domains_destroy( - configuration: &configuration::Configuration, - id: i32, -) -> Result<(), Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_id = id; - - let uri_str = format!( - "{}/tenants/domains/{id}/", - configuration.base_path, - id = p_path_id - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::DELETE, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - - if !status.is_client_error() && !status.is_server_error() { - Ok(()) - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Domain ViewSet -pub async fn tenants_domains_list( - configuration: &configuration::Configuration, - ordering: Option<&str>, - page: Option, - page_size: Option, - search: Option<&str>, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_query_ordering = ordering; - let p_query_page = page; - let p_query_page_size = page_size; - let p_query_search = search; - - let uri_str = format!("{}/tenants/domains/", configuration.base_path); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref param_value) = p_query_ordering { - req_builder = req_builder.query(&[("ordering", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_page { - req_builder = req_builder.query(&[("page", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_page_size { - req_builder = req_builder.query(&[("page_size", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_search { - req_builder = req_builder.query(&[("search", ¶m_value.to_string())]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::PaginatedDomainList`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::PaginatedDomainList`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Domain ViewSet -pub async fn tenants_domains_partial_update( - configuration: &configuration::Configuration, - id: i32, - patched_domain_request: Option, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_id = id; - let p_body_patched_domain_request = patched_domain_request; - - let uri_str = format!( - "{}/tenants/domains/{id}/", - configuration.base_path, - id = p_path_id - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::PATCH, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - req_builder = req_builder.json(&p_body_patched_domain_request); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::Domain`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::Domain`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Domain ViewSet -pub async fn tenants_domains_retrieve( - configuration: &configuration::Configuration, - id: i32, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_id = id; - - let uri_str = format!( - "{}/tenants/domains/{id}/", - configuration.base_path, - id = p_path_id - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::Domain`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::Domain`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Domain ViewSet -pub async fn tenants_domains_update( - configuration: &configuration::Configuration, - id: i32, - domain_request: models::DomainRequest, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_id = id; - let p_body_domain_request = domain_request; - - let uri_str = format!( - "{}/tenants/domains/{id}/", - configuration.base_path, - id = p_path_id - ); - let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - req_builder = req_builder.json(&p_body_domain_request); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::Domain`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::Domain`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Tenant Viewset -pub async fn tenants_tenants_create( - configuration: &configuration::Configuration, - tenant_request: models::TenantRequest, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_body_tenant_request = tenant_request; - - let uri_str = format!("{}/tenants/tenants/", configuration.base_path); - let mut req_builder = configuration - .client - .request(reqwest::Method::POST, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - req_builder = req_builder.json(&p_body_tenant_request); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::Tenant`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::Tenant`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Create admin group and add user to it. -pub async fn tenants_tenants_create_admin_group_create( - configuration: &configuration::Configuration, - tenant_uuid: &str, - tenant_admin_group_request_request: models::TenantAdminGroupRequestRequest, -) -> Result<(), Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_tenant_uuid = tenant_uuid; - let p_body_tenant_admin_group_request_request = tenant_admin_group_request_request; - - let uri_str = format!( - "{}/tenants/tenants/{tenant_uuid}/create_admin_group/", - configuration.base_path, - tenant_uuid = crate::apis::urlencode(p_path_tenant_uuid) - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::POST, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - req_builder = req_builder.json(&p_body_tenant_admin_group_request_request); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - - if !status.is_client_error() && !status.is_server_error() { - Ok(()) - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Create recovery key for user. -pub async fn tenants_tenants_create_recovery_key_create( - configuration: &configuration::Configuration, - tenant_uuid: &str, - tenant_recovery_key_request_request: models::TenantRecoveryKeyRequestRequest, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_tenant_uuid = tenant_uuid; - let p_body_tenant_recovery_key_request_request = tenant_recovery_key_request_request; - - let uri_str = format!( - "{}/tenants/tenants/{tenant_uuid}/create_recovery_key/", - configuration.base_path, - tenant_uuid = crate::apis::urlencode(p_path_tenant_uuid) - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::POST, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - req_builder = req_builder.json(&p_body_tenant_recovery_key_request_request); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::TenantRecoveryKeyResponse`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::TenantRecoveryKeyResponse`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = - serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Tenant Viewset -pub async fn tenants_tenants_destroy( - configuration: &configuration::Configuration, - tenant_uuid: &str, -) -> Result<(), Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_tenant_uuid = tenant_uuid; - - let uri_str = format!( - "{}/tenants/tenants/{tenant_uuid}/", - configuration.base_path, - tenant_uuid = crate::apis::urlencode(p_path_tenant_uuid) - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::DELETE, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - - if !status.is_client_error() && !status.is_server_error() { - Ok(()) - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Tenant Viewset -pub async fn tenants_tenants_list( - configuration: &configuration::Configuration, - ordering: Option<&str>, - page: Option, - page_size: Option, - search: Option<&str>, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_query_ordering = ordering; - let p_query_page = page; - let p_query_page_size = page_size; - let p_query_search = search; - - let uri_str = format!("{}/tenants/tenants/", configuration.base_path); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref param_value) = p_query_ordering { - req_builder = req_builder.query(&[("ordering", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_page { - req_builder = req_builder.query(&[("page", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_page_size { - req_builder = req_builder.query(&[("page_size", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_query_search { - req_builder = req_builder.query(&[("search", ¶m_value.to_string())]); - } - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::PaginatedTenantList`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::PaginatedTenantList`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Tenant Viewset -pub async fn tenants_tenants_partial_update( - configuration: &configuration::Configuration, - tenant_uuid: &str, - patched_tenant_request: Option, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_tenant_uuid = tenant_uuid; - let p_body_patched_tenant_request = patched_tenant_request; - - let uri_str = format!( - "{}/tenants/tenants/{tenant_uuid}/", - configuration.base_path, - tenant_uuid = crate::apis::urlencode(p_path_tenant_uuid) - ); - let mut req_builder = configuration - .client - .request(reqwest::Method::PATCH, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - req_builder = req_builder.json(&p_body_patched_tenant_request); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::Tenant`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::Tenant`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Tenant Viewset -pub async fn tenants_tenants_retrieve( - configuration: &configuration::Configuration, - tenant_uuid: &str, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_tenant_uuid = tenant_uuid; - - let uri_str = format!( - "{}/tenants/tenants/{tenant_uuid}/", - configuration.base_path, - tenant_uuid = crate::apis::urlencode(p_path_tenant_uuid) - ); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::Tenant`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::Tenant`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} - -/// Tenant Viewset -pub async fn tenants_tenants_update( - configuration: &configuration::Configuration, - tenant_uuid: &str, - tenant_request: models::TenantRequest, -) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_path_tenant_uuid = tenant_uuid; - let p_body_tenant_request = tenant_request; - - let uri_str = format!( - "{}/tenants/tenants/{tenant_uuid}/", - configuration.base_path, - tenant_uuid = crate::apis::urlencode(p_path_tenant_uuid) - ); - let mut req_builder = configuration.client.request(reqwest::Method::PUT, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - req_builder = req_builder.json(&p_body_tenant_request); - - let req = req_builder.build()?; - let resp = configuration.client.execute(req).await?; - - let status = resp.status(); - let content_type = resp - .headers() - .get("content-type") - .and_then(|v| v.to_str().ok()) - .unwrap_or("application/octet-stream"); - let content_type = super::ContentType::from(content_type); - - if !status.is_client_error() && !status.is_server_error() { - let content = resp.text().await?; - match content_type { - ContentType::Json => serde_json::from_str(&content).map_err(Error::from), - ContentType::Text => { - return Err(Error::from(serde_json::Error::custom( - "Received `text/plain` content type response that cannot be converted to \ - `models::Tenant`", - ))); - } - ContentType::Unsupported(unknown_type) => { - return Err(Error::from(serde_json::Error::custom(format!( - "Received `{unknown_type}` content type response that cannot be converted to \ - `models::Tenant`" - )))); - } - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { - status, - content, - entity, - })) - } -} diff --git a/packages/client-rust/src/models/agent_authentication_response.rs b/packages/client-rust/src/models/agent_authentication_response.rs deleted file mode 100644 index 5bc5577065..0000000000 --- a/packages/client-rust/src/models/agent_authentication_response.rs +++ /dev/null @@ -1,26 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// AgentAuthenticationResponse : Base serializer class which doesn't implement create/update -/// methods -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct AgentAuthenticationResponse { - #[serde(rename = "url")] - pub url: String, -} - -impl AgentAuthenticationResponse { - /// Base serializer class which doesn't implement create/update methods - pub fn new(url: String) -> AgentAuthenticationResponse { - AgentAuthenticationResponse { url } - } -} diff --git a/packages/client-rust/src/models/agent_config.rs b/packages/client-rust/src/models/agent_config.rs deleted file mode 100644 index 7710d65414..0000000000 --- a/packages/client-rust/src/models/agent_config.rs +++ /dev/null @@ -1,68 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// AgentConfig : Base serializer class which doesn't implement create/update methods -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct AgentConfig { - #[serde(rename = "device_id")] - pub device_id: String, - #[serde(rename = "refresh_interval")] - pub refresh_interval: i32, - #[serde( - rename = "authorization_flow", - deserialize_with = "Option::deserialize" - )] - pub authorization_flow: Option, - #[serde(rename = "jwks_auth")] - pub jwks_auth: std::collections::HashMap, - #[serde(rename = "jwks_challenge", deserialize_with = "Option::deserialize")] - pub jwks_challenge: Option>, - #[serde(rename = "nss_uid_offset")] - pub nss_uid_offset: i32, - #[serde(rename = "nss_gid_offset")] - pub nss_gid_offset: i32, - #[serde(rename = "auth_terminate_session_on_expiry")] - pub auth_terminate_session_on_expiry: bool, - #[serde(rename = "system_config")] - pub system_config: models::Config, - #[serde(rename = "license_status", deserialize_with = "Option::deserialize")] - pub license_status: Option, -} - -impl AgentConfig { - /// Base serializer class which doesn't implement create/update methods - pub fn new( - device_id: String, - refresh_interval: i32, - authorization_flow: Option, - jwks_auth: std::collections::HashMap, - jwks_challenge: Option>, - nss_uid_offset: i32, - nss_gid_offset: i32, - auth_terminate_session_on_expiry: bool, - system_config: models::Config, - license_status: Option, - ) -> AgentConfig { - AgentConfig { - 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, - } - } -} diff --git a/packages/client-rust/src/models/agent_connector.rs b/packages/client-rust/src/models/agent_connector.rs deleted file mode 100644 index c04b03ad63..0000000000 --- a/packages/client-rust/src/models/agent_connector.rs +++ /dev/null @@ -1,111 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct AgentConnector { - #[serde(rename = "connector_uuid", skip_serializing_if = "Option::is_none")] - pub connector_uuid: Option, - #[serde(rename = "name")] - pub name: String, - #[serde(rename = "enabled", skip_serializing_if = "Option::is_none")] - pub enabled: Option, - /// Get object component so that we know how to edit the object - #[serde(rename = "component")] - pub component: String, - /// Return object's verbose_name - #[serde(rename = "verbose_name")] - pub verbose_name: String, - /// Return object's plural verbose_name - #[serde(rename = "verbose_name_plural")] - pub verbose_name_plural: String, - /// Return internal model name - #[serde(rename = "meta_model_name")] - pub meta_model_name: String, - #[serde(rename = "snapshot_expiry", skip_serializing_if = "Option::is_none")] - pub snapshot_expiry: Option, - #[serde( - rename = "auth_session_duration", - skip_serializing_if = "Option::is_none" - )] - pub auth_session_duration: Option, - #[serde( - rename = "auth_terminate_session_on_expiry", - skip_serializing_if = "Option::is_none" - )] - pub auth_terminate_session_on_expiry: Option, - #[serde(rename = "refresh_interval", skip_serializing_if = "Option::is_none")] - pub refresh_interval: Option, - #[serde( - rename = "authorization_flow", - default, - with = "::serde_with::rust::double_option", - skip_serializing_if = "Option::is_none" - )] - pub authorization_flow: Option>, - #[serde(rename = "nss_uid_offset", skip_serializing_if = "Option::is_none")] - pub nss_uid_offset: Option, - #[serde(rename = "nss_gid_offset", skip_serializing_if = "Option::is_none")] - pub nss_gid_offset: Option, - #[serde( - rename = "challenge_key", - default, - with = "::serde_with::rust::double_option", - skip_serializing_if = "Option::is_none" - )] - pub challenge_key: Option>, - #[serde( - rename = "challenge_idle_timeout", - skip_serializing_if = "Option::is_none" - )] - pub challenge_idle_timeout: Option, - #[serde( - rename = "challenge_trigger_check_in", - skip_serializing_if = "Option::is_none" - )] - pub challenge_trigger_check_in: Option, - #[serde( - rename = "jwt_federation_providers", - skip_serializing_if = "Option::is_none" - )] - pub jwt_federation_providers: Option>, -} - -impl AgentConnector { - pub fn new( - name: String, - component: String, - verbose_name: String, - verbose_name_plural: String, - meta_model_name: String, - ) -> AgentConnector { - AgentConnector { - connector_uuid: None, - name, - enabled: None, - component, - verbose_name, - verbose_name_plural, - meta_model_name, - snapshot_expiry: None, - auth_session_duration: None, - auth_terminate_session_on_expiry: None, - refresh_interval: None, - authorization_flow: None, - nss_uid_offset: None, - nss_gid_offset: None, - challenge_key: None, - challenge_idle_timeout: None, - challenge_trigger_check_in: None, - jwt_federation_providers: None, - } - } -} diff --git a/packages/client-rust/src/models/agent_connector_request.rs b/packages/client-rust/src/models/agent_connector_request.rs deleted file mode 100644 index 07ba352da2..0000000000 --- a/packages/client-rust/src/models/agent_connector_request.rs +++ /dev/null @@ -1,89 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct AgentConnectorRequest { - #[serde(rename = "connector_uuid", skip_serializing_if = "Option::is_none")] - pub connector_uuid: Option, - #[serde(rename = "name")] - pub name: String, - #[serde(rename = "enabled", skip_serializing_if = "Option::is_none")] - pub enabled: Option, - #[serde(rename = "snapshot_expiry", skip_serializing_if = "Option::is_none")] - pub snapshot_expiry: Option, - #[serde( - rename = "auth_session_duration", - skip_serializing_if = "Option::is_none" - )] - pub auth_session_duration: Option, - #[serde( - rename = "auth_terminate_session_on_expiry", - skip_serializing_if = "Option::is_none" - )] - pub auth_terminate_session_on_expiry: Option, - #[serde(rename = "refresh_interval", skip_serializing_if = "Option::is_none")] - pub refresh_interval: Option, - #[serde( - rename = "authorization_flow", - default, - with = "::serde_with::rust::double_option", - skip_serializing_if = "Option::is_none" - )] - pub authorization_flow: Option>, - #[serde(rename = "nss_uid_offset", skip_serializing_if = "Option::is_none")] - pub nss_uid_offset: Option, - #[serde(rename = "nss_gid_offset", skip_serializing_if = "Option::is_none")] - pub nss_gid_offset: Option, - #[serde( - rename = "challenge_key", - default, - with = "::serde_with::rust::double_option", - skip_serializing_if = "Option::is_none" - )] - pub challenge_key: Option>, - #[serde( - rename = "challenge_idle_timeout", - skip_serializing_if = "Option::is_none" - )] - pub challenge_idle_timeout: Option, - #[serde( - rename = "challenge_trigger_check_in", - skip_serializing_if = "Option::is_none" - )] - pub challenge_trigger_check_in: Option, - #[serde( - rename = "jwt_federation_providers", - skip_serializing_if = "Option::is_none" - )] - pub jwt_federation_providers: Option>, -} - -impl AgentConnectorRequest { - pub fn new(name: String) -> AgentConnectorRequest { - AgentConnectorRequest { - connector_uuid: None, - name, - enabled: None, - snapshot_expiry: None, - auth_session_duration: None, - auth_terminate_session_on_expiry: None, - refresh_interval: None, - authorization_flow: None, - nss_uid_offset: None, - nss_gid_offset: None, - challenge_key: None, - challenge_idle_timeout: None, - challenge_trigger_check_in: None, - jwt_federation_providers: None, - } - } -} diff --git a/packages/client-rust/src/models/agent_psso_device_registration_request.rs b/packages/client-rust/src/models/agent_psso_device_registration_request.rs deleted file mode 100644 index c502edc105..0000000000 --- a/packages/client-rust/src/models/agent_psso_device_registration_request.rs +++ /dev/null @@ -1,41 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// AgentPssoDeviceRegistrationRequest : Register Apple device via Platform SSO -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct AgentPssoDeviceRegistrationRequest { - #[serde(rename = "device_signing_key")] - pub device_signing_key: String, - #[serde(rename = "device_encryption_key")] - pub device_encryption_key: String, - #[serde(rename = "sign_key_id")] - pub sign_key_id: String, - #[serde(rename = "enc_key_id")] - pub enc_key_id: String, -} - -impl AgentPssoDeviceRegistrationRequest { - /// Register Apple device via Platform SSO - pub fn new( - device_signing_key: String, - device_encryption_key: String, - sign_key_id: String, - enc_key_id: String, - ) -> AgentPssoDeviceRegistrationRequest { - AgentPssoDeviceRegistrationRequest { - device_signing_key, - device_encryption_key, - sign_key_id, - enc_key_id, - } - } -} diff --git a/packages/client-rust/src/models/agent_psso_device_registration_response.rs b/packages/client-rust/src/models/agent_psso_device_registration_response.rs deleted file mode 100644 index 35a52ed2e6..0000000000 --- a/packages/client-rust/src/models/agent_psso_device_registration_response.rs +++ /dev/null @@ -1,49 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// AgentPssoDeviceRegistrationResponse : authentik settings for Platform SSO tokens -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct AgentPssoDeviceRegistrationResponse { - #[serde(rename = "client_id")] - pub client_id: String, - #[serde(rename = "issuer")] - pub issuer: String, - #[serde(rename = "token_endpoint")] - pub token_endpoint: String, - #[serde(rename = "jwks_endpoint")] - pub jwks_endpoint: String, - #[serde(rename = "audience")] - pub audience: String, - #[serde(rename = "nonce_endpoint")] - pub nonce_endpoint: String, -} - -impl AgentPssoDeviceRegistrationResponse { - /// authentik settings for Platform SSO tokens - pub fn new( - client_id: String, - issuer: String, - token_endpoint: String, - jwks_endpoint: String, - audience: String, - nonce_endpoint: String, - ) -> AgentPssoDeviceRegistrationResponse { - AgentPssoDeviceRegistrationResponse { - client_id, - issuer, - token_endpoint, - jwks_endpoint, - audience, - nonce_endpoint, - } - } -} diff --git a/packages/client-rust/src/models/agent_psso_user_registration_request.rs b/packages/client-rust/src/models/agent_psso_user_registration_request.rs deleted file mode 100644 index ea5ddfd340..0000000000 --- a/packages/client-rust/src/models/agent_psso_user_registration_request.rs +++ /dev/null @@ -1,37 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// AgentPssoUserRegistrationRequest : Register Apple device user via Platform SSO -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct AgentPssoUserRegistrationRequest { - #[serde(rename = "user_auth")] - pub user_auth: String, - #[serde(rename = "user_secure_enclave_key")] - pub user_secure_enclave_key: String, - #[serde(rename = "enclave_key_id")] - pub enclave_key_id: String, -} - -impl AgentPssoUserRegistrationRequest { - /// Register Apple device user via Platform SSO - pub fn new( - user_auth: String, - user_secure_enclave_key: String, - enclave_key_id: String, - ) -> AgentPssoUserRegistrationRequest { - AgentPssoUserRegistrationRequest { - user_auth, - user_secure_enclave_key, - enclave_key_id, - } - } -} diff --git a/packages/client-rust/src/models/agent_token_response.rs b/packages/client-rust/src/models/agent_token_response.rs deleted file mode 100644 index b48efc6093..0000000000 --- a/packages/client-rust/src/models/agent_token_response.rs +++ /dev/null @@ -1,30 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// AgentTokenResponse : Base serializer class which doesn't implement create/update methods -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct AgentTokenResponse { - #[serde(rename = "token")] - pub token: String, - #[serde(rename = "expires_in", skip_serializing_if = "Option::is_none")] - pub expires_in: Option, -} - -impl AgentTokenResponse { - /// Base serializer class which doesn't implement create/update methods - pub fn new(token: String) -> AgentTokenResponse { - AgentTokenResponse { - token, - expires_in: None, - } - } -} diff --git a/packages/client-rust/src/models/alg_enum.rs b/packages/client-rust/src/models/alg_enum.rs deleted file mode 100644 index 97a9d00e86..0000000000 --- a/packages/client-rust/src/models/alg_enum.rs +++ /dev/null @@ -1,41 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// -#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] -pub enum AlgEnum { - #[serde(rename = "rsa")] - Rsa, - #[serde(rename = "ecdsa")] - Ecdsa, - #[serde(rename = "ed25519")] - Ed25519, - #[serde(rename = "ed448")] - Ed448, -} - -impl std::fmt::Display for AlgEnum { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - match self { - Self::Rsa => write!(f, "rsa"), - Self::Ecdsa => write!(f, "ecdsa"), - Self::Ed25519 => write!(f, "ed25519"), - Self::Ed448 => write!(f, "ed448"), - } - } -} - -impl Default for AlgEnum { - fn default() -> AlgEnum { - Self::Rsa - } -} diff --git a/packages/client-rust/src/models/app.rs b/packages/client-rust/src/models/app.rs deleted file mode 100644 index f55e532846..0000000000 --- a/packages/client-rust/src/models/app.rs +++ /dev/null @@ -1,27 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// App : Serialize Application info -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct App { - #[serde(rename = "name")] - pub name: String, - #[serde(rename = "label")] - pub label: String, -} - -impl App { - /// Serialize Application info - pub fn new(name: String, label: String) -> App { - App { name, label } - } -} diff --git a/packages/client-rust/src/models/app_enum.rs b/packages/client-rust/src/models/app_enum.rs deleted file mode 100644 index c97a018324..0000000000 --- a/packages/client-rust/src/models/app_enum.rs +++ /dev/null @@ -1,306 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// -#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] -pub enum AppEnum { - #[serde(rename = "authentik.commands")] - AuthentikCommands, - #[serde(rename = "authentik.tenants")] - AuthentikTenants, - #[serde(rename = "authentik.tasks")] - AuthentikTasks, - #[serde(rename = "authentik.admin")] - AuthentikAdmin, - #[serde(rename = "authentik.api")] - AuthentikApi, - #[serde(rename = "authentik.core")] - AuthentikCore, - #[serde(rename = "authentik.crypto")] - AuthentikCrypto, - #[serde(rename = "authentik.endpoints")] - AuthentikEndpoints, - #[serde(rename = "authentik.endpoints.connectors.agent")] - AuthentikEndpointsConnectorsAgent, - #[serde(rename = "authentik.enterprise")] - AuthentikEnterprise, - #[serde(rename = "authentik.events")] - AuthentikEvents, - #[serde(rename = "authentik.admin.files")] - AuthentikAdminFiles, - #[serde(rename = "authentik.flows")] - AuthentikFlows, - #[serde(rename = "authentik.outposts")] - AuthentikOutposts, - #[serde(rename = "authentik.policies.dummy")] - AuthentikPoliciesDummy, - #[serde(rename = "authentik.policies.event_matcher")] - AuthentikPoliciesEventMatcher, - #[serde(rename = "authentik.policies.expiry")] - AuthentikPoliciesExpiry, - #[serde(rename = "authentik.policies.expression")] - AuthentikPoliciesExpression, - #[serde(rename = "authentik.policies.geoip")] - AuthentikPoliciesGeoip, - #[serde(rename = "authentik.policies.password")] - AuthentikPoliciesPassword, - #[serde(rename = "authentik.policies.reputation")] - AuthentikPoliciesReputation, - #[serde(rename = "authentik.policies")] - AuthentikPolicies, - #[serde(rename = "authentik.providers.ldap")] - AuthentikProvidersLdap, - #[serde(rename = "authentik.providers.oauth2")] - AuthentikProvidersOauth2, - #[serde(rename = "authentik.providers.proxy")] - AuthentikProvidersProxy, - #[serde(rename = "authentik.providers.rac")] - AuthentikProvidersRac, - #[serde(rename = "authentik.providers.radius")] - AuthentikProvidersRadius, - #[serde(rename = "authentik.providers.saml")] - AuthentikProvidersSaml, - #[serde(rename = "authentik.providers.scim")] - AuthentikProvidersScim, - #[serde(rename = "authentik.rbac")] - AuthentikRbac, - #[serde(rename = "authentik.recovery")] - AuthentikRecovery, - #[serde(rename = "authentik.sources.kerberos")] - AuthentikSourcesKerberos, - #[serde(rename = "authentik.sources.ldap")] - AuthentikSourcesLdap, - #[serde(rename = "authentik.sources.oauth")] - AuthentikSourcesOauth, - #[serde(rename = "authentik.sources.plex")] - AuthentikSourcesPlex, - #[serde(rename = "authentik.sources.saml")] - AuthentikSourcesSaml, - #[serde(rename = "authentik.sources.scim")] - AuthentikSourcesScim, - #[serde(rename = "authentik.sources.telegram")] - AuthentikSourcesTelegram, - #[serde(rename = "authentik.stages.authenticator")] - AuthentikStagesAuthenticator, - #[serde(rename = "authentik.stages.authenticator_duo")] - AuthentikStagesAuthenticatorDuo, - #[serde(rename = "authentik.stages.authenticator_email")] - AuthentikStagesAuthenticatorEmail, - #[serde(rename = "authentik.stages.authenticator_sms")] - AuthentikStagesAuthenticatorSms, - #[serde(rename = "authentik.stages.authenticator_static")] - AuthentikStagesAuthenticatorStatic, - #[serde(rename = "authentik.stages.authenticator_totp")] - AuthentikStagesAuthenticatorTotp, - #[serde(rename = "authentik.stages.authenticator_validate")] - AuthentikStagesAuthenticatorValidate, - #[serde(rename = "authentik.stages.authenticator_webauthn")] - AuthentikStagesAuthenticatorWebauthn, - #[serde(rename = "authentik.stages.captcha")] - AuthentikStagesCaptcha, - #[serde(rename = "authentik.stages.consent")] - AuthentikStagesConsent, - #[serde(rename = "authentik.stages.deny")] - AuthentikStagesDeny, - #[serde(rename = "authentik.stages.dummy")] - AuthentikStagesDummy, - #[serde(rename = "authentik.stages.email")] - AuthentikStagesEmail, - #[serde(rename = "authentik.stages.identification")] - AuthentikStagesIdentification, - #[serde(rename = "authentik.stages.invitation")] - AuthentikStagesInvitation, - #[serde(rename = "authentik.stages.password")] - AuthentikStagesPassword, - #[serde(rename = "authentik.stages.prompt")] - AuthentikStagesPrompt, - #[serde(rename = "authentik.stages.redirect")] - AuthentikStagesRedirect, - #[serde(rename = "authentik.stages.user_delete")] - AuthentikStagesUserDelete, - #[serde(rename = "authentik.stages.user_login")] - AuthentikStagesUserLogin, - #[serde(rename = "authentik.stages.user_logout")] - AuthentikStagesUserLogout, - #[serde(rename = "authentik.stages.user_write")] - AuthentikStagesUserWrite, - #[serde(rename = "authentik.tasks.schedules")] - AuthentikTasksSchedules, - #[serde(rename = "authentik.brands")] - AuthentikBrands, - #[serde(rename = "authentik.blueprints")] - AuthentikBlueprints, - #[serde(rename = "authentik.enterprise.audit")] - AuthentikEnterpriseAudit, - #[serde(rename = "authentik.enterprise.endpoints.connectors.agent")] - AuthentikEnterpriseEndpointsConnectorsAgent, - #[serde(rename = "authentik.enterprise.endpoints.connectors.fleet")] - AuthentikEnterpriseEndpointsConnectorsFleet, - #[serde(rename = "authentik.enterprise.endpoints.connectors.google_chrome")] - AuthentikEnterpriseEndpointsConnectorsGoogleChrome, - #[serde(rename = "authentik.enterprise.lifecycle")] - AuthentikEnterpriseLifecycle, - #[serde(rename = "authentik.enterprise.policies.unique_password")] - AuthentikEnterprisePoliciesUniquePassword, - #[serde(rename = "authentik.enterprise.providers.google_workspace")] - AuthentikEnterpriseProvidersGoogleWorkspace, - #[serde(rename = "authentik.enterprise.providers.microsoft_entra")] - AuthentikEnterpriseProvidersMicrosoftEntra, - #[serde(rename = "authentik.enterprise.providers.radius")] - AuthentikEnterpriseProvidersRadius, - #[serde(rename = "authentik.enterprise.providers.scim")] - AuthentikEnterpriseProvidersScim, - #[serde(rename = "authentik.enterprise.providers.ssf")] - AuthentikEnterpriseProvidersSsf, - #[serde(rename = "authentik.enterprise.providers.ws_federation")] - AuthentikEnterpriseProvidersWsFederation, - #[serde(rename = "authentik.enterprise.reports")] - AuthentikEnterpriseReports, - #[serde(rename = "authentik.enterprise.stages.authenticator_endpoint_gdtc")] - AuthentikEnterpriseStagesAuthenticatorEndpointGdtc, - #[serde(rename = "authentik.enterprise.stages.mtls")] - AuthentikEnterpriseStagesMtls, - #[serde(rename = "authentik.enterprise.stages.source")] - AuthentikEnterpriseStagesSource, -} - -impl std::fmt::Display for AppEnum { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - match self { - Self::AuthentikCommands => write!(f, "authentik.commands"), - Self::AuthentikTenants => write!(f, "authentik.tenants"), - Self::AuthentikTasks => write!(f, "authentik.tasks"), - Self::AuthentikAdmin => write!(f, "authentik.admin"), - Self::AuthentikApi => write!(f, "authentik.api"), - Self::AuthentikCore => write!(f, "authentik.core"), - Self::AuthentikCrypto => write!(f, "authentik.crypto"), - Self::AuthentikEndpoints => write!(f, "authentik.endpoints"), - Self::AuthentikEndpointsConnectorsAgent => { - write!(f, "authentik.endpoints.connectors.agent") - } - Self::AuthentikEnterprise => write!(f, "authentik.enterprise"), - Self::AuthentikEvents => write!(f, "authentik.events"), - Self::AuthentikAdminFiles => write!(f, "authentik.admin.files"), - Self::AuthentikFlows => write!(f, "authentik.flows"), - Self::AuthentikOutposts => write!(f, "authentik.outposts"), - Self::AuthentikPoliciesDummy => write!(f, "authentik.policies.dummy"), - Self::AuthentikPoliciesEventMatcher => write!(f, "authentik.policies.event_matcher"), - Self::AuthentikPoliciesExpiry => write!(f, "authentik.policies.expiry"), - Self::AuthentikPoliciesExpression => write!(f, "authentik.policies.expression"), - Self::AuthentikPoliciesGeoip => write!(f, "authentik.policies.geoip"), - Self::AuthentikPoliciesPassword => write!(f, "authentik.policies.password"), - Self::AuthentikPoliciesReputation => write!(f, "authentik.policies.reputation"), - Self::AuthentikPolicies => write!(f, "authentik.policies"), - Self::AuthentikProvidersLdap => write!(f, "authentik.providers.ldap"), - Self::AuthentikProvidersOauth2 => write!(f, "authentik.providers.oauth2"), - Self::AuthentikProvidersProxy => write!(f, "authentik.providers.proxy"), - Self::AuthentikProvidersRac => write!(f, "authentik.providers.rac"), - Self::AuthentikProvidersRadius => write!(f, "authentik.providers.radius"), - Self::AuthentikProvidersSaml => write!(f, "authentik.providers.saml"), - Self::AuthentikProvidersScim => write!(f, "authentik.providers.scim"), - Self::AuthentikRbac => write!(f, "authentik.rbac"), - Self::AuthentikRecovery => write!(f, "authentik.recovery"), - Self::AuthentikSourcesKerberos => write!(f, "authentik.sources.kerberos"), - Self::AuthentikSourcesLdap => write!(f, "authentik.sources.ldap"), - Self::AuthentikSourcesOauth => write!(f, "authentik.sources.oauth"), - Self::AuthentikSourcesPlex => write!(f, "authentik.sources.plex"), - Self::AuthentikSourcesSaml => write!(f, "authentik.sources.saml"), - Self::AuthentikSourcesScim => write!(f, "authentik.sources.scim"), - Self::AuthentikSourcesTelegram => write!(f, "authentik.sources.telegram"), - Self::AuthentikStagesAuthenticator => write!(f, "authentik.stages.authenticator"), - Self::AuthentikStagesAuthenticatorDuo => { - write!(f, "authentik.stages.authenticator_duo") - } - Self::AuthentikStagesAuthenticatorEmail => { - write!(f, "authentik.stages.authenticator_email") - } - Self::AuthentikStagesAuthenticatorSms => { - write!(f, "authentik.stages.authenticator_sms") - } - Self::AuthentikStagesAuthenticatorStatic => { - write!(f, "authentik.stages.authenticator_static") - } - Self::AuthentikStagesAuthenticatorTotp => { - write!(f, "authentik.stages.authenticator_totp") - } - Self::AuthentikStagesAuthenticatorValidate => { - write!(f, "authentik.stages.authenticator_validate") - } - Self::AuthentikStagesAuthenticatorWebauthn => { - write!(f, "authentik.stages.authenticator_webauthn") - } - Self::AuthentikStagesCaptcha => write!(f, "authentik.stages.captcha"), - Self::AuthentikStagesConsent => write!(f, "authentik.stages.consent"), - Self::AuthentikStagesDeny => write!(f, "authentik.stages.deny"), - Self::AuthentikStagesDummy => write!(f, "authentik.stages.dummy"), - Self::AuthentikStagesEmail => write!(f, "authentik.stages.email"), - Self::AuthentikStagesIdentification => write!(f, "authentik.stages.identification"), - Self::AuthentikStagesInvitation => write!(f, "authentik.stages.invitation"), - Self::AuthentikStagesPassword => write!(f, "authentik.stages.password"), - Self::AuthentikStagesPrompt => write!(f, "authentik.stages.prompt"), - Self::AuthentikStagesRedirect => write!(f, "authentik.stages.redirect"), - Self::AuthentikStagesUserDelete => write!(f, "authentik.stages.user_delete"), - Self::AuthentikStagesUserLogin => write!(f, "authentik.stages.user_login"), - Self::AuthentikStagesUserLogout => write!(f, "authentik.stages.user_logout"), - Self::AuthentikStagesUserWrite => write!(f, "authentik.stages.user_write"), - Self::AuthentikTasksSchedules => write!(f, "authentik.tasks.schedules"), - Self::AuthentikBrands => write!(f, "authentik.brands"), - Self::AuthentikBlueprints => write!(f, "authentik.blueprints"), - Self::AuthentikEnterpriseAudit => write!(f, "authentik.enterprise.audit"), - Self::AuthentikEnterpriseEndpointsConnectorsAgent => { - write!(f, "authentik.enterprise.endpoints.connectors.agent") - } - Self::AuthentikEnterpriseEndpointsConnectorsFleet => { - write!(f, "authentik.enterprise.endpoints.connectors.fleet") - } - Self::AuthentikEnterpriseEndpointsConnectorsGoogleChrome => { - write!(f, "authentik.enterprise.endpoints.connectors.google_chrome") - } - Self::AuthentikEnterpriseLifecycle => write!(f, "authentik.enterprise.lifecycle"), - Self::AuthentikEnterprisePoliciesUniquePassword => { - write!(f, "authentik.enterprise.policies.unique_password") - } - Self::AuthentikEnterpriseProvidersGoogleWorkspace => { - write!(f, "authentik.enterprise.providers.google_workspace") - } - Self::AuthentikEnterpriseProvidersMicrosoftEntra => { - write!(f, "authentik.enterprise.providers.microsoft_entra") - } - Self::AuthentikEnterpriseProvidersRadius => { - write!(f, "authentik.enterprise.providers.radius") - } - Self::AuthentikEnterpriseProvidersScim => { - write!(f, "authentik.enterprise.providers.scim") - } - Self::AuthentikEnterpriseProvidersSsf => { - write!(f, "authentik.enterprise.providers.ssf") - } - Self::AuthentikEnterpriseProvidersWsFederation => { - write!(f, "authentik.enterprise.providers.ws_federation") - } - Self::AuthentikEnterpriseReports => write!(f, "authentik.enterprise.reports"), - Self::AuthentikEnterpriseStagesAuthenticatorEndpointGdtc => { - write!(f, "authentik.enterprise.stages.authenticator_endpoint_gdtc") - } - Self::AuthentikEnterpriseStagesMtls => write!(f, "authentik.enterprise.stages.mtls"), - Self::AuthentikEnterpriseStagesSource => { - write!(f, "authentik.enterprise.stages.source") - } - } - } -} - -impl Default for AppEnum { - fn default() -> AppEnum { - Self::AuthentikCommands - } -} diff --git a/packages/client-rust/src/models/application.rs b/packages/client-rust/src/models/application.rs deleted file mode 100644 index 6fc097a513..0000000000 --- a/packages/client-rust/src/models/application.rs +++ /dev/null @@ -1,100 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// Application : Application Serializer -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct Application { - #[serde(rename = "pk")] - pub pk: uuid::Uuid, - /// Application's display Name. - #[serde(rename = "name")] - pub name: String, - /// Internal application name, used in URLs. - #[serde(rename = "slug")] - pub slug: String, - #[serde( - rename = "provider", - default, - with = "::serde_with::rust::double_option", - skip_serializing_if = "Option::is_none" - )] - pub provider: Option>, - #[serde(rename = "provider_obj", deserialize_with = "Option::deserialize")] - pub provider_obj: Option, - #[serde( - rename = "backchannel_providers", - skip_serializing_if = "Option::is_none" - )] - pub backchannel_providers: Option>, - #[serde(rename = "backchannel_providers_obj")] - pub backchannel_providers_obj: Vec, - /// Allow formatting of launch URL - #[serde(rename = "launch_url", deserialize_with = "Option::deserialize")] - pub launch_url: Option, - /// Open launch URL in a new browser tab or window. - #[serde(rename = "open_in_new_tab", skip_serializing_if = "Option::is_none")] - pub open_in_new_tab: Option, - #[serde(rename = "meta_launch_url", skip_serializing_if = "Option::is_none")] - pub meta_launch_url: Option, - #[serde(rename = "meta_icon", skip_serializing_if = "Option::is_none")] - pub meta_icon: Option, - /// Get the URL to the App Icon image - #[serde(rename = "meta_icon_url", deserialize_with = "Option::deserialize")] - pub meta_icon_url: Option, - #[serde( - rename = "meta_icon_themed_urls", - deserialize_with = "Option::deserialize" - )] - pub meta_icon_themed_urls: Option, - #[serde(rename = "meta_description", skip_serializing_if = "Option::is_none")] - pub meta_description: Option, - #[serde(rename = "meta_publisher", skip_serializing_if = "Option::is_none")] - pub meta_publisher: Option, - #[serde(rename = "policy_engine_mode", skip_serializing_if = "Option::is_none")] - pub policy_engine_mode: Option, - #[serde(rename = "group", skip_serializing_if = "Option::is_none")] - pub group: Option, -} - -impl Application { - /// Application Serializer - pub fn new( - pk: uuid::Uuid, - name: String, - slug: String, - provider_obj: Option, - backchannel_providers_obj: Vec, - launch_url: Option, - meta_icon_url: Option, - meta_icon_themed_urls: Option, - ) -> Application { - Application { - pk, - name, - slug, - provider: None, - provider_obj, - backchannel_providers: None, - backchannel_providers_obj, - launch_url, - open_in_new_tab: None, - meta_launch_url: None, - meta_icon: None, - meta_icon_url, - meta_icon_themed_urls, - meta_description: None, - meta_publisher: None, - policy_engine_mode: None, - group: None, - } - } -} diff --git a/packages/client-rust/src/models/application_entitlement.rs b/packages/client-rust/src/models/application_entitlement.rs deleted file mode 100644 index 492164c2a2..0000000000 --- a/packages/client-rust/src/models/application_entitlement.rs +++ /dev/null @@ -1,36 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// ApplicationEntitlement : ApplicationEntitlement Serializer -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct ApplicationEntitlement { - #[serde(rename = "pbm_uuid")] - pub pbm_uuid: uuid::Uuid, - #[serde(rename = "name")] - pub name: String, - #[serde(rename = "app")] - pub app: uuid::Uuid, - #[serde(rename = "attributes", skip_serializing_if = "Option::is_none")] - pub attributes: Option>, -} - -impl ApplicationEntitlement { - /// ApplicationEntitlement Serializer - pub fn new(pbm_uuid: uuid::Uuid, name: String, app: uuid::Uuid) -> ApplicationEntitlement { - ApplicationEntitlement { - pbm_uuid, - name, - app, - attributes: None, - } - } -} diff --git a/packages/client-rust/src/models/application_entitlement_request.rs b/packages/client-rust/src/models/application_entitlement_request.rs deleted file mode 100644 index b950af4525..0000000000 --- a/packages/client-rust/src/models/application_entitlement_request.rs +++ /dev/null @@ -1,33 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// ApplicationEntitlementRequest : ApplicationEntitlement Serializer -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct ApplicationEntitlementRequest { - #[serde(rename = "name")] - pub name: String, - #[serde(rename = "app")] - pub app: uuid::Uuid, - #[serde(rename = "attributes", skip_serializing_if = "Option::is_none")] - pub attributes: Option>, -} - -impl ApplicationEntitlementRequest { - /// ApplicationEntitlement Serializer - pub fn new(name: String, app: uuid::Uuid) -> ApplicationEntitlementRequest { - ApplicationEntitlementRequest { - name, - app, - attributes: None, - } - } -} diff --git a/packages/client-rust/src/models/application_request.rs b/packages/client-rust/src/models/application_request.rs deleted file mode 100644 index 236cb9f1ca..0000000000 --- a/packages/client-rust/src/models/application_request.rs +++ /dev/null @@ -1,68 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// ApplicationRequest : Application Serializer -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct ApplicationRequest { - /// Application's display Name. - #[serde(rename = "name")] - pub name: String, - /// Internal application name, used in URLs. - #[serde(rename = "slug")] - pub slug: String, - #[serde( - rename = "provider", - default, - with = "::serde_with::rust::double_option", - skip_serializing_if = "Option::is_none" - )] - pub provider: Option>, - #[serde( - rename = "backchannel_providers", - skip_serializing_if = "Option::is_none" - )] - pub backchannel_providers: Option>, - /// Open launch URL in a new browser tab or window. - #[serde(rename = "open_in_new_tab", skip_serializing_if = "Option::is_none")] - pub open_in_new_tab: Option, - #[serde(rename = "meta_launch_url", skip_serializing_if = "Option::is_none")] - pub meta_launch_url: Option, - #[serde(rename = "meta_icon", skip_serializing_if = "Option::is_none")] - pub meta_icon: Option, - #[serde(rename = "meta_description", skip_serializing_if = "Option::is_none")] - pub meta_description: Option, - #[serde(rename = "meta_publisher", skip_serializing_if = "Option::is_none")] - pub meta_publisher: Option, - #[serde(rename = "policy_engine_mode", skip_serializing_if = "Option::is_none")] - pub policy_engine_mode: Option, - #[serde(rename = "group", skip_serializing_if = "Option::is_none")] - pub group: Option, -} - -impl ApplicationRequest { - /// Application Serializer - pub fn new(name: String, slug: String) -> ApplicationRequest { - ApplicationRequest { - name, - slug, - provider: None, - backchannel_providers: None, - open_in_new_tab: None, - meta_launch_url: None, - meta_icon: None, - meta_description: None, - meta_publisher: None, - policy_engine_mode: None, - group: None, - } - } -} diff --git a/packages/client-rust/src/models/auth_type_enum.rs b/packages/client-rust/src/models/auth_type_enum.rs deleted file mode 100644 index 06f4589548..0000000000 --- a/packages/client-rust/src/models/auth_type_enum.rs +++ /dev/null @@ -1,35 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// -#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] -pub enum AuthTypeEnum { - #[serde(rename = "basic")] - Basic, - #[serde(rename = "bearer")] - Bearer, -} - -impl std::fmt::Display for AuthTypeEnum { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - match self { - Self::Basic => write!(f, "basic"), - Self::Bearer => write!(f, "bearer"), - } - } -} - -impl Default for AuthTypeEnum { - fn default() -> AuthTypeEnum { - Self::Basic - } -} diff --git a/packages/client-rust/src/models/authenticated_session.rs b/packages/client-rust/src/models/authenticated_session.rs deleted file mode 100644 index 75eab0eba6..0000000000 --- a/packages/client-rust/src/models/authenticated_session.rs +++ /dev/null @@ -1,65 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// AuthenticatedSession : AuthenticatedSession Serializer -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct AuthenticatedSession { - #[serde(rename = "uuid", skip_serializing_if = "Option::is_none")] - pub uuid: Option, - /// Check if session is currently active session - #[serde(rename = "current")] - pub current: bool, - #[serde(rename = "user_agent")] - pub user_agent: models::AuthenticatedSessionUserAgent, - #[serde(rename = "geo_ip", deserialize_with = "Option::deserialize")] - pub geo_ip: Option, - #[serde(rename = "asn", deserialize_with = "Option::deserialize")] - pub asn: Option, - #[serde(rename = "user")] - pub user: i32, - #[serde(rename = "last_ip")] - pub last_ip: String, - #[serde(rename = "last_user_agent")] - pub last_user_agent: String, - #[serde(rename = "last_used")] - pub last_used: String, - #[serde(rename = "expires")] - pub expires: String, -} - -impl AuthenticatedSession { - /// AuthenticatedSession Serializer - pub fn new( - current: bool, - user_agent: models::AuthenticatedSessionUserAgent, - geo_ip: Option, - asn: Option, - user: i32, - last_ip: String, - last_user_agent: String, - last_used: String, - expires: String, - ) -> AuthenticatedSession { - AuthenticatedSession { - uuid: None, - current, - user_agent, - geo_ip, - asn, - user, - last_ip, - last_user_agent, - last_used, - expires, - } - } -} diff --git a/packages/client-rust/src/models/authenticated_session_asn.rs b/packages/client-rust/src/models/authenticated_session_asn.rs deleted file mode 100644 index fe0909d77e..0000000000 --- a/packages/client-rust/src/models/authenticated_session_asn.rs +++ /dev/null @@ -1,37 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// AuthenticatedSessionAsn : Get ASN Data -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct AuthenticatedSessionAsn { - #[serde(rename = "asn", deserialize_with = "Option::deserialize")] - pub asn: Option, - #[serde(rename = "as_org", deserialize_with = "Option::deserialize")] - pub as_org: Option, - #[serde(rename = "network", deserialize_with = "Option::deserialize")] - pub network: Option, -} - -impl AuthenticatedSessionAsn { - /// Get ASN Data - pub fn new( - asn: Option, - as_org: Option, - network: Option, - ) -> AuthenticatedSessionAsn { - AuthenticatedSessionAsn { - asn, - as_org, - network, - } - } -} diff --git a/packages/client-rust/src/models/authenticated_session_geo_ip.rs b/packages/client-rust/src/models/authenticated_session_geo_ip.rs deleted file mode 100644 index 53a9442092..0000000000 --- a/packages/client-rust/src/models/authenticated_session_geo_ip.rs +++ /dev/null @@ -1,45 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// AuthenticatedSessionGeoIp : Get GeoIP Data -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct AuthenticatedSessionGeoIp { - #[serde(rename = "continent", deserialize_with = "Option::deserialize")] - pub continent: Option, - #[serde(rename = "country", deserialize_with = "Option::deserialize")] - pub country: Option, - #[serde(rename = "lat", deserialize_with = "Option::deserialize")] - pub lat: Option, - #[serde(rename = "long", deserialize_with = "Option::deserialize")] - pub long: Option, - #[serde(rename = "city")] - pub city: String, -} - -impl AuthenticatedSessionGeoIp { - /// Get GeoIP Data - pub fn new( - continent: Option, - country: Option, - lat: Option, - long: Option, - city: String, - ) -> AuthenticatedSessionGeoIp { - AuthenticatedSessionGeoIp { - continent, - country, - lat, - long, - city, - } - } -} diff --git a/packages/client-rust/src/models/authenticated_session_user_agent.rs b/packages/client-rust/src/models/authenticated_session_user_agent.rs deleted file mode 100644 index ed84a574ce..0000000000 --- a/packages/client-rust/src/models/authenticated_session_user_agent.rs +++ /dev/null @@ -1,41 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// AuthenticatedSessionUserAgent : Get parsed user agent -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct AuthenticatedSessionUserAgent { - #[serde(rename = "device")] - pub device: models::AuthenticatedSessionUserAgentDevice, - #[serde(rename = "os")] - pub os: models::AuthenticatedSessionUserAgentOs, - #[serde(rename = "user_agent")] - pub user_agent: models::AuthenticatedSessionUserAgentUserAgent, - #[serde(rename = "string")] - pub string: String, -} - -impl AuthenticatedSessionUserAgent { - /// Get parsed user agent - pub fn new( - device: models::AuthenticatedSessionUserAgentDevice, - os: models::AuthenticatedSessionUserAgentOs, - user_agent: models::AuthenticatedSessionUserAgentUserAgent, - string: String, - ) -> AuthenticatedSessionUserAgent { - AuthenticatedSessionUserAgent { - device, - os, - user_agent, - string, - } - } -} diff --git a/packages/client-rust/src/models/authenticated_session_user_agent_device.rs b/packages/client-rust/src/models/authenticated_session_user_agent_device.rs deleted file mode 100644 index f34c4da96c..0000000000 --- a/packages/client-rust/src/models/authenticated_session_user_agent_device.rs +++ /dev/null @@ -1,37 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// AuthenticatedSessionUserAgentDevice : User agent device -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct AuthenticatedSessionUserAgentDevice { - #[serde(rename = "brand")] - pub brand: String, - #[serde(rename = "family")] - pub family: String, - #[serde(rename = "model")] - pub model: String, -} - -impl AuthenticatedSessionUserAgentDevice { - /// User agent device - pub fn new( - brand: String, - family: String, - model: String, - ) -> AuthenticatedSessionUserAgentDevice { - AuthenticatedSessionUserAgentDevice { - brand, - family, - model, - } - } -} diff --git a/packages/client-rust/src/models/authenticated_session_user_agent_os.rs b/packages/client-rust/src/models/authenticated_session_user_agent_os.rs deleted file mode 100644 index e84c6746d0..0000000000 --- a/packages/client-rust/src/models/authenticated_session_user_agent_os.rs +++ /dev/null @@ -1,45 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// AuthenticatedSessionUserAgentOs : User agent os -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct AuthenticatedSessionUserAgentOs { - #[serde(rename = "family")] - pub family: String, - #[serde(rename = "major")] - pub major: String, - #[serde(rename = "minor")] - pub minor: String, - #[serde(rename = "patch")] - pub patch: String, - #[serde(rename = "patch_minor")] - pub patch_minor: String, -} - -impl AuthenticatedSessionUserAgentOs { - /// User agent os - pub fn new( - family: String, - major: String, - minor: String, - patch: String, - patch_minor: String, - ) -> AuthenticatedSessionUserAgentOs { - AuthenticatedSessionUserAgentOs { - family, - major, - minor, - patch, - patch_minor, - } - } -} diff --git a/packages/client-rust/src/models/authenticated_session_user_agent_user_agent.rs b/packages/client-rust/src/models/authenticated_session_user_agent_user_agent.rs deleted file mode 100644 index 2301be4faa..0000000000 --- a/packages/client-rust/src/models/authenticated_session_user_agent_user_agent.rs +++ /dev/null @@ -1,41 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// AuthenticatedSessionUserAgentUserAgent : User agent browser -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct AuthenticatedSessionUserAgentUserAgent { - #[serde(rename = "family")] - pub family: String, - #[serde(rename = "major")] - pub major: String, - #[serde(rename = "minor")] - pub minor: String, - #[serde(rename = "patch")] - pub patch: String, -} - -impl AuthenticatedSessionUserAgentUserAgent { - /// User agent browser - pub fn new( - family: String, - major: String, - minor: String, - patch: String, - ) -> AuthenticatedSessionUserAgentUserAgent { - AuthenticatedSessionUserAgentUserAgent { - family, - major, - minor, - patch, - } - } -} diff --git a/packages/client-rust/src/models/authentication_enum.rs b/packages/client-rust/src/models/authentication_enum.rs deleted file mode 100644 index 9ff4afcf0a..0000000000 --- a/packages/client-rust/src/models/authentication_enum.rs +++ /dev/null @@ -1,47 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// -#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] -pub enum AuthenticationEnum { - #[serde(rename = "none")] - None, - #[serde(rename = "require_authenticated")] - RequireAuthenticated, - #[serde(rename = "require_unauthenticated")] - RequireUnauthenticated, - #[serde(rename = "require_superuser")] - RequireSuperuser, - #[serde(rename = "require_redirect")] - RequireRedirect, - #[serde(rename = "require_outpost")] - RequireOutpost, -} - -impl std::fmt::Display for AuthenticationEnum { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - match self { - Self::None => write!(f, "none"), - Self::RequireAuthenticated => write!(f, "require_authenticated"), - Self::RequireUnauthenticated => write!(f, "require_unauthenticated"), - Self::RequireSuperuser => write!(f, "require_superuser"), - Self::RequireRedirect => write!(f, "require_redirect"), - Self::RequireOutpost => write!(f, "require_outpost"), - } - } -} - -impl Default for AuthenticationEnum { - fn default() -> AuthenticationEnum { - Self::None - } -} diff --git a/packages/client-rust/src/models/authenticator_attachment_enum.rs b/packages/client-rust/src/models/authenticator_attachment_enum.rs deleted file mode 100644 index 5505c66154..0000000000 --- a/packages/client-rust/src/models/authenticator_attachment_enum.rs +++ /dev/null @@ -1,35 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// -#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] -pub enum AuthenticatorAttachmentEnum { - #[serde(rename = "platform")] - Platform, - #[serde(rename = "cross-platform")] - CrossPlatform, -} - -impl std::fmt::Display for AuthenticatorAttachmentEnum { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - match self { - Self::Platform => write!(f, "platform"), - Self::CrossPlatform => write!(f, "cross-platform"), - } - } -} - -impl Default for AuthenticatorAttachmentEnum { - fn default() -> AuthenticatorAttachmentEnum { - Self::Platform - } -} diff --git a/packages/client-rust/src/models/authenticator_duo_stage.rs b/packages/client-rust/src/models/authenticator_duo_stage.rs deleted file mode 100644 index e592fdb667..0000000000 --- a/packages/client-rust/src/models/authenticator_duo_stage.rs +++ /dev/null @@ -1,84 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// AuthenticatorDuoStage : AuthenticatorDuoStage Serializer -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct AuthenticatorDuoStage { - #[serde(rename = "pk")] - pub pk: uuid::Uuid, - #[serde(rename = "name")] - pub name: String, - /// Get object type so that we know how to edit the object - #[serde(rename = "component")] - pub component: String, - /// Return object's verbose_name - #[serde(rename = "verbose_name")] - pub verbose_name: String, - /// Return object's plural verbose_name - #[serde(rename = "verbose_name_plural")] - pub verbose_name_plural: String, - /// Return internal model name - #[serde(rename = "meta_model_name")] - pub meta_model_name: String, - #[serde(rename = "flow_set")] - pub flow_set: Vec, - /// Flow used by an authenticated user to configure this Stage. If empty, user will not be able - /// to configure this stage. - #[serde( - rename = "configure_flow", - default, - with = "::serde_with::rust::double_option", - skip_serializing_if = "Option::is_none" - )] - pub configure_flow: Option>, - #[serde(rename = "friendly_name", skip_serializing_if = "Option::is_none")] - pub friendly_name: Option, - #[serde(rename = "client_id")] - pub client_id: String, - #[serde(rename = "api_hostname")] - pub api_hostname: String, - #[serde( - rename = "admin_integration_key", - skip_serializing_if = "Option::is_none" - )] - pub admin_integration_key: Option, -} - -impl AuthenticatorDuoStage { - /// AuthenticatorDuoStage Serializer - pub fn new( - pk: uuid::Uuid, - name: String, - component: String, - verbose_name: String, - verbose_name_plural: String, - meta_model_name: String, - flow_set: Vec, - client_id: String, - api_hostname: String, - ) -> AuthenticatorDuoStage { - AuthenticatorDuoStage { - pk, - name, - component, - verbose_name, - verbose_name_plural, - meta_model_name, - flow_set, - configure_flow: None, - friendly_name: None, - client_id, - api_hostname, - admin_integration_key: None, - } - } -} diff --git a/packages/client-rust/src/models/authenticator_duo_stage_device_import_response.rs b/packages/client-rust/src/models/authenticator_duo_stage_device_import_response.rs deleted file mode 100644 index 320d0bda43..0000000000 --- a/packages/client-rust/src/models/authenticator_duo_stage_device_import_response.rs +++ /dev/null @@ -1,25 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct AuthenticatorDuoStageDeviceImportResponse { - #[serde(rename = "count")] - pub count: i32, - #[serde(rename = "error")] - pub error: String, -} - -impl AuthenticatorDuoStageDeviceImportResponse { - pub fn new(count: i32, error: String) -> AuthenticatorDuoStageDeviceImportResponse { - AuthenticatorDuoStageDeviceImportResponse { count, error } - } -} diff --git a/packages/client-rust/src/models/authenticator_duo_stage_manual_device_import_request.rs b/packages/client-rust/src/models/authenticator_duo_stage_manual_device_import_request.rs deleted file mode 100644 index 370e0f3fd4..0000000000 --- a/packages/client-rust/src/models/authenticator_duo_stage_manual_device_import_request.rs +++ /dev/null @@ -1,31 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct AuthenticatorDuoStageManualDeviceImportRequest { - #[serde(rename = "duo_user_id")] - pub duo_user_id: String, - #[serde(rename = "username")] - pub username: String, -} - -impl AuthenticatorDuoStageManualDeviceImportRequest { - pub fn new( - duo_user_id: String, - username: String, - ) -> AuthenticatorDuoStageManualDeviceImportRequest { - AuthenticatorDuoStageManualDeviceImportRequest { - duo_user_id, - username, - } - } -} diff --git a/packages/client-rust/src/models/authenticator_duo_stage_request.rs b/packages/client-rust/src/models/authenticator_duo_stage_request.rs deleted file mode 100644 index 4171cb25b9..0000000000 --- a/packages/client-rust/src/models/authenticator_duo_stage_request.rs +++ /dev/null @@ -1,63 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// AuthenticatorDuoStageRequest : AuthenticatorDuoStage Serializer -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct AuthenticatorDuoStageRequest { - #[serde(rename = "name")] - pub name: String, - /// Flow used by an authenticated user to configure this Stage. If empty, user will not be able - /// to configure this stage. - #[serde( - rename = "configure_flow", - default, - with = "::serde_with::rust::double_option", - skip_serializing_if = "Option::is_none" - )] - pub configure_flow: Option>, - #[serde(rename = "friendly_name", skip_serializing_if = "Option::is_none")] - pub friendly_name: Option, - #[serde(rename = "client_id")] - pub client_id: String, - #[serde(rename = "client_secret")] - pub client_secret: String, - #[serde(rename = "api_hostname")] - pub api_hostname: String, - #[serde( - rename = "admin_integration_key", - skip_serializing_if = "Option::is_none" - )] - pub admin_integration_key: Option, - #[serde(rename = "admin_secret_key", skip_serializing_if = "Option::is_none")] - pub admin_secret_key: Option, -} - -impl AuthenticatorDuoStageRequest { - /// AuthenticatorDuoStage Serializer - pub fn new( - name: String, - client_id: String, - client_secret: String, - api_hostname: String, - ) -> AuthenticatorDuoStageRequest { - AuthenticatorDuoStageRequest { - name, - configure_flow: None, - friendly_name: None, - client_id, - client_secret, - api_hostname, - admin_integration_key: None, - admin_secret_key: None, - } - } -} diff --git a/packages/client-rust/src/models/authenticator_email_stage.rs b/packages/client-rust/src/models/authenticator_email_stage.rs deleted file mode 100644 index 7b4251f9fc..0000000000 --- a/packages/client-rust/src/models/authenticator_email_stage.rs +++ /dev/null @@ -1,112 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// AuthenticatorEmailStage : AuthenticatorEmailStage Serializer -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct AuthenticatorEmailStage { - #[serde(rename = "pk")] - pub pk: uuid::Uuid, - #[serde(rename = "name")] - pub name: String, - /// Get object type so that we know how to edit the object - #[serde(rename = "component")] - pub component: String, - /// Return object's verbose_name - #[serde(rename = "verbose_name")] - pub verbose_name: String, - /// Return object's plural verbose_name - #[serde(rename = "verbose_name_plural")] - pub verbose_name_plural: String, - /// Return internal model name - #[serde(rename = "meta_model_name")] - pub meta_model_name: String, - #[serde(rename = "flow_set")] - pub flow_set: Vec, - /// Flow used by an authenticated user to configure this Stage. If empty, user will not be able - /// to configure this stage. - #[serde( - rename = "configure_flow", - default, - with = "::serde_with::rust::double_option", - skip_serializing_if = "Option::is_none" - )] - pub configure_flow: Option>, - #[serde(rename = "friendly_name", skip_serializing_if = "Option::is_none")] - pub friendly_name: Option, - /// When enabled, global Email connection settings will be used and connection settings below - /// will be ignored. - #[serde( - rename = "use_global_settings", - skip_serializing_if = "Option::is_none" - )] - pub use_global_settings: Option, - #[serde(rename = "host", skip_serializing_if = "Option::is_none")] - pub host: Option, - #[serde(rename = "port", skip_serializing_if = "Option::is_none")] - pub port: Option, - #[serde(rename = "username", skip_serializing_if = "Option::is_none")] - pub username: Option, - #[serde(rename = "password", skip_serializing_if = "Option::is_none")] - pub password: Option, - #[serde(rename = "use_tls", skip_serializing_if = "Option::is_none")] - pub use_tls: Option, - #[serde(rename = "use_ssl", skip_serializing_if = "Option::is_none")] - pub use_ssl: Option, - #[serde(rename = "timeout", skip_serializing_if = "Option::is_none")] - pub timeout: Option, - #[serde(rename = "from_address", skip_serializing_if = "Option::is_none")] - pub from_address: Option, - #[serde(rename = "subject", skip_serializing_if = "Option::is_none")] - pub subject: Option, - /// Time the token sent is valid (Format: hours=3,minutes=17,seconds=300). - #[serde(rename = "token_expiry", skip_serializing_if = "Option::is_none")] - pub token_expiry: Option, - #[serde(rename = "template", skip_serializing_if = "Option::is_none")] - pub template: Option, -} - -impl AuthenticatorEmailStage { - /// AuthenticatorEmailStage Serializer - pub fn new( - pk: uuid::Uuid, - name: String, - component: String, - verbose_name: String, - verbose_name_plural: String, - meta_model_name: String, - flow_set: Vec, - ) -> AuthenticatorEmailStage { - AuthenticatorEmailStage { - pk, - name, - component, - verbose_name, - verbose_name_plural, - meta_model_name, - flow_set, - configure_flow: None, - friendly_name: None, - use_global_settings: None, - host: None, - port: None, - username: None, - password: None, - use_tls: None, - use_ssl: None, - timeout: None, - from_address: None, - subject: None, - token_expiry: None, - template: None, - } - } -} diff --git a/packages/client-rust/src/models/authenticator_email_stage_request.rs b/packages/client-rust/src/models/authenticator_email_stage_request.rs deleted file mode 100644 index e287eb32e4..0000000000 --- a/packages/client-rust/src/models/authenticator_email_stage_request.rs +++ /dev/null @@ -1,82 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// AuthenticatorEmailStageRequest : AuthenticatorEmailStage Serializer -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct AuthenticatorEmailStageRequest { - #[serde(rename = "name")] - pub name: String, - /// Flow used by an authenticated user to configure this Stage. If empty, user will not be able - /// to configure this stage. - #[serde( - rename = "configure_flow", - default, - with = "::serde_with::rust::double_option", - skip_serializing_if = "Option::is_none" - )] - pub configure_flow: Option>, - #[serde(rename = "friendly_name", skip_serializing_if = "Option::is_none")] - pub friendly_name: Option, - /// When enabled, global Email connection settings will be used and connection settings below - /// will be ignored. - #[serde( - rename = "use_global_settings", - skip_serializing_if = "Option::is_none" - )] - pub use_global_settings: Option, - #[serde(rename = "host", skip_serializing_if = "Option::is_none")] - pub host: Option, - #[serde(rename = "port", skip_serializing_if = "Option::is_none")] - pub port: Option, - #[serde(rename = "username", skip_serializing_if = "Option::is_none")] - pub username: Option, - #[serde(rename = "password", skip_serializing_if = "Option::is_none")] - pub password: Option, - #[serde(rename = "use_tls", skip_serializing_if = "Option::is_none")] - pub use_tls: Option, - #[serde(rename = "use_ssl", skip_serializing_if = "Option::is_none")] - pub use_ssl: Option, - #[serde(rename = "timeout", skip_serializing_if = "Option::is_none")] - pub timeout: Option, - #[serde(rename = "from_address", skip_serializing_if = "Option::is_none")] - pub from_address: Option, - #[serde(rename = "subject", skip_serializing_if = "Option::is_none")] - pub subject: Option, - /// Time the token sent is valid (Format: hours=3,minutes=17,seconds=300). - #[serde(rename = "token_expiry", skip_serializing_if = "Option::is_none")] - pub token_expiry: Option, - #[serde(rename = "template", skip_serializing_if = "Option::is_none")] - pub template: Option, -} - -impl AuthenticatorEmailStageRequest { - /// AuthenticatorEmailStage Serializer - pub fn new(name: String) -> AuthenticatorEmailStageRequest { - AuthenticatorEmailStageRequest { - name, - configure_flow: None, - friendly_name: None, - use_global_settings: None, - host: None, - port: None, - username: None, - password: None, - use_tls: None, - use_ssl: None, - timeout: None, - from_address: None, - subject: None, - token_expiry: None, - template: None, - } - } -} diff --git a/packages/client-rust/src/models/authenticator_endpoint_gdtc_stage.rs b/packages/client-rust/src/models/authenticator_endpoint_gdtc_stage.rs deleted file mode 100644 index 6dc1061c2b..0000000000 --- a/packages/client-rust/src/models/authenticator_endpoint_gdtc_stage.rs +++ /dev/null @@ -1,74 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// AuthenticatorEndpointGdtcStage : AuthenticatorEndpointGDTCStage Serializer -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct AuthenticatorEndpointGdtcStage { - #[serde(rename = "pk")] - pub pk: uuid::Uuid, - #[serde(rename = "name")] - pub name: String, - /// Get object type so that we know how to edit the object - #[serde(rename = "component")] - pub component: String, - /// Return object's verbose_name - #[serde(rename = "verbose_name")] - pub verbose_name: String, - /// Return object's plural verbose_name - #[serde(rename = "verbose_name_plural")] - pub verbose_name_plural: String, - /// Return internal model name - #[serde(rename = "meta_model_name")] - pub meta_model_name: String, - #[serde(rename = "flow_set")] - pub flow_set: Vec, - /// Flow used by an authenticated user to configure this Stage. If empty, user will not be able - /// to configure this stage. - #[serde( - rename = "configure_flow", - default, - with = "::serde_with::rust::double_option", - skip_serializing_if = "Option::is_none" - )] - pub configure_flow: Option>, - #[serde(rename = "friendly_name", skip_serializing_if = "Option::is_none")] - pub friendly_name: Option, - #[serde(rename = "credentials")] - pub credentials: std::collections::HashMap, -} - -impl AuthenticatorEndpointGdtcStage { - /// AuthenticatorEndpointGDTCStage Serializer - pub fn new( - pk: uuid::Uuid, - name: String, - component: String, - verbose_name: String, - verbose_name_plural: String, - meta_model_name: String, - flow_set: Vec, - credentials: std::collections::HashMap, - ) -> AuthenticatorEndpointGdtcStage { - AuthenticatorEndpointGdtcStage { - pk, - name, - component, - verbose_name, - verbose_name_plural, - meta_model_name, - flow_set, - configure_flow: None, - friendly_name: None, - credentials, - } - } -} diff --git a/packages/client-rust/src/models/authenticator_endpoint_gdtc_stage_request.rs b/packages/client-rust/src/models/authenticator_endpoint_gdtc_stage_request.rs deleted file mode 100644 index f45cfdc0a8..0000000000 --- a/packages/client-rust/src/models/authenticator_endpoint_gdtc_stage_request.rs +++ /dev/null @@ -1,46 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// AuthenticatorEndpointGdtcStageRequest : AuthenticatorEndpointGDTCStage Serializer -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct AuthenticatorEndpointGdtcStageRequest { - #[serde(rename = "name")] - pub name: String, - /// Flow used by an authenticated user to configure this Stage. If empty, user will not be able - /// to configure this stage. - #[serde( - rename = "configure_flow", - default, - with = "::serde_with::rust::double_option", - skip_serializing_if = "Option::is_none" - )] - pub configure_flow: Option>, - #[serde(rename = "friendly_name", skip_serializing_if = "Option::is_none")] - pub friendly_name: Option, - #[serde(rename = "credentials")] - pub credentials: std::collections::HashMap, -} - -impl AuthenticatorEndpointGdtcStageRequest { - /// AuthenticatorEndpointGDTCStage Serializer - pub fn new( - name: String, - credentials: std::collections::HashMap, - ) -> AuthenticatorEndpointGdtcStageRequest { - AuthenticatorEndpointGdtcStageRequest { - name, - configure_flow: None, - friendly_name: None, - credentials, - } - } -} diff --git a/packages/client-rust/src/models/authenticator_sms_stage.rs b/packages/client-rust/src/models/authenticator_sms_stage.rs deleted file mode 100644 index 6767e9a83f..0000000000 --- a/packages/client-rust/src/models/authenticator_sms_stage.rs +++ /dev/null @@ -1,107 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// AuthenticatorSmsStage : AuthenticatorSMSStage Serializer -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct AuthenticatorSmsStage { - #[serde(rename = "pk")] - pub pk: uuid::Uuid, - #[serde(rename = "name")] - pub name: String, - /// Get object type so that we know how to edit the object - #[serde(rename = "component")] - pub component: String, - /// Return object's verbose_name - #[serde(rename = "verbose_name")] - pub verbose_name: String, - /// Return object's plural verbose_name - #[serde(rename = "verbose_name_plural")] - pub verbose_name_plural: String, - /// Return internal model name - #[serde(rename = "meta_model_name")] - pub meta_model_name: String, - #[serde(rename = "flow_set")] - pub flow_set: Vec, - /// Flow used by an authenticated user to configure this Stage. If empty, user will not be able - /// to configure this stage. - #[serde( - rename = "configure_flow", - default, - with = "::serde_with::rust::double_option", - skip_serializing_if = "Option::is_none" - )] - pub configure_flow: Option>, - #[serde(rename = "friendly_name", skip_serializing_if = "Option::is_none")] - pub friendly_name: Option, - #[serde(rename = "provider")] - pub provider: models::ProviderEnum, - #[serde(rename = "from_number")] - pub from_number: String, - #[serde(rename = "account_sid")] - pub account_sid: String, - #[serde(rename = "auth")] - pub auth: String, - #[serde(rename = "auth_password", skip_serializing_if = "Option::is_none")] - pub auth_password: Option, - #[serde(rename = "auth_type", skip_serializing_if = "Option::is_none")] - pub auth_type: Option, - /// 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. - #[serde(rename = "verify_only", skip_serializing_if = "Option::is_none")] - pub verify_only: Option, - /// Optionally modify the payload being sent to custom providers. - #[serde( - rename = "mapping", - default, - with = "::serde_with::rust::double_option", - skip_serializing_if = "Option::is_none" - )] - pub mapping: Option>, -} - -impl AuthenticatorSmsStage { - /// AuthenticatorSMSStage Serializer - pub fn new( - pk: uuid::Uuid, - name: String, - component: String, - verbose_name: String, - verbose_name_plural: String, - meta_model_name: String, - flow_set: Vec, - provider: models::ProviderEnum, - from_number: String, - account_sid: String, - auth: String, - ) -> AuthenticatorSmsStage { - AuthenticatorSmsStage { - pk, - name, - component, - verbose_name, - verbose_name_plural, - meta_model_name, - flow_set, - configure_flow: None, - friendly_name: None, - provider, - from_number, - account_sid, - auth, - auth_password: None, - auth_type: None, - verify_only: None, - mapping: None, - } - } -} diff --git a/packages/client-rust/src/models/authenticator_sms_stage_request.rs b/packages/client-rust/src/models/authenticator_sms_stage_request.rs deleted file mode 100644 index 892ec7f1dd..0000000000 --- a/packages/client-rust/src/models/authenticator_sms_stage_request.rs +++ /dev/null @@ -1,79 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// AuthenticatorSmsStageRequest : AuthenticatorSMSStage Serializer -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct AuthenticatorSmsStageRequest { - #[serde(rename = "name")] - pub name: String, - /// Flow used by an authenticated user to configure this Stage. If empty, user will not be able - /// to configure this stage. - #[serde( - rename = "configure_flow", - default, - with = "::serde_with::rust::double_option", - skip_serializing_if = "Option::is_none" - )] - pub configure_flow: Option>, - #[serde(rename = "friendly_name", skip_serializing_if = "Option::is_none")] - pub friendly_name: Option, - #[serde(rename = "provider")] - pub provider: models::ProviderEnum, - #[serde(rename = "from_number")] - pub from_number: String, - #[serde(rename = "account_sid")] - pub account_sid: String, - #[serde(rename = "auth")] - pub auth: String, - #[serde(rename = "auth_password", skip_serializing_if = "Option::is_none")] - pub auth_password: Option, - #[serde(rename = "auth_type", skip_serializing_if = "Option::is_none")] - pub auth_type: Option, - /// 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. - #[serde(rename = "verify_only", skip_serializing_if = "Option::is_none")] - pub verify_only: Option, - /// Optionally modify the payload being sent to custom providers. - #[serde( - rename = "mapping", - default, - with = "::serde_with::rust::double_option", - skip_serializing_if = "Option::is_none" - )] - pub mapping: Option>, -} - -impl AuthenticatorSmsStageRequest { - /// AuthenticatorSMSStage Serializer - pub fn new( - name: String, - provider: models::ProviderEnum, - from_number: String, - account_sid: String, - auth: String, - ) -> AuthenticatorSmsStageRequest { - AuthenticatorSmsStageRequest { - name, - configure_flow: None, - friendly_name: None, - provider, - from_number, - account_sid, - auth, - auth_password: None, - auth_type: None, - verify_only: None, - mapping: None, - } - } -} diff --git a/packages/client-rust/src/models/authenticator_static_stage.rs b/packages/client-rust/src/models/authenticator_static_stage.rs deleted file mode 100644 index e42cf29805..0000000000 --- a/packages/client-rust/src/models/authenticator_static_stage.rs +++ /dev/null @@ -1,76 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// AuthenticatorStaticStage : AuthenticatorStaticStage Serializer -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct AuthenticatorStaticStage { - #[serde(rename = "pk")] - pub pk: uuid::Uuid, - #[serde(rename = "name")] - pub name: String, - /// Get object type so that we know how to edit the object - #[serde(rename = "component")] - pub component: String, - /// Return object's verbose_name - #[serde(rename = "verbose_name")] - pub verbose_name: String, - /// Return object's plural verbose_name - #[serde(rename = "verbose_name_plural")] - pub verbose_name_plural: String, - /// Return internal model name - #[serde(rename = "meta_model_name")] - pub meta_model_name: String, - #[serde(rename = "flow_set")] - pub flow_set: Vec, - /// Flow used by an authenticated user to configure this Stage. If empty, user will not be able - /// to configure this stage. - #[serde( - rename = "configure_flow", - default, - with = "::serde_with::rust::double_option", - skip_serializing_if = "Option::is_none" - )] - pub configure_flow: Option>, - #[serde(rename = "friendly_name", skip_serializing_if = "Option::is_none")] - pub friendly_name: Option, - #[serde(rename = "token_count", skip_serializing_if = "Option::is_none")] - pub token_count: Option, - #[serde(rename = "token_length", skip_serializing_if = "Option::is_none")] - pub token_length: Option, -} - -impl AuthenticatorStaticStage { - /// AuthenticatorStaticStage Serializer - pub fn new( - pk: uuid::Uuid, - name: String, - component: String, - verbose_name: String, - verbose_name_plural: String, - meta_model_name: String, - flow_set: Vec, - ) -> AuthenticatorStaticStage { - AuthenticatorStaticStage { - pk, - name, - component, - verbose_name, - verbose_name_plural, - meta_model_name, - flow_set, - configure_flow: None, - friendly_name: None, - token_count: None, - token_length: None, - } - } -} diff --git a/packages/client-rust/src/models/authenticator_static_stage_request.rs b/packages/client-rust/src/models/authenticator_static_stage_request.rs deleted file mode 100644 index 2fe68ba96c..0000000000 --- a/packages/client-rust/src/models/authenticator_static_stage_request.rs +++ /dev/null @@ -1,46 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// AuthenticatorStaticStageRequest : AuthenticatorStaticStage Serializer -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct AuthenticatorStaticStageRequest { - #[serde(rename = "name")] - pub name: String, - /// Flow used by an authenticated user to configure this Stage. If empty, user will not be able - /// to configure this stage. - #[serde( - rename = "configure_flow", - default, - with = "::serde_with::rust::double_option", - skip_serializing_if = "Option::is_none" - )] - pub configure_flow: Option>, - #[serde(rename = "friendly_name", skip_serializing_if = "Option::is_none")] - pub friendly_name: Option, - #[serde(rename = "token_count", skip_serializing_if = "Option::is_none")] - pub token_count: Option, - #[serde(rename = "token_length", skip_serializing_if = "Option::is_none")] - pub token_length: Option, -} - -impl AuthenticatorStaticStageRequest { - /// AuthenticatorStaticStage Serializer - pub fn new(name: String) -> AuthenticatorStaticStageRequest { - AuthenticatorStaticStageRequest { - name, - configure_flow: None, - friendly_name: None, - token_count: None, - token_length: None, - } - } -} diff --git a/packages/client-rust/src/models/authenticator_totp_stage.rs b/packages/client-rust/src/models/authenticator_totp_stage.rs deleted file mode 100644 index 52798ec367..0000000000 --- a/packages/client-rust/src/models/authenticator_totp_stage.rs +++ /dev/null @@ -1,74 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// AuthenticatorTotpStage : AuthenticatorTOTPStage Serializer -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct AuthenticatorTotpStage { - #[serde(rename = "pk")] - pub pk: uuid::Uuid, - #[serde(rename = "name")] - pub name: String, - /// Get object type so that we know how to edit the object - #[serde(rename = "component")] - pub component: String, - /// Return object's verbose_name - #[serde(rename = "verbose_name")] - pub verbose_name: String, - /// Return object's plural verbose_name - #[serde(rename = "verbose_name_plural")] - pub verbose_name_plural: String, - /// Return internal model name - #[serde(rename = "meta_model_name")] - pub meta_model_name: String, - #[serde(rename = "flow_set")] - pub flow_set: Vec, - /// Flow used by an authenticated user to configure this Stage. If empty, user will not be able - /// to configure this stage. - #[serde( - rename = "configure_flow", - default, - with = "::serde_with::rust::double_option", - skip_serializing_if = "Option::is_none" - )] - pub configure_flow: Option>, - #[serde(rename = "friendly_name", skip_serializing_if = "Option::is_none")] - pub friendly_name: Option, - #[serde(rename = "digits")] - pub digits: models::DigitsEnum, -} - -impl AuthenticatorTotpStage { - /// AuthenticatorTOTPStage Serializer - pub fn new( - pk: uuid::Uuid, - name: String, - component: String, - verbose_name: String, - verbose_name_plural: String, - meta_model_name: String, - flow_set: Vec, - digits: models::DigitsEnum, - ) -> AuthenticatorTotpStage { - AuthenticatorTotpStage { - pk, - name, - component, - verbose_name, - verbose_name_plural, - meta_model_name, - flow_set, - configure_flow: None, - friendly_name: None, - digits, - } - } -} diff --git a/packages/client-rust/src/models/authenticator_totp_stage_request.rs b/packages/client-rust/src/models/authenticator_totp_stage_request.rs deleted file mode 100644 index 58ef6b2bff..0000000000 --- a/packages/client-rust/src/models/authenticator_totp_stage_request.rs +++ /dev/null @@ -1,43 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// AuthenticatorTotpStageRequest : AuthenticatorTOTPStage Serializer -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct AuthenticatorTotpStageRequest { - #[serde(rename = "name")] - pub name: String, - /// Flow used by an authenticated user to configure this Stage. If empty, user will not be able - /// to configure this stage. - #[serde( - rename = "configure_flow", - default, - with = "::serde_with::rust::double_option", - skip_serializing_if = "Option::is_none" - )] - pub configure_flow: Option>, - #[serde(rename = "friendly_name", skip_serializing_if = "Option::is_none")] - pub friendly_name: Option, - #[serde(rename = "digits")] - pub digits: models::DigitsEnum, -} - -impl AuthenticatorTotpStageRequest { - /// AuthenticatorTOTPStage Serializer - pub fn new(name: String, digits: models::DigitsEnum) -> AuthenticatorTotpStageRequest { - AuthenticatorTotpStageRequest { - name, - configure_flow: None, - friendly_name: None, - digits, - } - } -} diff --git a/packages/client-rust/src/models/authenticator_validate_stage.rs b/packages/client-rust/src/models/authenticator_validate_stage.rs deleted file mode 100644 index 9e5a39db64..0000000000 --- a/packages/client-rust/src/models/authenticator_validate_stage.rs +++ /dev/null @@ -1,102 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// AuthenticatorValidateStage : AuthenticatorValidateStage Serializer -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct AuthenticatorValidateStage { - #[serde(rename = "pk")] - pub pk: uuid::Uuid, - #[serde(rename = "name")] - pub name: String, - /// Get object type so that we know how to edit the object - #[serde(rename = "component")] - pub component: String, - /// Return object's verbose_name - #[serde(rename = "verbose_name")] - pub verbose_name: String, - /// Return object's plural verbose_name - #[serde(rename = "verbose_name_plural")] - pub verbose_name_plural: String, - /// Return internal model name - #[serde(rename = "meta_model_name")] - pub meta_model_name: String, - #[serde(rename = "flow_set")] - pub flow_set: Vec, - #[serde( - rename = "not_configured_action", - skip_serializing_if = "Option::is_none" - )] - pub not_configured_action: Option, - /// Device classes which can be used to authenticate - #[serde(rename = "device_classes", skip_serializing_if = "Option::is_none")] - pub device_classes: Option>, - /// Stages used to configure Authenticator when user doesn't have any compatible devices. After - /// this configuration Stage passes, the user is not prompted again. - #[serde( - rename = "configuration_stages", - skip_serializing_if = "Option::is_none" - )] - pub configuration_stages: Option>, - /// If any of the user's device has been used within this threshold, this stage will be skipped - #[serde( - rename = "last_auth_threshold", - skip_serializing_if = "Option::is_none" - )] - pub last_auth_threshold: Option, - /// Enforce user verification for WebAuthn devices. - #[serde( - rename = "webauthn_user_verification", - skip_serializing_if = "Option::is_none" - )] - pub webauthn_user_verification: Option, - #[serde(rename = "webauthn_hints", skip_serializing_if = "Option::is_none")] - pub webauthn_hints: Option>, - #[serde( - rename = "webauthn_allowed_device_types", - skip_serializing_if = "Option::is_none" - )] - pub webauthn_allowed_device_types: Option>, - #[serde(rename = "webauthn_allowed_device_types_obj")] - pub webauthn_allowed_device_types_obj: Vec, -} - -impl AuthenticatorValidateStage { - /// AuthenticatorValidateStage Serializer - pub fn new( - pk: uuid::Uuid, - name: String, - component: String, - verbose_name: String, - verbose_name_plural: String, - meta_model_name: String, - flow_set: Vec, - webauthn_allowed_device_types_obj: Vec, - ) -> AuthenticatorValidateStage { - AuthenticatorValidateStage { - pk, - name, - component, - verbose_name, - verbose_name_plural, - meta_model_name, - flow_set, - not_configured_action: None, - device_classes: None, - configuration_stages: None, - last_auth_threshold: None, - webauthn_user_verification: None, - webauthn_hints: None, - webauthn_allowed_device_types: None, - webauthn_allowed_device_types_obj, - } - } -} diff --git a/packages/client-rust/src/models/authenticator_validate_stage_request.rs b/packages/client-rust/src/models/authenticator_validate_stage_request.rs deleted file mode 100644 index 7ad4877379..0000000000 --- a/packages/client-rust/src/models/authenticator_validate_stage_request.rs +++ /dev/null @@ -1,68 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// AuthenticatorValidateStageRequest : AuthenticatorValidateStage Serializer -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct AuthenticatorValidateStageRequest { - #[serde(rename = "name")] - pub name: String, - #[serde( - rename = "not_configured_action", - skip_serializing_if = "Option::is_none" - )] - pub not_configured_action: Option, - /// Device classes which can be used to authenticate - #[serde(rename = "device_classes", skip_serializing_if = "Option::is_none")] - pub device_classes: Option>, - /// Stages used to configure Authenticator when user doesn't have any compatible devices. After - /// this configuration Stage passes, the user is not prompted again. - #[serde( - rename = "configuration_stages", - skip_serializing_if = "Option::is_none" - )] - pub configuration_stages: Option>, - /// If any of the user's device has been used within this threshold, this stage will be skipped - #[serde( - rename = "last_auth_threshold", - skip_serializing_if = "Option::is_none" - )] - pub last_auth_threshold: Option, - /// Enforce user verification for WebAuthn devices. - #[serde( - rename = "webauthn_user_verification", - skip_serializing_if = "Option::is_none" - )] - pub webauthn_user_verification: Option, - #[serde(rename = "webauthn_hints", skip_serializing_if = "Option::is_none")] - pub webauthn_hints: Option>, - #[serde( - rename = "webauthn_allowed_device_types", - skip_serializing_if = "Option::is_none" - )] - pub webauthn_allowed_device_types: Option>, -} - -impl AuthenticatorValidateStageRequest { - /// AuthenticatorValidateStage Serializer - pub fn new(name: String) -> AuthenticatorValidateStageRequest { - AuthenticatorValidateStageRequest { - name, - not_configured_action: None, - device_classes: None, - configuration_stages: None, - last_auth_threshold: None, - webauthn_user_verification: None, - webauthn_hints: None, - webauthn_allowed_device_types: None, - } - } -} diff --git a/packages/client-rust/src/models/authenticator_web_authn_stage.rs b/packages/client-rust/src/models/authenticator_web_authn_stage.rs deleted file mode 100644 index 46ed9034a2..0000000000 --- a/packages/client-rust/src/models/authenticator_web_authn_stage.rs +++ /dev/null @@ -1,110 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// AuthenticatorWebAuthnStage : AuthenticatorWebAuthnStage Serializer -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct AuthenticatorWebAuthnStage { - #[serde(rename = "pk")] - pub pk: uuid::Uuid, - #[serde(rename = "name")] - pub name: String, - /// Get object type so that we know how to edit the object - #[serde(rename = "component")] - pub component: String, - /// Return object's verbose_name - #[serde(rename = "verbose_name")] - pub verbose_name: String, - /// Return object's plural verbose_name - #[serde(rename = "verbose_name_plural")] - pub verbose_name_plural: String, - /// Return internal model name - #[serde(rename = "meta_model_name")] - pub meta_model_name: String, - #[serde(rename = "flow_set")] - pub flow_set: Vec, - /// Flow used by an authenticated user to configure this Stage. If empty, user will not be able - /// to configure this stage. - #[serde( - rename = "configure_flow", - default, - with = "::serde_with::rust::double_option", - skip_serializing_if = "Option::is_none" - )] - pub configure_flow: Option>, - #[serde(rename = "friendly_name", skip_serializing_if = "Option::is_none")] - pub friendly_name: Option, - #[serde(rename = "user_verification", skip_serializing_if = "Option::is_none")] - pub user_verification: Option, - #[serde( - rename = "authenticator_attachment", - default, - with = "::serde_with::rust::double_option", - skip_serializing_if = "Option::is_none" - )] - pub authenticator_attachment: Option>, - #[serde( - rename = "resident_key_requirement", - skip_serializing_if = "Option::is_none" - )] - pub resident_key_requirement: Option, - #[serde(rename = "hints", skip_serializing_if = "Option::is_none")] - pub hints: Option>, - #[serde( - rename = "device_type_restrictions", - skip_serializing_if = "Option::is_none" - )] - pub device_type_restrictions: Option>, - #[serde(rename = "device_type_restrictions_obj")] - pub device_type_restrictions_obj: Vec, - /// When enabled, a given device can only be registered once. - #[serde( - rename = "prevent_duplicate_devices", - skip_serializing_if = "Option::is_none" - )] - pub prevent_duplicate_devices: Option, - #[serde(rename = "max_attempts", skip_serializing_if = "Option::is_none")] - pub max_attempts: Option, -} - -impl AuthenticatorWebAuthnStage { - /// AuthenticatorWebAuthnStage Serializer - pub fn new( - pk: uuid::Uuid, - name: String, - component: String, - verbose_name: String, - verbose_name_plural: String, - meta_model_name: String, - flow_set: Vec, - device_type_restrictions_obj: Vec, - ) -> AuthenticatorWebAuthnStage { - AuthenticatorWebAuthnStage { - pk, - name, - component, - verbose_name, - verbose_name_plural, - meta_model_name, - flow_set, - configure_flow: None, - friendly_name: None, - user_verification: None, - authenticator_attachment: None, - resident_key_requirement: None, - hints: None, - device_type_restrictions: None, - device_type_restrictions_obj, - prevent_duplicate_devices: None, - max_attempts: None, - } - } -} diff --git a/packages/client-rust/src/models/authenticator_web_authn_stage_request.rs b/packages/client-rust/src/models/authenticator_web_authn_stage_request.rs deleted file mode 100644 index acdc1e48e6..0000000000 --- a/packages/client-rust/src/models/authenticator_web_authn_stage_request.rs +++ /dev/null @@ -1,76 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// AuthenticatorWebAuthnStageRequest : AuthenticatorWebAuthnStage Serializer -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct AuthenticatorWebAuthnStageRequest { - #[serde(rename = "name")] - pub name: String, - /// Flow used by an authenticated user to configure this Stage. If empty, user will not be able - /// to configure this stage. - #[serde( - rename = "configure_flow", - default, - with = "::serde_with::rust::double_option", - skip_serializing_if = "Option::is_none" - )] - pub configure_flow: Option>, - #[serde(rename = "friendly_name", skip_serializing_if = "Option::is_none")] - pub friendly_name: Option, - #[serde(rename = "user_verification", skip_serializing_if = "Option::is_none")] - pub user_verification: Option, - #[serde( - rename = "authenticator_attachment", - default, - with = "::serde_with::rust::double_option", - skip_serializing_if = "Option::is_none" - )] - pub authenticator_attachment: Option>, - #[serde( - rename = "resident_key_requirement", - skip_serializing_if = "Option::is_none" - )] - pub resident_key_requirement: Option, - #[serde(rename = "hints", skip_serializing_if = "Option::is_none")] - pub hints: Option>, - #[serde( - rename = "device_type_restrictions", - skip_serializing_if = "Option::is_none" - )] - pub device_type_restrictions: Option>, - /// When enabled, a given device can only be registered once. - #[serde( - rename = "prevent_duplicate_devices", - skip_serializing_if = "Option::is_none" - )] - pub prevent_duplicate_devices: Option, - #[serde(rename = "max_attempts", skip_serializing_if = "Option::is_none")] - pub max_attempts: Option, -} - -impl AuthenticatorWebAuthnStageRequest { - /// AuthenticatorWebAuthnStage Serializer - pub fn new(name: String) -> AuthenticatorWebAuthnStageRequest { - AuthenticatorWebAuthnStageRequest { - name, - configure_flow: None, - friendly_name: None, - user_verification: None, - authenticator_attachment: None, - resident_key_requirement: None, - hints: None, - device_type_restrictions: None, - prevent_duplicate_devices: None, - max_attempts: None, - } - } -} diff --git a/packages/client-rust/src/models/authorization_code_auth_method_enum.rs b/packages/client-rust/src/models/authorization_code_auth_method_enum.rs deleted file mode 100644 index 0dd251f099..0000000000 --- a/packages/client-rust/src/models/authorization_code_auth_method_enum.rs +++ /dev/null @@ -1,35 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// -#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] -pub enum AuthorizationCodeAuthMethodEnum { - #[serde(rename = "basic_auth")] - BasicAuth, - #[serde(rename = "post_body")] - PostBody, -} - -impl std::fmt::Display for AuthorizationCodeAuthMethodEnum { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - match self { - Self::BasicAuth => write!(f, "basic_auth"), - Self::PostBody => write!(f, "post_body"), - } - } -} - -impl Default for AuthorizationCodeAuthMethodEnum { - fn default() -> AuthorizationCodeAuthMethodEnum { - Self::BasicAuth - } -} diff --git a/packages/client-rust/src/models/backends_enum.rs b/packages/client-rust/src/models/backends_enum.rs deleted file mode 100644 index 855708c560..0000000000 --- a/packages/client-rust/src/models/backends_enum.rs +++ /dev/null @@ -1,47 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// -#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] -pub enum BackendsEnum { - #[serde(rename = "authentik.core.auth.InbuiltBackend")] - AuthentikCoreAuthInbuiltBackend, - #[serde(rename = "authentik.core.auth.TokenBackend")] - AuthentikCoreAuthTokenBackend, - #[serde(rename = "authentik.sources.ldap.auth.LDAPBackend")] - AuthentikSourcesLdapAuthLdapBackend, - #[serde(rename = "authentik.sources.kerberos.auth.KerberosBackend")] - AuthentikSourcesKerberosAuthKerberosBackend, -} - -impl std::fmt::Display for BackendsEnum { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - match self { - Self::AuthentikCoreAuthInbuiltBackend => { - write!(f, "authentik.core.auth.InbuiltBackend") - } - Self::AuthentikCoreAuthTokenBackend => write!(f, "authentik.core.auth.TokenBackend"), - Self::AuthentikSourcesLdapAuthLdapBackend => { - write!(f, "authentik.sources.ldap.auth.LDAPBackend") - } - Self::AuthentikSourcesKerberosAuthKerberosBackend => { - write!(f, "authentik.sources.kerberos.auth.KerberosBackend") - } - } - } -} - -impl Default for BackendsEnum { - fn default() -> BackendsEnum { - Self::AuthentikCoreAuthInbuiltBackend - } -} diff --git a/packages/client-rust/src/models/binding_type_enum.rs b/packages/client-rust/src/models/binding_type_enum.rs deleted file mode 100644 index a5c696e400..0000000000 --- a/packages/client-rust/src/models/binding_type_enum.rs +++ /dev/null @@ -1,38 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// -#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] -pub enum BindingTypeEnum { - #[serde(rename = "REDIRECT")] - Redirect, - #[serde(rename = "POST")] - Post, - #[serde(rename = "POST_AUTO")] - PostAuto, -} - -impl std::fmt::Display for BindingTypeEnum { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - match self { - Self::Redirect => write!(f, "REDIRECT"), - Self::Post => write!(f, "POST"), - Self::PostAuto => write!(f, "POST_AUTO"), - } - } -} - -impl Default for BindingTypeEnum { - fn default() -> BindingTypeEnum { - Self::Redirect - } -} diff --git a/packages/client-rust/src/models/blueprint_file.rs b/packages/client-rust/src/models/blueprint_file.rs deleted file mode 100644 index 849d505582..0000000000 --- a/packages/client-rust/src/models/blueprint_file.rs +++ /dev/null @@ -1,39 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct BlueprintFile { - #[serde(rename = "path")] - pub path: String, - #[serde(rename = "last_m")] - pub last_m: String, - #[serde(rename = "hash")] - pub hash: String, - #[serde(rename = "meta")] - pub meta: models::Metadata, -} - -impl BlueprintFile { - pub fn new( - path: String, - last_m: String, - hash: String, - meta: models::Metadata, - ) -> BlueprintFile { - BlueprintFile { - path, - last_m, - hash, - meta, - } - } -} diff --git a/packages/client-rust/src/models/blueprint_import_result.rs b/packages/client-rust/src/models/blueprint_import_result.rs deleted file mode 100644 index f7b6809bd1..0000000000 --- a/packages/client-rust/src/models/blueprint_import_result.rs +++ /dev/null @@ -1,27 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// BlueprintImportResult : Logs of an attempted blueprint import -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct BlueprintImportResult { - #[serde(rename = "logs")] - pub logs: Vec, - #[serde(rename = "success")] - pub success: bool, -} - -impl BlueprintImportResult { - /// Logs of an attempted blueprint import - pub fn new(logs: Vec, success: bool) -> BlueprintImportResult { - BlueprintImportResult { logs, success } - } -} diff --git a/packages/client-rust/src/models/blueprint_instance.rs b/packages/client-rust/src/models/blueprint_instance.rs deleted file mode 100644 index 23eae1f696..0000000000 --- a/packages/client-rust/src/models/blueprint_instance.rs +++ /dev/null @@ -1,65 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// BlueprintInstance : Info about a single blueprint instance file -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct BlueprintInstance { - #[serde(rename = "pk")] - pub pk: uuid::Uuid, - #[serde(rename = "name")] - pub name: String, - #[serde(rename = "path", skip_serializing_if = "Option::is_none")] - pub path: Option, - #[serde(rename = "context", skip_serializing_if = "Option::is_none")] - pub context: Option>, - #[serde(rename = "last_applied")] - pub last_applied: String, - #[serde(rename = "last_applied_hash")] - pub last_applied_hash: String, - #[serde(rename = "status")] - pub status: models::BlueprintInstanceStatusEnum, - #[serde(rename = "enabled", skip_serializing_if = "Option::is_none")] - pub enabled: Option, - #[serde(rename = "managed_models")] - pub managed_models: Vec, - #[serde(rename = "metadata")] - pub metadata: std::collections::HashMap, - #[serde(rename = "content", skip_serializing_if = "Option::is_none")] - pub content: Option, -} - -impl BlueprintInstance { - /// Info about a single blueprint instance file - pub fn new( - pk: uuid::Uuid, - name: String, - last_applied: String, - last_applied_hash: String, - status: models::BlueprintInstanceStatusEnum, - managed_models: Vec, - metadata: std::collections::HashMap, - ) -> BlueprintInstance { - BlueprintInstance { - pk, - name, - path: None, - context: None, - last_applied, - last_applied_hash, - status, - enabled: None, - managed_models, - metadata, - content: None, - } - } -} diff --git a/packages/client-rust/src/models/blueprint_instance_request.rs b/packages/client-rust/src/models/blueprint_instance_request.rs deleted file mode 100644 index 6cf0057487..0000000000 --- a/packages/client-rust/src/models/blueprint_instance_request.rs +++ /dev/null @@ -1,39 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// BlueprintInstanceRequest : Info about a single blueprint instance file -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct BlueprintInstanceRequest { - #[serde(rename = "name")] - pub name: String, - #[serde(rename = "path", skip_serializing_if = "Option::is_none")] - pub path: Option, - #[serde(rename = "context", skip_serializing_if = "Option::is_none")] - pub context: Option>, - #[serde(rename = "enabled", skip_serializing_if = "Option::is_none")] - pub enabled: Option, - #[serde(rename = "content", skip_serializing_if = "Option::is_none")] - pub content: Option, -} - -impl BlueprintInstanceRequest { - /// Info about a single blueprint instance file - pub fn new(name: String) -> BlueprintInstanceRequest { - BlueprintInstanceRequest { - name, - path: None, - context: None, - enabled: None, - content: None, - } - } -} diff --git a/packages/client-rust/src/models/blueprint_instance_status_enum.rs b/packages/client-rust/src/models/blueprint_instance_status_enum.rs deleted file mode 100644 index be04e7583b..0000000000 --- a/packages/client-rust/src/models/blueprint_instance_status_enum.rs +++ /dev/null @@ -1,44 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// -#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] -pub enum BlueprintInstanceStatusEnum { - #[serde(rename = "successful")] - Successful, - #[serde(rename = "warning")] - Warning, - #[serde(rename = "error")] - Error, - #[serde(rename = "orphaned")] - Orphaned, - #[serde(rename = "unknown")] - Unknown, -} - -impl std::fmt::Display for BlueprintInstanceStatusEnum { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - match self { - Self::Successful => write!(f, "successful"), - Self::Warning => write!(f, "warning"), - Self::Error => write!(f, "error"), - Self::Orphaned => write!(f, "orphaned"), - Self::Unknown => write!(f, "unknown"), - } - } -} - -impl Default for BlueprintInstanceStatusEnum { - fn default() -> BlueprintInstanceStatusEnum { - Self::Successful - } -} diff --git a/packages/client-rust/src/models/brand_request.rs b/packages/client-rust/src/models/brand_request.rs deleted file mode 100644 index aa749fb83d..0000000000 --- a/packages/client-rust/src/models/brand_request.rs +++ /dev/null @@ -1,128 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// BrandRequest : Brand Serializer -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct BrandRequest { - /// Domain that activates this brand. Can be a superset, i.e. `a.b` for `aa.b` and `ba.b` - #[serde(rename = "domain")] - pub domain: String, - #[serde(rename = "default", skip_serializing_if = "Option::is_none")] - pub default: Option, - #[serde(rename = "branding_title", skip_serializing_if = "Option::is_none")] - pub branding_title: Option, - #[serde(rename = "branding_logo", skip_serializing_if = "Option::is_none")] - pub branding_logo: Option, - #[serde(rename = "branding_favicon", skip_serializing_if = "Option::is_none")] - pub branding_favicon: Option, - #[serde( - rename = "branding_custom_css", - skip_serializing_if = "Option::is_none" - )] - pub branding_custom_css: Option, - #[serde( - rename = "branding_default_flow_background", - skip_serializing_if = "Option::is_none" - )] - pub branding_default_flow_background: Option, - #[serde( - rename = "flow_authentication", - default, - with = "::serde_with::rust::double_option", - skip_serializing_if = "Option::is_none" - )] - pub flow_authentication: Option>, - #[serde( - rename = "flow_invalidation", - default, - with = "::serde_with::rust::double_option", - skip_serializing_if = "Option::is_none" - )] - pub flow_invalidation: Option>, - #[serde( - rename = "flow_recovery", - default, - with = "::serde_with::rust::double_option", - skip_serializing_if = "Option::is_none" - )] - pub flow_recovery: Option>, - #[serde( - rename = "flow_unenrollment", - default, - with = "::serde_with::rust::double_option", - skip_serializing_if = "Option::is_none" - )] - pub flow_unenrollment: Option>, - #[serde( - rename = "flow_user_settings", - default, - with = "::serde_with::rust::double_option", - skip_serializing_if = "Option::is_none" - )] - pub flow_user_settings: Option>, - #[serde( - rename = "flow_device_code", - default, - with = "::serde_with::rust::double_option", - skip_serializing_if = "Option::is_none" - )] - pub flow_device_code: Option>, - /// When set, external users will be redirected to this application after authenticating. - #[serde( - rename = "default_application", - default, - with = "::serde_with::rust::double_option", - skip_serializing_if = "Option::is_none" - )] - pub default_application: Option>, - /// Web Certificate used by the authentik Core webserver. - #[serde( - rename = "web_certificate", - default, - with = "::serde_with::rust::double_option", - skip_serializing_if = "Option::is_none" - )] - pub web_certificate: Option>, - /// Certificates used for client authentication. - #[serde( - rename = "client_certificates", - skip_serializing_if = "Option::is_none" - )] - pub client_certificates: Option>, - #[serde(rename = "attributes", skip_serializing_if = "Option::is_none")] - pub attributes: Option>, -} - -impl BrandRequest { - /// Brand Serializer - pub fn new(domain: String) -> BrandRequest { - BrandRequest { - domain, - default: None, - branding_title: None, - branding_logo: None, - branding_favicon: None, - branding_custom_css: None, - branding_default_flow_background: None, - flow_authentication: None, - flow_invalidation: None, - flow_recovery: None, - flow_unenrollment: None, - flow_user_settings: None, - flow_device_code: None, - default_application: None, - web_certificate: None, - client_certificates: None, - attributes: None, - } - } -} diff --git a/packages/client-rust/src/models/bulk_delete_session_response.rs b/packages/client-rust/src/models/bulk_delete_session_response.rs deleted file mode 100644 index d28142b6a0..0000000000 --- a/packages/client-rust/src/models/bulk_delete_session_response.rs +++ /dev/null @@ -1,23 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct BulkDeleteSessionResponse { - #[serde(rename = "deleted")] - pub deleted: i32, -} - -impl BulkDeleteSessionResponse { - pub fn new(deleted: i32) -> BulkDeleteSessionResponse { - BulkDeleteSessionResponse { deleted } - } -} diff --git a/packages/client-rust/src/models/cache.rs b/packages/client-rust/src/models/cache.rs deleted file mode 100644 index f40e5c9eb6..0000000000 --- a/packages/client-rust/src/models/cache.rs +++ /dev/null @@ -1,25 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// Cache : Generic cache stats for an object -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct Cache { - #[serde(rename = "count")] - pub count: i32, -} - -impl Cache { - /// Generic cache stats for an object - pub fn new(count: i32) -> Cache { - Cache { count } - } -} diff --git a/packages/client-rust/src/models/captcha_stage.rs b/packages/client-rust/src/models/captcha_stage.rs deleted file mode 100644 index 0d3f6c400a..0000000000 --- a/packages/client-rust/src/models/captcha_stage.rs +++ /dev/null @@ -1,92 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// CaptchaStage : CaptchaStage Serializer -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct CaptchaStage { - #[serde(rename = "pk")] - pub pk: uuid::Uuid, - #[serde(rename = "name")] - pub name: String, - /// Get object type so that we know how to edit the object - #[serde(rename = "component")] - pub component: String, - /// Return object's verbose_name - #[serde(rename = "verbose_name")] - pub verbose_name: String, - /// Return object's plural verbose_name - #[serde(rename = "verbose_name_plural")] - pub verbose_name_plural: String, - /// Return internal model name - #[serde(rename = "meta_model_name")] - pub meta_model_name: String, - #[serde(rename = "flow_set")] - pub flow_set: Vec, - /// Public key, acquired your captcha Provider. - #[serde(rename = "public_key")] - pub public_key: String, - #[serde(rename = "js_url", skip_serializing_if = "Option::is_none")] - pub js_url: Option, - #[serde(rename = "api_url", skip_serializing_if = "Option::is_none")] - pub api_url: Option, - #[serde(rename = "interactive", skip_serializing_if = "Option::is_none")] - pub interactive: Option, - #[serde( - rename = "score_min_threshold", - skip_serializing_if = "Option::is_none" - )] - pub score_min_threshold: Option, - #[serde( - rename = "score_max_threshold", - skip_serializing_if = "Option::is_none" - )] - pub score_max_threshold: Option, - /// 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 - #[serde( - rename = "error_on_invalid_score", - skip_serializing_if = "Option::is_none" - )] - pub error_on_invalid_score: Option, -} - -impl CaptchaStage { - /// CaptchaStage Serializer - pub fn new( - pk: uuid::Uuid, - name: String, - component: String, - verbose_name: String, - verbose_name_plural: String, - meta_model_name: String, - flow_set: Vec, - public_key: String, - ) -> CaptchaStage { - CaptchaStage { - pk, - name, - component, - verbose_name, - verbose_name_plural, - meta_model_name, - flow_set, - public_key, - js_url: None, - api_url: None, - interactive: None, - score_min_threshold: None, - score_max_threshold: None, - error_on_invalid_score: None, - } - } -} diff --git a/packages/client-rust/src/models/captcha_stage_request.rs b/packages/client-rust/src/models/captcha_stage_request.rs deleted file mode 100644 index e486fc31b1..0000000000 --- a/packages/client-rust/src/models/captcha_stage_request.rs +++ /dev/null @@ -1,65 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// CaptchaStageRequest : CaptchaStage Serializer -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct CaptchaStageRequest { - #[serde(rename = "name")] - pub name: String, - /// Public key, acquired your captcha Provider. - #[serde(rename = "public_key")] - pub public_key: String, - /// Private key, acquired your captcha Provider. - #[serde(rename = "private_key")] - pub private_key: String, - #[serde(rename = "js_url", skip_serializing_if = "Option::is_none")] - pub js_url: Option, - #[serde(rename = "api_url", skip_serializing_if = "Option::is_none")] - pub api_url: Option, - #[serde(rename = "interactive", skip_serializing_if = "Option::is_none")] - pub interactive: Option, - #[serde( - rename = "score_min_threshold", - skip_serializing_if = "Option::is_none" - )] - pub score_min_threshold: Option, - #[serde( - rename = "score_max_threshold", - skip_serializing_if = "Option::is_none" - )] - pub score_max_threshold: Option, - /// 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 - #[serde( - rename = "error_on_invalid_score", - skip_serializing_if = "Option::is_none" - )] - pub error_on_invalid_score: Option, -} - -impl CaptchaStageRequest { - /// CaptchaStage Serializer - pub fn new(name: String, public_key: String, private_key: String) -> CaptchaStageRequest { - CaptchaStageRequest { - name, - public_key, - private_key, - js_url: None, - api_url: None, - interactive: None, - score_min_threshold: None, - score_max_threshold: None, - error_on_invalid_score: None, - } - } -} diff --git a/packages/client-rust/src/models/cert_attribute_enum.rs b/packages/client-rust/src/models/cert_attribute_enum.rs deleted file mode 100644 index a513d9e187..0000000000 --- a/packages/client-rust/src/models/cert_attribute_enum.rs +++ /dev/null @@ -1,38 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// -#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] -pub enum CertAttributeEnum { - #[serde(rename = "subject")] - Subject, - #[serde(rename = "common_name")] - CommonName, - #[serde(rename = "email")] - Email, -} - -impl std::fmt::Display for CertAttributeEnum { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - match self { - Self::Subject => write!(f, "subject"), - Self::CommonName => write!(f, "common_name"), - Self::Email => write!(f, "email"), - } - } -} - -impl Default for CertAttributeEnum { - fn default() -> CertAttributeEnum { - Self::Subject - } -} diff --git a/packages/client-rust/src/models/certificate_generation_request.rs b/packages/client-rust/src/models/certificate_generation_request.rs deleted file mode 100644 index 97f2fb5d43..0000000000 --- a/packages/client-rust/src/models/certificate_generation_request.rs +++ /dev/null @@ -1,36 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// CertificateGenerationRequest : Certificate generation parameters -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct CertificateGenerationRequest { - #[serde(rename = "common_name")] - pub common_name: String, - #[serde(rename = "subject_alt_name", skip_serializing_if = "Option::is_none")] - pub subject_alt_name: Option, - #[serde(rename = "validity_days")] - pub validity_days: i32, - #[serde(rename = "alg", skip_serializing_if = "Option::is_none")] - pub alg: Option, -} - -impl CertificateGenerationRequest { - /// Certificate generation parameters - pub fn new(common_name: String, validity_days: i32) -> CertificateGenerationRequest { - CertificateGenerationRequest { - common_name, - subject_alt_name: None, - validity_days, - alg: None, - } - } -} diff --git a/packages/client-rust/src/models/certificate_key_pair_request.rs b/packages/client-rust/src/models/certificate_key_pair_request.rs deleted file mode 100644 index 1b0823576e..0000000000 --- a/packages/client-rust/src/models/certificate_key_pair_request.rs +++ /dev/null @@ -1,35 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// CertificateKeyPairRequest : CertificateKeyPair Serializer -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct CertificateKeyPairRequest { - #[serde(rename = "name")] - pub name: String, - /// PEM-encoded Certificate data - #[serde(rename = "certificate_data")] - pub certificate_data: String, - /// Optional Private Key. If this is set, you can use this keypair for encryption. - #[serde(rename = "key_data", skip_serializing_if = "Option::is_none")] - pub key_data: Option, -} - -impl CertificateKeyPairRequest { - /// CertificateKeyPair Serializer - pub fn new(name: String, certificate_data: String) -> CertificateKeyPairRequest { - CertificateKeyPairRequest { - name, - certificate_data, - key_data: None, - } - } -} diff --git a/packages/client-rust/src/models/client_type_enum.rs b/packages/client-rust/src/models/client_type_enum.rs deleted file mode 100644 index 8e2a0eb665..0000000000 --- a/packages/client-rust/src/models/client_type_enum.rs +++ /dev/null @@ -1,35 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// -#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] -pub enum ClientTypeEnum { - #[serde(rename = "confidential")] - Confidential, - #[serde(rename = "public")] - Public, -} - -impl std::fmt::Display for ClientTypeEnum { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - match self { - Self::Confidential => write!(f, "confidential"), - Self::Public => write!(f, "public"), - } - } -} - -impl Default for ClientTypeEnum { - fn default() -> ClientTypeEnum { - Self::Confidential - } -} diff --git a/packages/client-rust/src/models/compatibility_mode_enum.rs b/packages/client-rust/src/models/compatibility_mode_enum.rs deleted file mode 100644 index 0849dcab3a..0000000000 --- a/packages/client-rust/src/models/compatibility_mode_enum.rs +++ /dev/null @@ -1,44 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// -#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] -pub enum CompatibilityModeEnum { - #[serde(rename = "default")] - Default, - #[serde(rename = "aws")] - Aws, - #[serde(rename = "slack")] - Slack, - #[serde(rename = "sfdc")] - Sfdc, - #[serde(rename = "webex")] - Webex, -} - -impl std::fmt::Display for CompatibilityModeEnum { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - match self { - Self::Default => write!(f, "default"), - Self::Aws => write!(f, "aws"), - Self::Slack => write!(f, "slack"), - Self::Sfdc => write!(f, "sfdc"), - Self::Webex => write!(f, "webex"), - } - } -} - -impl Default for CompatibilityModeEnum { - fn default() -> CompatibilityModeEnum { - Self::Default - } -} diff --git a/packages/client-rust/src/models/connection_token.rs b/packages/client-rust/src/models/connection_token.rs deleted file mode 100644 index df4c34ce66..0000000000 --- a/packages/client-rust/src/models/connection_token.rs +++ /dev/null @@ -1,48 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// ConnectionToken : ConnectionToken Serializer -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct ConnectionToken { - #[serde(rename = "pk", skip_serializing_if = "Option::is_none")] - pub pk: Option, - #[serde(rename = "provider")] - pub provider: i32, - #[serde(rename = "provider_obj")] - pub provider_obj: models::RacProvider, - #[serde(rename = "endpoint")] - pub endpoint: uuid::Uuid, - #[serde(rename = "endpoint_obj")] - pub endpoint_obj: models::Endpoint, - #[serde(rename = "user")] - pub user: models::PartialUser, -} - -impl ConnectionToken { - /// ConnectionToken Serializer - pub fn new( - provider: i32, - provider_obj: models::RacProvider, - endpoint: uuid::Uuid, - endpoint_obj: models::Endpoint, - user: models::PartialUser, - ) -> ConnectionToken { - ConnectionToken { - pk: None, - provider, - provider_obj, - endpoint, - endpoint_obj, - user, - } - } -} diff --git a/packages/client-rust/src/models/connection_token_request.rs b/packages/client-rust/src/models/connection_token_request.rs deleted file mode 100644 index 5577a4e578..0000000000 --- a/packages/client-rust/src/models/connection_token_request.rs +++ /dev/null @@ -1,33 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// ConnectionTokenRequest : ConnectionToken Serializer -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct ConnectionTokenRequest { - #[serde(rename = "pk", skip_serializing_if = "Option::is_none")] - pub pk: Option, - #[serde(rename = "provider")] - pub provider: i32, - #[serde(rename = "endpoint")] - pub endpoint: uuid::Uuid, -} - -impl ConnectionTokenRequest { - /// ConnectionToken Serializer - pub fn new(provider: i32, endpoint: uuid::Uuid) -> ConnectionTokenRequest { - ConnectionTokenRequest { - pk: None, - provider, - endpoint, - } - } -} diff --git a/packages/client-rust/src/models/connector.rs b/packages/client-rust/src/models/connector.rs deleted file mode 100644 index b053407e08..0000000000 --- a/packages/client-rust/src/models/connector.rs +++ /dev/null @@ -1,53 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct Connector { - #[serde(rename = "connector_uuid", skip_serializing_if = "Option::is_none")] - pub connector_uuid: Option, - #[serde(rename = "name")] - pub name: String, - #[serde(rename = "enabled", skip_serializing_if = "Option::is_none")] - pub enabled: Option, - /// Get object component so that we know how to edit the object - #[serde(rename = "component")] - pub component: String, - /// Return object's verbose_name - #[serde(rename = "verbose_name")] - pub verbose_name: String, - /// Return object's plural verbose_name - #[serde(rename = "verbose_name_plural")] - pub verbose_name_plural: String, - /// Return internal model name - #[serde(rename = "meta_model_name")] - pub meta_model_name: String, -} - -impl Connector { - pub fn new( - name: String, - component: String, - verbose_name: String, - verbose_name_plural: String, - meta_model_name: String, - ) -> Connector { - Connector { - connector_uuid: None, - name, - enabled: None, - component, - verbose_name, - verbose_name_plural, - meta_model_name, - } - } -} diff --git a/packages/client-rust/src/models/consent_mode_enum.rs b/packages/client-rust/src/models/consent_mode_enum.rs deleted file mode 100644 index 3ec0e4fea8..0000000000 --- a/packages/client-rust/src/models/consent_mode_enum.rs +++ /dev/null @@ -1,38 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// -#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] -pub enum ConsentModeEnum { - #[serde(rename = "always_require")] - AlwaysRequire, - #[serde(rename = "permanent")] - Permanent, - #[serde(rename = "expiring")] - Expiring, -} - -impl std::fmt::Display for ConsentModeEnum { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - match self { - Self::AlwaysRequire => write!(f, "always_require"), - Self::Permanent => write!(f, "permanent"), - Self::Expiring => write!(f, "expiring"), - } - } -} - -impl Default for ConsentModeEnum { - fn default() -> ConsentModeEnum { - Self::AlwaysRequire - } -} diff --git a/packages/client-rust/src/models/consent_stage.rs b/packages/client-rust/src/models/consent_stage.rs deleted file mode 100644 index 550a005d02..0000000000 --- a/packages/client-rust/src/models/consent_stage.rs +++ /dev/null @@ -1,64 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// ConsentStage : ConsentStage Serializer -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct ConsentStage { - #[serde(rename = "pk")] - pub pk: uuid::Uuid, - #[serde(rename = "name")] - pub name: String, - /// Get object type so that we know how to edit the object - #[serde(rename = "component")] - pub component: String, - /// Return object's verbose_name - #[serde(rename = "verbose_name")] - pub verbose_name: String, - /// Return object's plural verbose_name - #[serde(rename = "verbose_name_plural")] - pub verbose_name_plural: String, - /// Return internal model name - #[serde(rename = "meta_model_name")] - pub meta_model_name: String, - #[serde(rename = "flow_set")] - pub flow_set: Vec, - #[serde(rename = "mode", skip_serializing_if = "Option::is_none")] - pub mode: Option, - /// Offset after which consent expires. (Format: hours=1;minutes=2;seconds=3). - #[serde(rename = "consent_expire_in", skip_serializing_if = "Option::is_none")] - pub consent_expire_in: Option, -} - -impl ConsentStage { - /// ConsentStage Serializer - pub fn new( - pk: uuid::Uuid, - name: String, - component: String, - verbose_name: String, - verbose_name_plural: String, - meta_model_name: String, - flow_set: Vec, - ) -> ConsentStage { - ConsentStage { - pk, - name, - component, - verbose_name, - verbose_name_plural, - meta_model_name, - flow_set, - mode: None, - consent_expire_in: None, - } - } -} diff --git a/packages/client-rust/src/models/consent_stage_request.rs b/packages/client-rust/src/models/consent_stage_request.rs deleted file mode 100644 index 3ff5c508d6..0000000000 --- a/packages/client-rust/src/models/consent_stage_request.rs +++ /dev/null @@ -1,34 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// ConsentStageRequest : ConsentStage Serializer -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct ConsentStageRequest { - #[serde(rename = "name")] - pub name: String, - #[serde(rename = "mode", skip_serializing_if = "Option::is_none")] - pub mode: Option, - /// Offset after which consent expires. (Format: hours=1;minutes=2;seconds=3). - #[serde(rename = "consent_expire_in", skip_serializing_if = "Option::is_none")] - pub consent_expire_in: Option, -} - -impl ConsentStageRequest { - /// ConsentStage Serializer - pub fn new(name: String) -> ConsentStageRequest { - ConsentStageRequest { - name, - mode: None, - consent_expire_in: None, - } - } -} diff --git a/packages/client-rust/src/models/content_type.rs b/packages/client-rust/src/models/content_type.rs deleted file mode 100644 index 55f4a0d4dc..0000000000 --- a/packages/client-rust/src/models/content_type.rs +++ /dev/null @@ -1,39 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct ContentType { - #[serde(rename = "id")] - pub id: i32, - #[serde(rename = "app_label")] - pub app_label: String, - #[serde(rename = "model")] - pub model: String, - #[serde(rename = "verbose_name_plural")] - pub verbose_name_plural: String, -} - -impl ContentType { - pub fn new( - id: i32, - app_label: String, - model: String, - verbose_name_plural: String, - ) -> ContentType { - ContentType { - id, - app_label, - model, - verbose_name_plural, - } - } -} diff --git a/packages/client-rust/src/models/content_type_enum.rs b/packages/client-rust/src/models/content_type_enum.rs deleted file mode 100644 index ee6249b1fc..0000000000 --- a/packages/client-rust/src/models/content_type_enum.rs +++ /dev/null @@ -1,38 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// -#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] -pub enum ContentTypeEnum { - #[serde(rename = "authentik_core.application")] - AuthentikCoreApplication, - #[serde(rename = "authentik_core.group")] - AuthentikCoreGroup, - #[serde(rename = "authentik_rbac.role")] - AuthentikRbacRole, -} - -impl std::fmt::Display for ContentTypeEnum { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - match self { - Self::AuthentikCoreApplication => write!(f, "authentik_core.application"), - Self::AuthentikCoreGroup => write!(f, "authentik_core.group"), - Self::AuthentikRbacRole => write!(f, "authentik_rbac.role"), - } - } -} - -impl Default for ContentTypeEnum { - fn default() -> ContentTypeEnum { - Self::AuthentikCoreApplication - } -} diff --git a/packages/client-rust/src/models/country_code_enum.rs b/packages/client-rust/src/models/country_code_enum.rs deleted file mode 100644 index 0f2a2dad6e..0000000000 --- a/packages/client-rust/src/models/country_code_enum.rs +++ /dev/null @@ -1,776 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// -#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] -pub enum CountryCodeEnum { - #[serde(rename = "AF")] - Af, - #[serde(rename = "AX")] - Ax, - #[serde(rename = "AL")] - Al, - #[serde(rename = "DZ")] - Dz, - #[serde(rename = "AS")] - As, - #[serde(rename = "AD")] - Ad, - #[serde(rename = "AO")] - Ao, - #[serde(rename = "AI")] - Ai, - #[serde(rename = "AQ")] - Aq, - #[serde(rename = "AG")] - Ag, - #[serde(rename = "AR")] - Ar, - #[serde(rename = "AM")] - Am, - #[serde(rename = "AW")] - Aw, - #[serde(rename = "AU")] - Au, - #[serde(rename = "AT")] - At, - #[serde(rename = "AZ")] - Az, - #[serde(rename = "BS")] - Bs, - #[serde(rename = "BH")] - Bh, - #[serde(rename = "BD")] - Bd, - #[serde(rename = "BB")] - Bb, - #[serde(rename = "BY")] - By, - #[serde(rename = "BE")] - Be, - #[serde(rename = "BZ")] - Bz, - #[serde(rename = "BJ")] - Bj, - #[serde(rename = "BM")] - Bm, - #[serde(rename = "BT")] - Bt, - #[serde(rename = "BO")] - Bo, - #[serde(rename = "BQ")] - Bq, - #[serde(rename = "BA")] - Ba, - #[serde(rename = "BW")] - Bw, - #[serde(rename = "BV")] - Bv, - #[serde(rename = "BR")] - Br, - #[serde(rename = "IO")] - Io, - #[serde(rename = "BN")] - Bn, - #[serde(rename = "BG")] - Bg, - #[serde(rename = "BF")] - Bf, - #[serde(rename = "BI")] - Bi, - #[serde(rename = "CV")] - Cv, - #[serde(rename = "KH")] - Kh, - #[serde(rename = "CM")] - Cm, - #[serde(rename = "CA")] - Ca, - #[serde(rename = "KY")] - Ky, - #[serde(rename = "CF")] - Cf, - #[serde(rename = "TD")] - Td, - #[serde(rename = "CL")] - Cl, - #[serde(rename = "CN")] - Cn, - #[serde(rename = "CX")] - Cx, - #[serde(rename = "CC")] - Cc, - #[serde(rename = "CO")] - Co, - #[serde(rename = "KM")] - Km, - #[serde(rename = "CG")] - Cg, - #[serde(rename = "CK")] - Ck, - #[serde(rename = "CR")] - Cr, - #[serde(rename = "CI")] - Ci, - #[serde(rename = "HR")] - Hr, - #[serde(rename = "CU")] - Cu, - #[serde(rename = "CW")] - Cw, - #[serde(rename = "CY")] - Cy, - #[serde(rename = "CZ")] - Cz, - #[serde(rename = "CD")] - Cd, - #[serde(rename = "DK")] - Dk, - #[serde(rename = "DJ")] - Dj, - #[serde(rename = "DM")] - Dm, - #[serde(rename = "DO")] - Do, - #[serde(rename = "EC")] - Ec, - #[serde(rename = "EG")] - Eg, - #[serde(rename = "SV")] - Sv, - #[serde(rename = "GQ")] - Gq, - #[serde(rename = "ER")] - Er, - #[serde(rename = "EE")] - Ee, - #[serde(rename = "SZ")] - Sz, - #[serde(rename = "ET")] - Et, - #[serde(rename = "FK")] - Fk, - #[serde(rename = "FO")] - Fo, - #[serde(rename = "FJ")] - Fj, - #[serde(rename = "FI")] - Fi, - #[serde(rename = "FR")] - Fr, - #[serde(rename = "GF")] - Gf, - #[serde(rename = "PF")] - Pf, - #[serde(rename = "TF")] - Tf, - #[serde(rename = "GA")] - Ga, - #[serde(rename = "GM")] - Gm, - #[serde(rename = "GE")] - Ge, - #[serde(rename = "DE")] - De, - #[serde(rename = "GH")] - Gh, - #[serde(rename = "GI")] - Gi, - #[serde(rename = "GR")] - Gr, - #[serde(rename = "GL")] - Gl, - #[serde(rename = "GD")] - Gd, - #[serde(rename = "GP")] - Gp, - #[serde(rename = "GU")] - Gu, - #[serde(rename = "GT")] - Gt, - #[serde(rename = "GG")] - Gg, - #[serde(rename = "GN")] - Gn, - #[serde(rename = "GW")] - Gw, - #[serde(rename = "GY")] - Gy, - #[serde(rename = "HT")] - Ht, - #[serde(rename = "HM")] - Hm, - #[serde(rename = "HN")] - Hn, - #[serde(rename = "HK")] - Hk, - #[serde(rename = "HU")] - Hu, - #[serde(rename = "IS")] - Is, - #[serde(rename = "IN")] - In, - #[serde(rename = "ID")] - Id, - #[serde(rename = "IR")] - Ir, - #[serde(rename = "IQ")] - Iq, - #[serde(rename = "IE")] - Ie, - #[serde(rename = "IM")] - Im, - #[serde(rename = "IL")] - Il, - #[serde(rename = "IT")] - It, - #[serde(rename = "JM")] - Jm, - #[serde(rename = "JP")] - Jp, - #[serde(rename = "JE")] - Je, - #[serde(rename = "JO")] - Jo, - #[serde(rename = "KZ")] - Kz, - #[serde(rename = "KE")] - Ke, - #[serde(rename = "KI")] - Ki, - #[serde(rename = "KW")] - Kw, - #[serde(rename = "KG")] - Kg, - #[serde(rename = "LA")] - La, - #[serde(rename = "LV")] - Lv, - #[serde(rename = "LB")] - Lb, - #[serde(rename = "LS")] - Ls, - #[serde(rename = "LR")] - Lr, - #[serde(rename = "LY")] - Ly, - #[serde(rename = "LI")] - Li, - #[serde(rename = "LT")] - Lt, - #[serde(rename = "LU")] - Lu, - #[serde(rename = "MO")] - Mo, - #[serde(rename = "MG")] - Mg, - #[serde(rename = "MW")] - Mw, - #[serde(rename = "MY")] - My, - #[serde(rename = "MV")] - Mv, - #[serde(rename = "ML")] - Ml, - #[serde(rename = "MT")] - Mt, - #[serde(rename = "MH")] - Mh, - #[serde(rename = "MQ")] - Mq, - #[serde(rename = "MR")] - Mr, - #[serde(rename = "MU")] - Mu, - #[serde(rename = "YT")] - Yt, - #[serde(rename = "MX")] - Mx, - #[serde(rename = "FM")] - Fm, - #[serde(rename = "MD")] - Md, - #[serde(rename = "MC")] - Mc, - #[serde(rename = "MN")] - Mn, - #[serde(rename = "ME")] - Me, - #[serde(rename = "MS")] - Ms, - #[serde(rename = "MA")] - Ma, - #[serde(rename = "MZ")] - Mz, - #[serde(rename = "MM")] - Mm, - #[serde(rename = "NA")] - Na, - #[serde(rename = "NR")] - Nr, - #[serde(rename = "NP")] - Np, - #[serde(rename = "NL")] - Nl, - #[serde(rename = "NC")] - Nc, - #[serde(rename = "NZ")] - Nz, - #[serde(rename = "NI")] - Ni, - #[serde(rename = "NE")] - Ne, - #[serde(rename = "NG")] - Ng, - #[serde(rename = "NU")] - Nu, - #[serde(rename = "NF")] - Nf, - #[serde(rename = "KP")] - Kp, - #[serde(rename = "MK")] - Mk, - #[serde(rename = "MP")] - Mp, - #[serde(rename = "NO")] - No, - #[serde(rename = "OM")] - Om, - #[serde(rename = "PK")] - Pk, - #[serde(rename = "PW")] - Pw, - #[serde(rename = "PS")] - Ps, - #[serde(rename = "PA")] - Pa, - #[serde(rename = "PG")] - Pg, - #[serde(rename = "PY")] - Py, - #[serde(rename = "PE")] - Pe, - #[serde(rename = "PH")] - Ph, - #[serde(rename = "PN")] - Pn, - #[serde(rename = "PL")] - Pl, - #[serde(rename = "PT")] - Pt, - #[serde(rename = "PR")] - Pr, - #[serde(rename = "QA")] - Qa, - #[serde(rename = "RE")] - Re, - #[serde(rename = "RO")] - Ro, - #[serde(rename = "RU")] - Ru, - #[serde(rename = "RW")] - Rw, - #[serde(rename = "BL")] - Bl, - #[serde(rename = "SH")] - Sh, - #[serde(rename = "KN")] - Kn, - #[serde(rename = "LC")] - Lc, - #[serde(rename = "MF")] - Mf, - #[serde(rename = "PM")] - Pm, - #[serde(rename = "VC")] - Vc, - #[serde(rename = "WS")] - Ws, - #[serde(rename = "SM")] - Sm, - #[serde(rename = "ST")] - St, - #[serde(rename = "SA")] - Sa, - #[serde(rename = "SN")] - Sn, - #[serde(rename = "RS")] - Rs, - #[serde(rename = "SC")] - Sc, - #[serde(rename = "SL")] - Sl, - #[serde(rename = "SG")] - Sg, - #[serde(rename = "SX")] - Sx, - #[serde(rename = "SK")] - Sk, - #[serde(rename = "SI")] - Si, - #[serde(rename = "SB")] - Sb, - #[serde(rename = "SO")] - So, - #[serde(rename = "ZA")] - Za, - #[serde(rename = "GS")] - Gs, - #[serde(rename = "KR")] - Kr, - #[serde(rename = "SS")] - Ss, - #[serde(rename = "ES")] - Es, - #[serde(rename = "LK")] - Lk, - #[serde(rename = "SD")] - Sd, - #[serde(rename = "SR")] - Sr, - #[serde(rename = "SJ")] - Sj, - #[serde(rename = "SE")] - Se, - #[serde(rename = "CH")] - Ch, - #[serde(rename = "SY")] - Sy, - #[serde(rename = "TW")] - Tw, - #[serde(rename = "TJ")] - Tj, - #[serde(rename = "TZ")] - Tz, - #[serde(rename = "TH")] - Th, - #[serde(rename = "TL")] - Tl, - #[serde(rename = "TG")] - Tg, - #[serde(rename = "TK")] - Tk, - #[serde(rename = "TO")] - To, - #[serde(rename = "TT")] - Tt, - #[serde(rename = "TN")] - Tn, - #[serde(rename = "TR")] - Tr, - #[serde(rename = "TM")] - Tm, - #[serde(rename = "TC")] - Tc, - #[serde(rename = "TV")] - Tv, - #[serde(rename = "UG")] - Ug, - #[serde(rename = "UA")] - Ua, - #[serde(rename = "AE")] - Ae, - #[serde(rename = "GB")] - Gb, - #[serde(rename = "UM")] - Um, - #[serde(rename = "US")] - Us, - #[serde(rename = "UY")] - Uy, - #[serde(rename = "UZ")] - Uz, - #[serde(rename = "VU")] - Vu, - #[serde(rename = "VA")] - Va, - #[serde(rename = "VE")] - Ve, - #[serde(rename = "VN")] - Vn, - #[serde(rename = "VG")] - Vg, - #[serde(rename = "VI")] - Vi, - #[serde(rename = "WF")] - Wf, - #[serde(rename = "EH")] - Eh, - #[serde(rename = "YE")] - Ye, - #[serde(rename = "ZM")] - Zm, - #[serde(rename = "ZW")] - Zw, -} - -impl std::fmt::Display for CountryCodeEnum { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - match self { - Self::Af => write!(f, "AF"), - Self::Ax => write!(f, "AX"), - Self::Al => write!(f, "AL"), - Self::Dz => write!(f, "DZ"), - Self::As => write!(f, "AS"), - Self::Ad => write!(f, "AD"), - Self::Ao => write!(f, "AO"), - Self::Ai => write!(f, "AI"), - Self::Aq => write!(f, "AQ"), - Self::Ag => write!(f, "AG"), - Self::Ar => write!(f, "AR"), - Self::Am => write!(f, "AM"), - Self::Aw => write!(f, "AW"), - Self::Au => write!(f, "AU"), - Self::At => write!(f, "AT"), - Self::Az => write!(f, "AZ"), - Self::Bs => write!(f, "BS"), - Self::Bh => write!(f, "BH"), - Self::Bd => write!(f, "BD"), - Self::Bb => write!(f, "BB"), - Self::By => write!(f, "BY"), - Self::Be => write!(f, "BE"), - Self::Bz => write!(f, "BZ"), - Self::Bj => write!(f, "BJ"), - Self::Bm => write!(f, "BM"), - Self::Bt => write!(f, "BT"), - Self::Bo => write!(f, "BO"), - Self::Bq => write!(f, "BQ"), - Self::Ba => write!(f, "BA"), - Self::Bw => write!(f, "BW"), - Self::Bv => write!(f, "BV"), - Self::Br => write!(f, "BR"), - Self::Io => write!(f, "IO"), - Self::Bn => write!(f, "BN"), - Self::Bg => write!(f, "BG"), - Self::Bf => write!(f, "BF"), - Self::Bi => write!(f, "BI"), - Self::Cv => write!(f, "CV"), - Self::Kh => write!(f, "KH"), - Self::Cm => write!(f, "CM"), - Self::Ca => write!(f, "CA"), - Self::Ky => write!(f, "KY"), - Self::Cf => write!(f, "CF"), - Self::Td => write!(f, "TD"), - Self::Cl => write!(f, "CL"), - Self::Cn => write!(f, "CN"), - Self::Cx => write!(f, "CX"), - Self::Cc => write!(f, "CC"), - Self::Co => write!(f, "CO"), - Self::Km => write!(f, "KM"), - Self::Cg => write!(f, "CG"), - Self::Ck => write!(f, "CK"), - Self::Cr => write!(f, "CR"), - Self::Ci => write!(f, "CI"), - Self::Hr => write!(f, "HR"), - Self::Cu => write!(f, "CU"), - Self::Cw => write!(f, "CW"), - Self::Cy => write!(f, "CY"), - Self::Cz => write!(f, "CZ"), - Self::Cd => write!(f, "CD"), - Self::Dk => write!(f, "DK"), - Self::Dj => write!(f, "DJ"), - Self::Dm => write!(f, "DM"), - Self::Do => write!(f, "DO"), - Self::Ec => write!(f, "EC"), - Self::Eg => write!(f, "EG"), - Self::Sv => write!(f, "SV"), - Self::Gq => write!(f, "GQ"), - Self::Er => write!(f, "ER"), - Self::Ee => write!(f, "EE"), - Self::Sz => write!(f, "SZ"), - Self::Et => write!(f, "ET"), - Self::Fk => write!(f, "FK"), - Self::Fo => write!(f, "FO"), - Self::Fj => write!(f, "FJ"), - Self::Fi => write!(f, "FI"), - Self::Fr => write!(f, "FR"), - Self::Gf => write!(f, "GF"), - Self::Pf => write!(f, "PF"), - Self::Tf => write!(f, "TF"), - Self::Ga => write!(f, "GA"), - Self::Gm => write!(f, "GM"), - Self::Ge => write!(f, "GE"), - Self::De => write!(f, "DE"), - Self::Gh => write!(f, "GH"), - Self::Gi => write!(f, "GI"), - Self::Gr => write!(f, "GR"), - Self::Gl => write!(f, "GL"), - Self::Gd => write!(f, "GD"), - Self::Gp => write!(f, "GP"), - Self::Gu => write!(f, "GU"), - Self::Gt => write!(f, "GT"), - Self::Gg => write!(f, "GG"), - Self::Gn => write!(f, "GN"), - Self::Gw => write!(f, "GW"), - Self::Gy => write!(f, "GY"), - Self::Ht => write!(f, "HT"), - Self::Hm => write!(f, "HM"), - Self::Hn => write!(f, "HN"), - Self::Hk => write!(f, "HK"), - Self::Hu => write!(f, "HU"), - Self::Is => write!(f, "IS"), - Self::In => write!(f, "IN"), - Self::Id => write!(f, "ID"), - Self::Ir => write!(f, "IR"), - Self::Iq => write!(f, "IQ"), - Self::Ie => write!(f, "IE"), - Self::Im => write!(f, "IM"), - Self::Il => write!(f, "IL"), - Self::It => write!(f, "IT"), - Self::Jm => write!(f, "JM"), - Self::Jp => write!(f, "JP"), - Self::Je => write!(f, "JE"), - Self::Jo => write!(f, "JO"), - Self::Kz => write!(f, "KZ"), - Self::Ke => write!(f, "KE"), - Self::Ki => write!(f, "KI"), - Self::Kw => write!(f, "KW"), - Self::Kg => write!(f, "KG"), - Self::La => write!(f, "LA"), - Self::Lv => write!(f, "LV"), - Self::Lb => write!(f, "LB"), - Self::Ls => write!(f, "LS"), - Self::Lr => write!(f, "LR"), - Self::Ly => write!(f, "LY"), - Self::Li => write!(f, "LI"), - Self::Lt => write!(f, "LT"), - Self::Lu => write!(f, "LU"), - Self::Mo => write!(f, "MO"), - Self::Mg => write!(f, "MG"), - Self::Mw => write!(f, "MW"), - Self::My => write!(f, "MY"), - Self::Mv => write!(f, "MV"), - Self::Ml => write!(f, "ML"), - Self::Mt => write!(f, "MT"), - Self::Mh => write!(f, "MH"), - Self::Mq => write!(f, "MQ"), - Self::Mr => write!(f, "MR"), - Self::Mu => write!(f, "MU"), - Self::Yt => write!(f, "YT"), - Self::Mx => write!(f, "MX"), - Self::Fm => write!(f, "FM"), - Self::Md => write!(f, "MD"), - Self::Mc => write!(f, "MC"), - Self::Mn => write!(f, "MN"), - Self::Me => write!(f, "ME"), - Self::Ms => write!(f, "MS"), - Self::Ma => write!(f, "MA"), - Self::Mz => write!(f, "MZ"), - Self::Mm => write!(f, "MM"), - Self::Na => write!(f, "NA"), - Self::Nr => write!(f, "NR"), - Self::Np => write!(f, "NP"), - Self::Nl => write!(f, "NL"), - Self::Nc => write!(f, "NC"), - Self::Nz => write!(f, "NZ"), - Self::Ni => write!(f, "NI"), - Self::Ne => write!(f, "NE"), - Self::Ng => write!(f, "NG"), - Self::Nu => write!(f, "NU"), - Self::Nf => write!(f, "NF"), - Self::Kp => write!(f, "KP"), - Self::Mk => write!(f, "MK"), - Self::Mp => write!(f, "MP"), - Self::No => write!(f, "NO"), - Self::Om => write!(f, "OM"), - Self::Pk => write!(f, "PK"), - Self::Pw => write!(f, "PW"), - Self::Ps => write!(f, "PS"), - Self::Pa => write!(f, "PA"), - Self::Pg => write!(f, "PG"), - Self::Py => write!(f, "PY"), - Self::Pe => write!(f, "PE"), - Self::Ph => write!(f, "PH"), - Self::Pn => write!(f, "PN"), - Self::Pl => write!(f, "PL"), - Self::Pt => write!(f, "PT"), - Self::Pr => write!(f, "PR"), - Self::Qa => write!(f, "QA"), - Self::Re => write!(f, "RE"), - Self::Ro => write!(f, "RO"), - Self::Ru => write!(f, "RU"), - Self::Rw => write!(f, "RW"), - Self::Bl => write!(f, "BL"), - Self::Sh => write!(f, "SH"), - Self::Kn => write!(f, "KN"), - Self::Lc => write!(f, "LC"), - Self::Mf => write!(f, "MF"), - Self::Pm => write!(f, "PM"), - Self::Vc => write!(f, "VC"), - Self::Ws => write!(f, "WS"), - Self::Sm => write!(f, "SM"), - Self::St => write!(f, "ST"), - Self::Sa => write!(f, "SA"), - Self::Sn => write!(f, "SN"), - Self::Rs => write!(f, "RS"), - Self::Sc => write!(f, "SC"), - Self::Sl => write!(f, "SL"), - Self::Sg => write!(f, "SG"), - Self::Sx => write!(f, "SX"), - Self::Sk => write!(f, "SK"), - Self::Si => write!(f, "SI"), - Self::Sb => write!(f, "SB"), - Self::So => write!(f, "SO"), - Self::Za => write!(f, "ZA"), - Self::Gs => write!(f, "GS"), - Self::Kr => write!(f, "KR"), - Self::Ss => write!(f, "SS"), - Self::Es => write!(f, "ES"), - Self::Lk => write!(f, "LK"), - Self::Sd => write!(f, "SD"), - Self::Sr => write!(f, "SR"), - Self::Sj => write!(f, "SJ"), - Self::Se => write!(f, "SE"), - Self::Ch => write!(f, "CH"), - Self::Sy => write!(f, "SY"), - Self::Tw => write!(f, "TW"), - Self::Tj => write!(f, "TJ"), - Self::Tz => write!(f, "TZ"), - Self::Th => write!(f, "TH"), - Self::Tl => write!(f, "TL"), - Self::Tg => write!(f, "TG"), - Self::Tk => write!(f, "TK"), - Self::To => write!(f, "TO"), - Self::Tt => write!(f, "TT"), - Self::Tn => write!(f, "TN"), - Self::Tr => write!(f, "TR"), - Self::Tm => write!(f, "TM"), - Self::Tc => write!(f, "TC"), - Self::Tv => write!(f, "TV"), - Self::Ug => write!(f, "UG"), - Self::Ua => write!(f, "UA"), - Self::Ae => write!(f, "AE"), - Self::Gb => write!(f, "GB"), - Self::Um => write!(f, "UM"), - Self::Us => write!(f, "US"), - Self::Uy => write!(f, "UY"), - Self::Uz => write!(f, "UZ"), - Self::Vu => write!(f, "VU"), - Self::Va => write!(f, "VA"), - Self::Ve => write!(f, "VE"), - Self::Vn => write!(f, "VN"), - Self::Vg => write!(f, "VG"), - Self::Vi => write!(f, "VI"), - Self::Wf => write!(f, "WF"), - Self::Eh => write!(f, "EH"), - Self::Ye => write!(f, "YE"), - Self::Zm => write!(f, "ZM"), - Self::Zw => write!(f, "ZW"), - } - } -} - -impl Default for CountryCodeEnum { - fn default() -> CountryCodeEnum { - Self::Af - } -} diff --git a/packages/client-rust/src/models/current_brand.rs b/packages/client-rust/src/models/current_brand.rs deleted file mode 100644 index 9abf33b549..0000000000 --- a/packages/client-rust/src/models/current_brand.rs +++ /dev/null @@ -1,96 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// CurrentBrand : Partial brand information for styling -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct CurrentBrand { - #[serde(rename = "matched_domain")] - pub matched_domain: String, - #[serde(rename = "branding_title")] - pub branding_title: String, - #[serde(rename = "branding_logo")] - pub branding_logo: String, - #[serde( - rename = "branding_logo_themed_urls", - deserialize_with = "Option::deserialize" - )] - pub branding_logo_themed_urls: Option, - #[serde(rename = "branding_favicon")] - pub branding_favicon: String, - #[serde( - rename = "branding_favicon_themed_urls", - deserialize_with = "Option::deserialize" - )] - pub branding_favicon_themed_urls: Option, - #[serde(rename = "branding_custom_css")] - pub branding_custom_css: String, - #[serde(rename = "ui_footer_links")] - pub ui_footer_links: Vec, - #[serde(rename = "ui_theme")] - pub ui_theme: models::UiThemeEnum, - #[serde( - rename = "flow_authentication", - skip_serializing_if = "Option::is_none" - )] - pub flow_authentication: Option, - #[serde(rename = "flow_invalidation", skip_serializing_if = "Option::is_none")] - pub flow_invalidation: Option, - #[serde(rename = "flow_recovery", skip_serializing_if = "Option::is_none")] - pub flow_recovery: Option, - #[serde(rename = "flow_unenrollment", skip_serializing_if = "Option::is_none")] - pub flow_unenrollment: Option, - #[serde(rename = "flow_user_settings", skip_serializing_if = "Option::is_none")] - pub flow_user_settings: Option, - #[serde(rename = "flow_device_code", skip_serializing_if = "Option::is_none")] - pub flow_device_code: Option, - #[serde(rename = "default_locale")] - pub default_locale: String, - #[serde(rename = "flags")] - pub flags: models::CurrentBrandFlags, -} - -impl CurrentBrand { - /// Partial brand information for styling - pub fn new( - matched_domain: String, - branding_title: String, - branding_logo: String, - branding_logo_themed_urls: Option, - branding_favicon: String, - branding_favicon_themed_urls: Option, - branding_custom_css: String, - ui_footer_links: Vec, - ui_theme: models::UiThemeEnum, - default_locale: String, - flags: models::CurrentBrandFlags, - ) -> CurrentBrand { - CurrentBrand { - matched_domain, - branding_title, - branding_logo, - branding_logo_themed_urls, - branding_favicon, - branding_favicon_themed_urls, - branding_custom_css, - ui_footer_links, - ui_theme, - flow_authentication: None, - flow_invalidation: None, - flow_recovery: None, - flow_unenrollment: None, - flow_user_settings: None, - flow_device_code: None, - default_locale, - flags, - } - } -} diff --git a/packages/client-rust/src/models/current_brand_flags.rs b/packages/client-rust/src/models/current_brand_flags.rs deleted file mode 100644 index e7fee8f094..0000000000 --- a/packages/client-rust/src/models/current_brand_flags.rs +++ /dev/null @@ -1,44 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct CurrentBrandFlags { - /// Configure if applications without any policy/group/user bindings should be accessible to - /// any user. - #[serde(rename = "core_default_app_access")] - pub core_default_app_access: bool, - /// Include additional information in audit logs, may incur a performance penalty. - #[serde(rename = "enterprise_audit_include_expanded_diff")] - pub enterprise_audit_include_expanded_diff: bool, - /// Upon successful authentication, re-start authentication in other open tabs. - #[serde(rename = "flows_continuous_login")] - pub flows_continuous_login: bool, - /// Refresh other tabs after successful authentication. - #[serde(rename = "flows_refresh_others")] - pub flows_refresh_others: bool, -} - -impl CurrentBrandFlags { - pub fn new( - core_default_app_access: bool, - enterprise_audit_include_expanded_diff: bool, - flows_continuous_login: bool, - flows_refresh_others: bool, - ) -> CurrentBrandFlags { - CurrentBrandFlags { - core_default_app_access, - enterprise_audit_include_expanded_diff, - flows_continuous_login, - flows_refresh_others, - } - } -} diff --git a/packages/client-rust/src/models/data_export.rs b/packages/client-rust/src/models/data_export.rs deleted file mode 100644 index 7fa2b1e9cf..0000000000 --- a/packages/client-rust/src/models/data_export.rs +++ /dev/null @@ -1,54 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// DataExport : Mixin to validate that a valid enterprise license exists before allowing to save -/// the object -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct DataExport { - #[serde(rename = "id")] - pub id: uuid::Uuid, - #[serde(rename = "requested_by")] - pub requested_by: models::PartialUser, - #[serde(rename = "requested_on")] - pub requested_on: String, - #[serde(rename = "content_type")] - pub content_type: models::ContentType, - #[serde(rename = "query_params")] - pub query_params: std::collections::HashMap, - #[serde(rename = "file_url")] - pub file_url: String, - #[serde(rename = "completed")] - pub completed: bool, -} - -impl DataExport { - /// Mixin to validate that a valid enterprise license exists before allowing to save the object - pub fn new( - id: uuid::Uuid, - requested_by: models::PartialUser, - requested_on: String, - content_type: models::ContentType, - query_params: std::collections::HashMap, - file_url: String, - completed: bool, - ) -> DataExport { - DataExport { - id, - requested_by, - requested_on, - content_type, - query_params, - file_url, - completed, - } - } -} diff --git a/packages/client-rust/src/models/delivery_method_enum.rs b/packages/client-rust/src/models/delivery_method_enum.rs deleted file mode 100644 index 75752a90d9..0000000000 --- a/packages/client-rust/src/models/delivery_method_enum.rs +++ /dev/null @@ -1,41 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// -#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] -pub enum DeliveryMethodEnum { - #[serde(rename = "https://schemas.openid.net/secevent/risc/delivery-method/push")] - HttpsColonSlashSlashSchemasOpenidNetSlashSeceventSlashRiscSlashDeliveryMethodSlashPush, - #[serde(rename = "https://schemas.openid.net/secevent/risc/delivery-method/poll")] - HttpsColonSlashSlashSchemasOpenidNetSlashSeceventSlashRiscSlashDeliveryMethodSlashPoll, - #[serde(rename = "urn:ietf:rfc:8935")] - UrnColonIetfColonRfcColon8935, - #[serde(rename = "urn:ietf:rfc:8936")] - UrnColonIetfColonRfcColon8936, -} - -impl std::fmt::Display for DeliveryMethodEnum { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - match self { - Self::HttpsColonSlashSlashSchemasOpenidNetSlashSeceventSlashRiscSlashDeliveryMethodSlashPush => write!(f, "https://schemas.openid.net/secevent/risc/delivery-method/push"), - Self::HttpsColonSlashSlashSchemasOpenidNetSlashSeceventSlashRiscSlashDeliveryMethodSlashPoll => write!(f, "https://schemas.openid.net/secevent/risc/delivery-method/poll"), - Self::UrnColonIetfColonRfcColon8935 => write!(f, "urn:ietf:rfc:8935"), - Self::UrnColonIetfColonRfcColon8936 => write!(f, "urn:ietf:rfc:8936"), - } - } -} - -impl Default for DeliveryMethodEnum { - fn default() -> DeliveryMethodEnum { - Self::HttpsColonSlashSlashSchemasOpenidNetSlashSeceventSlashRiscSlashDeliveryMethodSlashPush - } -} diff --git a/packages/client-rust/src/models/denied_action_enum.rs b/packages/client-rust/src/models/denied_action_enum.rs deleted file mode 100644 index af737fe64f..0000000000 --- a/packages/client-rust/src/models/denied_action_enum.rs +++ /dev/null @@ -1,38 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// -#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] -pub enum DeniedActionEnum { - #[serde(rename = "message_continue")] - MessageContinue, - #[serde(rename = "message")] - Message, - #[serde(rename = "continue")] - Continue, -} - -impl std::fmt::Display for DeniedActionEnum { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - match self { - Self::MessageContinue => write!(f, "message_continue"), - Self::Message => write!(f, "message"), - Self::Continue => write!(f, "continue"), - } - } -} - -impl Default for DeniedActionEnum { - fn default() -> DeniedActionEnum { - Self::MessageContinue - } -} diff --git a/packages/client-rust/src/models/deny_stage.rs b/packages/client-rust/src/models/deny_stage.rs deleted file mode 100644 index 3ed39d3810..0000000000 --- a/packages/client-rust/src/models/deny_stage.rs +++ /dev/null @@ -1,60 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// DenyStage : DenyStage Serializer -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct DenyStage { - #[serde(rename = "pk")] - pub pk: uuid::Uuid, - #[serde(rename = "name")] - pub name: String, - /// Get object type so that we know how to edit the object - #[serde(rename = "component")] - pub component: String, - /// Return object's verbose_name - #[serde(rename = "verbose_name")] - pub verbose_name: String, - /// Return object's plural verbose_name - #[serde(rename = "verbose_name_plural")] - pub verbose_name_plural: String, - /// Return internal model name - #[serde(rename = "meta_model_name")] - pub meta_model_name: String, - #[serde(rename = "flow_set")] - pub flow_set: Vec, - #[serde(rename = "deny_message", skip_serializing_if = "Option::is_none")] - pub deny_message: Option, -} - -impl DenyStage { - /// DenyStage Serializer - pub fn new( - pk: uuid::Uuid, - name: String, - component: String, - verbose_name: String, - verbose_name_plural: String, - meta_model_name: String, - flow_set: Vec, - ) -> DenyStage { - DenyStage { - pk, - name, - component, - verbose_name, - verbose_name_plural, - meta_model_name, - flow_set, - deny_message: None, - } - } -} diff --git a/packages/client-rust/src/models/deny_stage_request.rs b/packages/client-rust/src/models/deny_stage_request.rs deleted file mode 100644 index 274e01d060..0000000000 --- a/packages/client-rust/src/models/deny_stage_request.rs +++ /dev/null @@ -1,30 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// DenyStageRequest : DenyStage Serializer -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct DenyStageRequest { - #[serde(rename = "name")] - pub name: String, - #[serde(rename = "deny_message", skip_serializing_if = "Option::is_none")] - pub deny_message: Option, -} - -impl DenyStageRequest { - /// DenyStage Serializer - pub fn new(name: String) -> DenyStageRequest { - DenyStageRequest { - name, - deny_message: None, - } - } -} diff --git a/packages/client-rust/src/models/detailed_country.rs b/packages/client-rust/src/models/detailed_country.rs deleted file mode 100644 index 9e6b6907aa..0000000000 --- a/packages/client-rust/src/models/detailed_country.rs +++ /dev/null @@ -1,25 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct DetailedCountry { - #[serde(rename = "code")] - pub code: models::CountryCodeEnum, - #[serde(rename = "name")] - pub name: String, -} - -impl DetailedCountry { - pub fn new(code: models::CountryCodeEnum, name: String) -> DetailedCountry { - DetailedCountry { code, name } - } -} diff --git a/packages/client-rust/src/models/device.rs b/packages/client-rust/src/models/device.rs deleted file mode 100644 index 7dd6c5d649..0000000000 --- a/packages/client-rust/src/models/device.rs +++ /dev/null @@ -1,79 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// Device : Serializer for authenticator devices -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct Device { - /// Return object's verbose_name - #[serde(rename = "verbose_name")] - pub verbose_name: String, - /// Return object's plural verbose_name - #[serde(rename = "verbose_name_plural")] - pub verbose_name_plural: String, - /// Return internal model name - #[serde(rename = "meta_model_name")] - pub meta_model_name: String, - #[serde(rename = "pk")] - pub pk: String, - #[serde(rename = "name")] - pub name: String, - /// Get type of device - #[serde(rename = "type")] - pub r#type: String, - #[serde(rename = "confirmed")] - pub confirmed: bool, - #[serde(rename = "created")] - pub created: String, - #[serde(rename = "last_updated")] - pub last_updated: String, - #[serde(rename = "last_used", deserialize_with = "Option::deserialize")] - pub last_used: Option, - /// Get extra description - #[serde(rename = "extra_description", deserialize_with = "Option::deserialize")] - pub extra_description: Option, - /// Get external Device ID - #[serde(rename = "external_id", deserialize_with = "Option::deserialize")] - pub external_id: Option, -} - -impl Device { - /// Serializer for authenticator devices - pub fn new( - verbose_name: String, - verbose_name_plural: String, - meta_model_name: String, - pk: String, - name: String, - r#type: String, - confirmed: bool, - created: String, - last_updated: String, - last_used: Option, - extra_description: Option, - external_id: Option, - ) -> Device { - Device { - verbose_name, - verbose_name_plural, - meta_model_name, - pk, - name, - r#type, - confirmed, - created, - last_updated, - last_used, - extra_description, - external_id, - } - } -} diff --git a/packages/client-rust/src/models/device_access_group.rs b/packages/client-rust/src/models/device_access_group.rs deleted file mode 100644 index ef6ab2373c..0000000000 --- a/packages/client-rust/src/models/device_access_group.rs +++ /dev/null @@ -1,31 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct DeviceAccessGroup { - #[serde(rename = "pbm_uuid")] - pub pbm_uuid: uuid::Uuid, - #[serde(rename = "name")] - pub name: String, - #[serde(rename = "attributes", skip_serializing_if = "Option::is_none")] - pub attributes: Option>, -} - -impl DeviceAccessGroup { - pub fn new(pbm_uuid: uuid::Uuid, name: String) -> DeviceAccessGroup { - DeviceAccessGroup { - pbm_uuid, - name, - attributes: None, - } - } -} diff --git a/packages/client-rust/src/models/device_access_group_request.rs b/packages/client-rust/src/models/device_access_group_request.rs deleted file mode 100644 index 4a22747fd9..0000000000 --- a/packages/client-rust/src/models/device_access_group_request.rs +++ /dev/null @@ -1,28 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct DeviceAccessGroupRequest { - #[serde(rename = "name")] - pub name: String, - #[serde(rename = "attributes", skip_serializing_if = "Option::is_none")] - pub attributes: Option>, -} - -impl DeviceAccessGroupRequest { - pub fn new(name: String) -> DeviceAccessGroupRequest { - DeviceAccessGroupRequest { - name, - attributes: None, - } - } -} diff --git a/packages/client-rust/src/models/device_connection.rs b/packages/client-rust/src/models/device_connection.rs deleted file mode 100644 index 52978e7476..0000000000 --- a/packages/client-rust/src/models/device_connection.rs +++ /dev/null @@ -1,39 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct DeviceConnection { - #[serde(rename = "device")] - pub device: uuid::Uuid, - #[serde(rename = "connector")] - pub connector: uuid::Uuid, - #[serde(rename = "connector_obj")] - pub connector_obj: models::Connector, - #[serde(rename = "latest_snapshot", deserialize_with = "Option::deserialize")] - pub latest_snapshot: Option, -} - -impl DeviceConnection { - pub fn new( - device: uuid::Uuid, - connector: uuid::Uuid, - connector_obj: models::Connector, - latest_snapshot: Option, - ) -> DeviceConnection { - DeviceConnection { - device, - connector, - connector_obj, - latest_snapshot, - } - } -} diff --git a/packages/client-rust/src/models/device_fact_snapshot.rs b/packages/client-rust/src/models/device_fact_snapshot.rs deleted file mode 100644 index fc4a96abd6..0000000000 --- a/packages/client-rust/src/models/device_fact_snapshot.rs +++ /dev/null @@ -1,43 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct DeviceFactSnapshot { - #[serde(rename = "data")] - pub data: models::DeviceFacts, - #[serde(rename = "connection")] - pub connection: uuid::Uuid, - #[serde(rename = "created")] - pub created: String, - #[serde(rename = "expires", deserialize_with = "Option::deserialize")] - pub expires: Option, - #[serde(rename = "vendor")] - pub vendor: models::VendorEnum, -} - -impl DeviceFactSnapshot { - pub fn new( - data: models::DeviceFacts, - connection: uuid::Uuid, - created: String, - expires: Option, - vendor: models::VendorEnum, - ) -> DeviceFactSnapshot { - DeviceFactSnapshot { - data, - connection, - created, - expires, - vendor, - } - } -} diff --git a/packages/client-rust/src/models/device_facts.rs b/packages/client-rust/src/models/device_facts.rs deleted file mode 100644 index 2a1d33d0cc..0000000000 --- a/packages/client-rust/src/models/device_facts.rs +++ /dev/null @@ -1,89 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct DeviceFacts { - #[serde( - rename = "os", - default, - with = "::serde_with::rust::double_option", - skip_serializing_if = "Option::is_none" - )] - pub os: Option>, - #[serde( - rename = "disks", - default, - with = "::serde_with::rust::double_option", - skip_serializing_if = "Option::is_none" - )] - pub disks: Option>>, - #[serde( - rename = "network", - default, - with = "::serde_with::rust::double_option", - skip_serializing_if = "Option::is_none" - )] - pub network: Option>, - #[serde( - rename = "hardware", - default, - with = "::serde_with::rust::double_option", - skip_serializing_if = "Option::is_none" - )] - pub hardware: Option>, - #[serde( - rename = "software", - default, - with = "::serde_with::rust::double_option", - skip_serializing_if = "Option::is_none" - )] - pub software: Option>>, - #[serde( - rename = "processes", - default, - with = "::serde_with::rust::double_option", - skip_serializing_if = "Option::is_none" - )] - pub processes: Option>>, - #[serde( - rename = "users", - default, - with = "::serde_with::rust::double_option", - skip_serializing_if = "Option::is_none" - )] - pub users: Option>>, - #[serde( - rename = "groups", - default, - with = "::serde_with::rust::double_option", - skip_serializing_if = "Option::is_none" - )] - pub groups: Option>>, - #[serde(rename = "vendor", skip_serializing_if = "Option::is_none")] - pub vendor: Option>, -} - -impl DeviceFacts { - pub fn new() -> DeviceFacts { - DeviceFacts { - os: None, - disks: None, - network: None, - hardware: None, - software: None, - processes: None, - users: None, - groups: None, - vendor: None, - } - } -} diff --git a/packages/client-rust/src/models/device_facts_os_family.rs b/packages/client-rust/src/models/device_facts_os_family.rs deleted file mode 100644 index 34e948fc9b..0000000000 --- a/packages/client-rust/src/models/device_facts_os_family.rs +++ /dev/null @@ -1,53 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// -#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] -pub enum DeviceFactsOsFamily { - #[serde(rename = "linux")] - Linux, - #[serde(rename = "unix")] - Unix, - #[serde(rename = "bsd")] - Bsd, - #[serde(rename = "windows")] - Windows, - #[serde(rename = "mac_os")] - MacOs, - #[serde(rename = "android")] - Android, - #[serde(rename = "i_os")] - IOs, - #[serde(rename = "other")] - Other, -} - -impl std::fmt::Display for DeviceFactsOsFamily { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - match self { - Self::Linux => write!(f, "linux"), - Self::Unix => write!(f, "unix"), - Self::Bsd => write!(f, "bsd"), - Self::Windows => write!(f, "windows"), - Self::MacOs => write!(f, "mac_os"), - Self::Android => write!(f, "android"), - Self::IOs => write!(f, "i_os"), - Self::Other => write!(f, "other"), - } - } -} - -impl Default for DeviceFactsOsFamily { - fn default() -> DeviceFactsOsFamily { - Self::Linux - } -} diff --git a/packages/client-rust/src/models/device_facts_request.rs b/packages/client-rust/src/models/device_facts_request.rs deleted file mode 100644 index 5a1fa8688b..0000000000 --- a/packages/client-rust/src/models/device_facts_request.rs +++ /dev/null @@ -1,89 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct DeviceFactsRequest { - #[serde( - rename = "os", - default, - with = "::serde_with::rust::double_option", - skip_serializing_if = "Option::is_none" - )] - pub os: Option>, - #[serde( - rename = "disks", - default, - with = "::serde_with::rust::double_option", - skip_serializing_if = "Option::is_none" - )] - pub disks: Option>>, - #[serde( - rename = "network", - default, - with = "::serde_with::rust::double_option", - skip_serializing_if = "Option::is_none" - )] - pub network: Option>, - #[serde( - rename = "hardware", - default, - with = "::serde_with::rust::double_option", - skip_serializing_if = "Option::is_none" - )] - pub hardware: Option>, - #[serde( - rename = "software", - default, - with = "::serde_with::rust::double_option", - skip_serializing_if = "Option::is_none" - )] - pub software: Option>>, - #[serde( - rename = "processes", - default, - with = "::serde_with::rust::double_option", - skip_serializing_if = "Option::is_none" - )] - pub processes: Option>>, - #[serde( - rename = "users", - default, - with = "::serde_with::rust::double_option", - skip_serializing_if = "Option::is_none" - )] - pub users: Option>>, - #[serde( - rename = "groups", - default, - with = "::serde_with::rust::double_option", - skip_serializing_if = "Option::is_none" - )] - pub groups: Option>>, - #[serde(rename = "vendor", skip_serializing_if = "Option::is_none")] - pub vendor: Option>, -} - -impl DeviceFactsRequest { - pub fn new() -> DeviceFactsRequest { - DeviceFactsRequest { - os: None, - disks: None, - network: None, - hardware: None, - software: None, - processes: None, - users: None, - groups: None, - vendor: None, - } - } -} diff --git a/packages/client-rust/src/models/device_group.rs b/packages/client-rust/src/models/device_group.rs deleted file mode 100644 index 22d136769f..0000000000 --- a/packages/client-rust/src/models/device_group.rs +++ /dev/null @@ -1,25 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct DeviceGroup { - #[serde(rename = "id")] - pub id: String, - #[serde(rename = "name", skip_serializing_if = "Option::is_none")] - pub name: Option, -} - -impl DeviceGroup { - pub fn new(id: String) -> DeviceGroup { - DeviceGroup { id, name: None } - } -} diff --git a/packages/client-rust/src/models/device_group_request.rs b/packages/client-rust/src/models/device_group_request.rs deleted file mode 100644 index 4999bbf963..0000000000 --- a/packages/client-rust/src/models/device_group_request.rs +++ /dev/null @@ -1,25 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct DeviceGroupRequest { - #[serde(rename = "id")] - pub id: String, - #[serde(rename = "name", skip_serializing_if = "Option::is_none")] - pub name: Option, -} - -impl DeviceGroupRequest { - pub fn new(id: String) -> DeviceGroupRequest { - DeviceGroupRequest { id, name: None } - } -} diff --git a/packages/client-rust/src/models/device_summary.rs b/packages/client-rust/src/models/device_summary.rs deleted file mode 100644 index 7a4e33b096..0000000000 --- a/packages/client-rust/src/models/device_summary.rs +++ /dev/null @@ -1,37 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// DeviceSummary : Summary of registered devices -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct DeviceSummary { - #[serde(rename = "total_count")] - pub total_count: i32, - #[serde(rename = "unreachable_count")] - pub unreachable_count: i32, - #[serde(rename = "outdated_agent_count")] - pub outdated_agent_count: i32, -} - -impl DeviceSummary { - /// Summary of registered devices - pub fn new( - total_count: i32, - unreachable_count: i32, - outdated_agent_count: i32, - ) -> DeviceSummary { - DeviceSummary { - total_count, - unreachable_count, - outdated_agent_count, - } - } -} diff --git a/packages/client-rust/src/models/device_user.rs b/packages/client-rust/src/models/device_user.rs deleted file mode 100644 index 9dbd020408..0000000000 --- a/packages/client-rust/src/models/device_user.rs +++ /dev/null @@ -1,34 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct DeviceUser { - #[serde(rename = "id")] - pub id: String, - #[serde(rename = "username", skip_serializing_if = "Option::is_none")] - pub username: Option, - #[serde(rename = "name", skip_serializing_if = "Option::is_none")] - pub name: Option, - #[serde(rename = "home", skip_serializing_if = "Option::is_none")] - pub home: Option, -} - -impl DeviceUser { - pub fn new(id: String) -> DeviceUser { - DeviceUser { - id, - username: None, - name: None, - home: None, - } - } -} diff --git a/packages/client-rust/src/models/device_user_binding.rs b/packages/client-rust/src/models/device_user_binding.rs deleted file mode 100644 index 09fb8bac72..0000000000 --- a/packages/client-rust/src/models/device_user_binding.rs +++ /dev/null @@ -1,99 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// DeviceUserBinding : PolicyBinding Serializer -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct DeviceUserBinding { - #[serde(rename = "pk")] - pub pk: uuid::Uuid, - #[serde( - rename = "policy", - default, - with = "::serde_with::rust::double_option", - skip_serializing_if = "Option::is_none" - )] - pub policy: Option>, - #[serde( - rename = "group", - default, - with = "::serde_with::rust::double_option", - skip_serializing_if = "Option::is_none" - )] - pub group: Option>, - #[serde( - rename = "user", - default, - with = "::serde_with::rust::double_option", - skip_serializing_if = "Option::is_none" - )] - pub user: Option>, - #[serde(rename = "policy_obj", deserialize_with = "Option::deserialize")] - pub policy_obj: Option, - #[serde(rename = "group_obj", deserialize_with = "Option::deserialize")] - pub group_obj: Option, - #[serde(rename = "user_obj", deserialize_with = "Option::deserialize")] - pub user_obj: Option, - #[serde(rename = "target")] - pub target: uuid::Uuid, - /// Negates the outcome of the policy. Messages are unaffected. - #[serde(rename = "negate", skip_serializing_if = "Option::is_none")] - pub negate: Option, - #[serde(rename = "enabled", skip_serializing_if = "Option::is_none")] - pub enabled: Option, - #[serde(rename = "order")] - pub order: i32, - /// Timeout after which Policy execution is terminated. - #[serde(rename = "timeout", skip_serializing_if = "Option::is_none")] - pub timeout: Option, - /// Result if the Policy execution fails. - #[serde(rename = "failure_result", skip_serializing_if = "Option::is_none")] - pub failure_result: Option, - #[serde(rename = "is_primary", skip_serializing_if = "Option::is_none")] - pub is_primary: Option, - #[serde(rename = "connector", deserialize_with = "Option::deserialize")] - pub connector: Option, - #[serde(rename = "connector_obj")] - pub connector_obj: models::Connector, -} - -impl DeviceUserBinding { - /// PolicyBinding Serializer - pub fn new( - pk: uuid::Uuid, - policy_obj: Option, - group_obj: Option, - user_obj: Option, - target: uuid::Uuid, - order: i32, - connector: Option, - connector_obj: models::Connector, - ) -> DeviceUserBinding { - DeviceUserBinding { - pk, - policy: None, - group: None, - user: None, - policy_obj, - group_obj, - user_obj, - target, - negate: None, - enabled: None, - order, - timeout: None, - failure_result: None, - is_primary: None, - connector, - connector_obj, - } - } -} diff --git a/packages/client-rust/src/models/device_user_binding_request.rs b/packages/client-rust/src/models/device_user_binding_request.rs deleted file mode 100644 index d98b0d9140..0000000000 --- a/packages/client-rust/src/models/device_user_binding_request.rs +++ /dev/null @@ -1,72 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// DeviceUserBindingRequest : PolicyBinding Serializer -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct DeviceUserBindingRequest { - #[serde( - rename = "policy", - default, - with = "::serde_with::rust::double_option", - skip_serializing_if = "Option::is_none" - )] - pub policy: Option>, - #[serde( - rename = "group", - default, - with = "::serde_with::rust::double_option", - skip_serializing_if = "Option::is_none" - )] - pub group: Option>, - #[serde( - rename = "user", - default, - with = "::serde_with::rust::double_option", - skip_serializing_if = "Option::is_none" - )] - pub user: Option>, - #[serde(rename = "target")] - pub target: uuid::Uuid, - /// Negates the outcome of the policy. Messages are unaffected. - #[serde(rename = "negate", skip_serializing_if = "Option::is_none")] - pub negate: Option, - #[serde(rename = "enabled", skip_serializing_if = "Option::is_none")] - pub enabled: Option, - #[serde(rename = "order")] - pub order: i32, - /// Timeout after which Policy execution is terminated. - #[serde(rename = "timeout", skip_serializing_if = "Option::is_none")] - pub timeout: Option, - /// Result if the Policy execution fails. - #[serde(rename = "failure_result", skip_serializing_if = "Option::is_none")] - pub failure_result: Option, - #[serde(rename = "is_primary", skip_serializing_if = "Option::is_none")] - pub is_primary: Option, -} - -impl DeviceUserBindingRequest { - /// PolicyBinding Serializer - pub fn new(target: uuid::Uuid, order: i32) -> DeviceUserBindingRequest { - DeviceUserBindingRequest { - policy: None, - group: None, - user: None, - target, - negate: None, - enabled: None, - order, - timeout: None, - failure_result: None, - is_primary: None, - } - } -} diff --git a/packages/client-rust/src/models/device_user_request.rs b/packages/client-rust/src/models/device_user_request.rs deleted file mode 100644 index c452753e78..0000000000 --- a/packages/client-rust/src/models/device_user_request.rs +++ /dev/null @@ -1,34 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct DeviceUserRequest { - #[serde(rename = "id")] - pub id: String, - #[serde(rename = "username", skip_serializing_if = "Option::is_none")] - pub username: Option, - #[serde(rename = "name", skip_serializing_if = "Option::is_none")] - pub name: Option, - #[serde(rename = "home", skip_serializing_if = "Option::is_none")] - pub home: Option, -} - -impl DeviceUserRequest { - pub fn new(id: String) -> DeviceUserRequest { - DeviceUserRequest { - id, - username: None, - name: None, - home: None, - } - } -} diff --git a/packages/client-rust/src/models/digest_algorithm_enum.rs b/packages/client-rust/src/models/digest_algorithm_enum.rs deleted file mode 100644 index cb85d7b82c..0000000000 --- a/packages/client-rust/src/models/digest_algorithm_enum.rs +++ /dev/null @@ -1,49 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// -#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] -pub enum DigestAlgorithmEnum { - #[serde(rename = "http://www.w3.org/2000/09/xmldsig#sha1")] - HttpColonSlashSlashWwwW3OrgSlash2000Slash09SlashXmldsigHashSha1, - #[serde(rename = "http://www.w3.org/2001/04/xmlenc#sha256")] - HttpColonSlashSlashWwwW3OrgSlash2001Slash04SlashXmlencHashSha256, - #[serde(rename = "http://www.w3.org/2001/04/xmldsig-more#sha384")] - HttpColonSlashSlashWwwW3OrgSlash2001Slash04SlashXmldsigMoreHashSha384, - #[serde(rename = "http://www.w3.org/2001/04/xmlenc#sha512")] - HttpColonSlashSlashWwwW3OrgSlash2001Slash04SlashXmlencHashSha512, -} - -impl std::fmt::Display for DigestAlgorithmEnum { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - match self { - Self::HttpColonSlashSlashWwwW3OrgSlash2000Slash09SlashXmldsigHashSha1 => { - write!(f, "http://www.w3.org/2000/09/xmldsig#sha1") - } - Self::HttpColonSlashSlashWwwW3OrgSlash2001Slash04SlashXmlencHashSha256 => { - write!(f, "http://www.w3.org/2001/04/xmlenc#sha256") - } - Self::HttpColonSlashSlashWwwW3OrgSlash2001Slash04SlashXmldsigMoreHashSha384 => { - write!(f, "http://www.w3.org/2001/04/xmldsig-more#sha384") - } - Self::HttpColonSlashSlashWwwW3OrgSlash2001Slash04SlashXmlencHashSha512 => { - write!(f, "http://www.w3.org/2001/04/xmlenc#sha512") - } - } - } -} - -impl Default for DigestAlgorithmEnum { - fn default() -> DigestAlgorithmEnum { - Self::HttpColonSlashSlashWwwW3OrgSlash2000Slash09SlashXmldsigHashSha1 - } -} diff --git a/packages/client-rust/src/models/digits_enum.rs b/packages/client-rust/src/models/digits_enum.rs deleted file mode 100644 index 510ff44d70..0000000000 --- a/packages/client-rust/src/models/digits_enum.rs +++ /dev/null @@ -1,35 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// -#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] -pub enum DigitsEnum { - #[serde(rename = "6")] - Variant6, - #[serde(rename = "8")] - Variant8, -} - -impl std::fmt::Display for DigitsEnum { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - match self { - Self::Variant6 => write!(f, "6"), - Self::Variant8 => write!(f, "8"), - } - } -} - -impl Default for DigitsEnum { - fn default() -> DigitsEnum { - Self::Variant6 - } -} diff --git a/packages/client-rust/src/models/disk.rs b/packages/client-rust/src/models/disk.rs deleted file mode 100644 index 7c4d1afdea..0000000000 --- a/packages/client-rust/src/models/disk.rs +++ /dev/null @@ -1,46 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct Disk { - #[serde(rename = "name")] - pub name: String, - #[serde(rename = "mountpoint")] - pub mountpoint: String, - #[serde(rename = "label", skip_serializing_if = "Option::is_none")] - pub label: Option, - #[serde( - rename = "capacity_total_bytes", - skip_serializing_if = "Option::is_none" - )] - pub capacity_total_bytes: Option, - #[serde( - rename = "capacity_used_bytes", - skip_serializing_if = "Option::is_none" - )] - pub capacity_used_bytes: Option, - #[serde(rename = "encryption_enabled", skip_serializing_if = "Option::is_none")] - pub encryption_enabled: Option, -} - -impl Disk { - pub fn new(name: String, mountpoint: String) -> Disk { - Disk { - name, - mountpoint, - label: None, - capacity_total_bytes: None, - capacity_used_bytes: None, - encryption_enabled: None, - } - } -} diff --git a/packages/client-rust/src/models/disk_request.rs b/packages/client-rust/src/models/disk_request.rs deleted file mode 100644 index b4fe9ea6e4..0000000000 --- a/packages/client-rust/src/models/disk_request.rs +++ /dev/null @@ -1,46 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct DiskRequest { - #[serde(rename = "name")] - pub name: String, - #[serde(rename = "mountpoint")] - pub mountpoint: String, - #[serde(rename = "label", skip_serializing_if = "Option::is_none")] - pub label: Option, - #[serde( - rename = "capacity_total_bytes", - skip_serializing_if = "Option::is_none" - )] - pub capacity_total_bytes: Option, - #[serde( - rename = "capacity_used_bytes", - skip_serializing_if = "Option::is_none" - )] - pub capacity_used_bytes: Option, - #[serde(rename = "encryption_enabled", skip_serializing_if = "Option::is_none")] - pub encryption_enabled: Option, -} - -impl DiskRequest { - pub fn new(name: String, mountpoint: String) -> DiskRequest { - DiskRequest { - name, - mountpoint, - label: None, - capacity_total_bytes: None, - capacity_used_bytes: None, - encryption_enabled: None, - } - } -} diff --git a/packages/client-rust/src/models/docker_service_connection.rs b/packages/client-rust/src/models/docker_service_connection.rs deleted file mode 100644 index fe2cec9dfd..0000000000 --- a/packages/client-rust/src/models/docker_service_connection.rs +++ /dev/null @@ -1,80 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// DockerServiceConnection : DockerServiceConnection Serializer -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct DockerServiceConnection { - #[serde(rename = "pk")] - pub pk: uuid::Uuid, - #[serde(rename = "name")] - pub name: String, - /// If enabled, use the local connection. Required Docker socket/Kubernetes Integration - #[serde(rename = "local", skip_serializing_if = "Option::is_none")] - pub local: Option, - #[serde(rename = "component")] - pub component: String, - /// Return object's verbose_name - #[serde(rename = "verbose_name")] - pub verbose_name: String, - /// Return object's plural verbose_name - #[serde(rename = "verbose_name_plural")] - pub verbose_name_plural: String, - /// Return internal model name - #[serde(rename = "meta_model_name")] - pub meta_model_name: String, - /// Can be in the format of 'unix://' when connecting to a local docker daemon, or 'https://:2376' when connecting to a remote system. - #[serde(rename = "url")] - pub url: String, - /// CA which the endpoint's Certificate is verified against. Can be left empty for no - /// validation. - #[serde( - rename = "tls_verification", - default, - with = "::serde_with::rust::double_option", - skip_serializing_if = "Option::is_none" - )] - pub tls_verification: Option>, - /// Certificate/Key used for authentication. Can be left empty for no authentication. - #[serde( - rename = "tls_authentication", - default, - with = "::serde_with::rust::double_option", - skip_serializing_if = "Option::is_none" - )] - pub tls_authentication: Option>, -} - -impl DockerServiceConnection { - /// DockerServiceConnection Serializer - pub fn new( - pk: uuid::Uuid, - name: String, - component: String, - verbose_name: String, - verbose_name_plural: String, - meta_model_name: String, - url: String, - ) -> DockerServiceConnection { - DockerServiceConnection { - pk, - name, - local: None, - component, - verbose_name, - verbose_name_plural, - meta_model_name, - url, - tls_verification: None, - tls_authentication: None, - } - } -} diff --git a/packages/client-rust/src/models/docker_service_connection_request.rs b/packages/client-rust/src/models/docker_service_connection_request.rs deleted file mode 100644 index df47d8e695..0000000000 --- a/packages/client-rust/src/models/docker_service_connection_request.rs +++ /dev/null @@ -1,54 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// DockerServiceConnectionRequest : DockerServiceConnection Serializer -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct DockerServiceConnectionRequest { - #[serde(rename = "name")] - pub name: String, - /// If enabled, use the local connection. Required Docker socket/Kubernetes Integration - #[serde(rename = "local", skip_serializing_if = "Option::is_none")] - pub local: Option, - /// Can be in the format of 'unix://' when connecting to a local docker daemon, or 'https://:2376' when connecting to a remote system. - #[serde(rename = "url")] - pub url: String, - /// CA which the endpoint's Certificate is verified against. Can be left empty for no - /// validation. - #[serde( - rename = "tls_verification", - default, - with = "::serde_with::rust::double_option", - skip_serializing_if = "Option::is_none" - )] - pub tls_verification: Option>, - /// Certificate/Key used for authentication. Can be left empty for no authentication. - #[serde( - rename = "tls_authentication", - default, - with = "::serde_with::rust::double_option", - skip_serializing_if = "Option::is_none" - )] - pub tls_authentication: Option>, -} - -impl DockerServiceConnectionRequest { - /// DockerServiceConnection Serializer - pub fn new(name: String, url: String) -> DockerServiceConnectionRequest { - DockerServiceConnectionRequest { - name, - local: None, - url, - tls_verification: None, - tls_authentication: None, - } - } -} diff --git a/packages/client-rust/src/models/domain.rs b/packages/client-rust/src/models/domain.rs deleted file mode 100644 index d2ad597af2..0000000000 --- a/packages/client-rust/src/models/domain.rs +++ /dev/null @@ -1,36 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// Domain : Domain Serializer -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct Domain { - #[serde(rename = "id")] - pub id: i32, - #[serde(rename = "domain")] - pub domain: String, - #[serde(rename = "is_primary", skip_serializing_if = "Option::is_none")] - pub is_primary: Option, - #[serde(rename = "tenant")] - pub tenant: uuid::Uuid, -} - -impl Domain { - /// Domain Serializer - pub fn new(id: i32, domain: String, tenant: uuid::Uuid) -> Domain { - Domain { - id, - domain, - is_primary: None, - tenant, - } - } -} diff --git a/packages/client-rust/src/models/domain_request.rs b/packages/client-rust/src/models/domain_request.rs deleted file mode 100644 index dc65c52e50..0000000000 --- a/packages/client-rust/src/models/domain_request.rs +++ /dev/null @@ -1,33 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// DomainRequest : Domain Serializer -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct DomainRequest { - #[serde(rename = "domain")] - pub domain: String, - #[serde(rename = "is_primary", skip_serializing_if = "Option::is_none")] - pub is_primary: Option, - #[serde(rename = "tenant")] - pub tenant: uuid::Uuid, -} - -impl DomainRequest { - /// Domain Serializer - pub fn new(domain: String, tenant: uuid::Uuid) -> DomainRequest { - DomainRequest { - domain, - is_primary: None, - tenant, - } - } -} diff --git a/packages/client-rust/src/models/dummy_policy.rs b/packages/client-rust/src/models/dummy_policy.rs deleted file mode 100644 index aa567ad132..0000000000 --- a/packages/client-rust/src/models/dummy_policy.rs +++ /dev/null @@ -1,72 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// DummyPolicy : Dummy Policy Serializer -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct DummyPolicy { - #[serde(rename = "pk")] - pub pk: uuid::Uuid, - #[serde(rename = "name")] - pub name: String, - /// When this option is enabled, all executions of this policy will be logged. By default, only - /// execution errors are logged. - #[serde(rename = "execution_logging", skip_serializing_if = "Option::is_none")] - pub execution_logging: Option, - /// Get object component so that we know how to edit the object - #[serde(rename = "component")] - pub component: String, - /// Return object's verbose_name - #[serde(rename = "verbose_name")] - pub verbose_name: String, - /// Return object's plural verbose_name - #[serde(rename = "verbose_name_plural")] - pub verbose_name_plural: String, - /// Return internal model name - #[serde(rename = "meta_model_name")] - pub meta_model_name: String, - /// Return objects policy is bound to - #[serde(rename = "bound_to")] - pub bound_to: i32, - #[serde(rename = "result", skip_serializing_if = "Option::is_none")] - pub result: Option, - #[serde(rename = "wait_min", skip_serializing_if = "Option::is_none")] - pub wait_min: Option, - #[serde(rename = "wait_max", skip_serializing_if = "Option::is_none")] - pub wait_max: Option, -} - -impl DummyPolicy { - /// Dummy Policy Serializer - pub fn new( - pk: uuid::Uuid, - name: String, - component: String, - verbose_name: String, - verbose_name_plural: String, - meta_model_name: String, - bound_to: i32, - ) -> DummyPolicy { - DummyPolicy { - pk, - name, - execution_logging: None, - component, - verbose_name, - verbose_name_plural, - meta_model_name, - bound_to, - result: None, - wait_min: None, - wait_max: None, - } - } -} diff --git a/packages/client-rust/src/models/dummy_policy_request.rs b/packages/client-rust/src/models/dummy_policy_request.rs deleted file mode 100644 index 2dd07d1c09..0000000000 --- a/packages/client-rust/src/models/dummy_policy_request.rs +++ /dev/null @@ -1,41 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// DummyPolicyRequest : Dummy Policy Serializer -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct DummyPolicyRequest { - #[serde(rename = "name")] - pub name: String, - /// When this option is enabled, all executions of this policy will be logged. By default, only - /// execution errors are logged. - #[serde(rename = "execution_logging", skip_serializing_if = "Option::is_none")] - pub execution_logging: Option, - #[serde(rename = "result", skip_serializing_if = "Option::is_none")] - pub result: Option, - #[serde(rename = "wait_min", skip_serializing_if = "Option::is_none")] - pub wait_min: Option, - #[serde(rename = "wait_max", skip_serializing_if = "Option::is_none")] - pub wait_max: Option, -} - -impl DummyPolicyRequest { - /// Dummy Policy Serializer - pub fn new(name: String) -> DummyPolicyRequest { - DummyPolicyRequest { - name, - execution_logging: None, - result: None, - wait_min: None, - wait_max: None, - } - } -} diff --git a/packages/client-rust/src/models/dummy_stage.rs b/packages/client-rust/src/models/dummy_stage.rs deleted file mode 100644 index f6cc98cfb3..0000000000 --- a/packages/client-rust/src/models/dummy_stage.rs +++ /dev/null @@ -1,60 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// DummyStage : DummyStage Serializer -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct DummyStage { - #[serde(rename = "pk")] - pub pk: uuid::Uuid, - #[serde(rename = "name")] - pub name: String, - /// Get object type so that we know how to edit the object - #[serde(rename = "component")] - pub component: String, - /// Return object's verbose_name - #[serde(rename = "verbose_name")] - pub verbose_name: String, - /// Return object's plural verbose_name - #[serde(rename = "verbose_name_plural")] - pub verbose_name_plural: String, - /// Return internal model name - #[serde(rename = "meta_model_name")] - pub meta_model_name: String, - #[serde(rename = "flow_set")] - pub flow_set: Vec, - #[serde(rename = "throw_error", skip_serializing_if = "Option::is_none")] - pub throw_error: Option, -} - -impl DummyStage { - /// DummyStage Serializer - pub fn new( - pk: uuid::Uuid, - name: String, - component: String, - verbose_name: String, - verbose_name_plural: String, - meta_model_name: String, - flow_set: Vec, - ) -> DummyStage { - DummyStage { - pk, - name, - component, - verbose_name, - verbose_name_plural, - meta_model_name, - flow_set, - throw_error: None, - } - } -} diff --git a/packages/client-rust/src/models/dummy_stage_request.rs b/packages/client-rust/src/models/dummy_stage_request.rs deleted file mode 100644 index 433af742ce..0000000000 --- a/packages/client-rust/src/models/dummy_stage_request.rs +++ /dev/null @@ -1,30 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// DummyStageRequest : DummyStage Serializer -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct DummyStageRequest { - #[serde(rename = "name")] - pub name: String, - #[serde(rename = "throw_error", skip_serializing_if = "Option::is_none")] - pub throw_error: Option, -} - -impl DummyStageRequest { - /// DummyStage Serializer - pub fn new(name: String) -> DummyStageRequest { - DummyStageRequest { - name, - throw_error: None, - } - } -} diff --git a/packages/client-rust/src/models/duo_device.rs b/packages/client-rust/src/models/duo_device.rs deleted file mode 100644 index 95b63d3296..0000000000 --- a/packages/client-rust/src/models/duo_device.rs +++ /dev/null @@ -1,30 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// DuoDevice : Serializer for Duo authenticator devices -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct DuoDevice { - #[serde(rename = "pk")] - pub pk: i32, - /// The human-readable name of this device. - #[serde(rename = "name")] - pub name: String, - #[serde(rename = "user")] - pub user: models::PartialUser, -} - -impl DuoDevice { - /// Serializer for Duo authenticator devices - pub fn new(pk: i32, name: String, user: models::PartialUser) -> DuoDevice { - DuoDevice { pk, name, user } - } -} diff --git a/packages/client-rust/src/models/duo_device_enrollment_status.rs b/packages/client-rust/src/models/duo_device_enrollment_status.rs deleted file mode 100644 index d47f2a8406..0000000000 --- a/packages/client-rust/src/models/duo_device_enrollment_status.rs +++ /dev/null @@ -1,23 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct DuoDeviceEnrollmentStatus { - #[serde(rename = "duo_response")] - pub duo_response: models::DuoResponseEnum, -} - -impl DuoDeviceEnrollmentStatus { - pub fn new(duo_response: models::DuoResponseEnum) -> DuoDeviceEnrollmentStatus { - DuoDeviceEnrollmentStatus { duo_response } - } -} diff --git a/packages/client-rust/src/models/duo_device_request.rs b/packages/client-rust/src/models/duo_device_request.rs deleted file mode 100644 index 6e8020e27e..0000000000 --- a/packages/client-rust/src/models/duo_device_request.rs +++ /dev/null @@ -1,26 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// DuoDeviceRequest : Serializer for Duo authenticator devices -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct DuoDeviceRequest { - /// The human-readable name of this device. - #[serde(rename = "name")] - pub name: String, -} - -impl DuoDeviceRequest { - /// Serializer for Duo authenticator devices - pub fn new(name: String) -> DuoDeviceRequest { - DuoDeviceRequest { name } - } -} diff --git a/packages/client-rust/src/models/duo_response_enum.rs b/packages/client-rust/src/models/duo_response_enum.rs deleted file mode 100644 index f031247afe..0000000000 --- a/packages/client-rust/src/models/duo_response_enum.rs +++ /dev/null @@ -1,38 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// -#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] -pub enum DuoResponseEnum { - #[serde(rename = "success")] - Success, - #[serde(rename = "waiting")] - Waiting, - #[serde(rename = "invalid")] - Invalid, -} - -impl std::fmt::Display for DuoResponseEnum { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - match self { - Self::Success => write!(f, "success"), - Self::Waiting => write!(f, "waiting"), - Self::Invalid => write!(f, "invalid"), - } - } -} - -impl Default for DuoResponseEnum { - fn default() -> DuoResponseEnum { - Self::Success - } -} diff --git a/packages/client-rust/src/models/email_device.rs b/packages/client-rust/src/models/email_device.rs deleted file mode 100644 index ecbe314bf5..0000000000 --- a/packages/client-rust/src/models/email_device.rs +++ /dev/null @@ -1,37 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// EmailDevice : Serializer for email authenticator devices -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct EmailDevice { - /// The human-readable name of this device. - #[serde(rename = "name")] - pub name: String, - #[serde(rename = "pk")] - pub pk: i32, - #[serde(rename = "email")] - pub email: String, - #[serde(rename = "user")] - pub user: models::PartialUser, -} - -impl EmailDevice { - /// Serializer for email authenticator devices - pub fn new(name: String, pk: i32, email: String, user: models::PartialUser) -> EmailDevice { - EmailDevice { - name, - pk, - email, - user, - } - } -} diff --git a/packages/client-rust/src/models/email_device_request.rs b/packages/client-rust/src/models/email_device_request.rs deleted file mode 100644 index 14d8be93e6..0000000000 --- a/packages/client-rust/src/models/email_device_request.rs +++ /dev/null @@ -1,26 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// EmailDeviceRequest : Serializer for email authenticator devices -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct EmailDeviceRequest { - /// The human-readable name of this device. - #[serde(rename = "name")] - pub name: String, -} - -impl EmailDeviceRequest { - /// Serializer for email authenticator devices - pub fn new(name: String) -> EmailDeviceRequest { - EmailDeviceRequest { name } - } -} diff --git a/packages/client-rust/src/models/email_stage.rs b/packages/client-rust/src/models/email_stage.rs deleted file mode 100644 index bc34d640a8..0000000000 --- a/packages/client-rust/src/models/email_stage.rs +++ /dev/null @@ -1,118 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// EmailStage : EmailStage Serializer -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct EmailStage { - #[serde(rename = "pk")] - pub pk: uuid::Uuid, - #[serde(rename = "name")] - pub name: String, - /// Get object type so that we know how to edit the object - #[serde(rename = "component")] - pub component: String, - /// Return object's verbose_name - #[serde(rename = "verbose_name")] - pub verbose_name: String, - /// Return object's plural verbose_name - #[serde(rename = "verbose_name_plural")] - pub verbose_name_plural: String, - /// Return internal model name - #[serde(rename = "meta_model_name")] - pub meta_model_name: String, - #[serde(rename = "flow_set")] - pub flow_set: Vec, - /// When enabled, global Email connection settings will be used and connection settings below - /// will be ignored. - #[serde( - rename = "use_global_settings", - skip_serializing_if = "Option::is_none" - )] - pub use_global_settings: Option, - #[serde(rename = "host", skip_serializing_if = "Option::is_none")] - pub host: Option, - #[serde(rename = "port", skip_serializing_if = "Option::is_none")] - pub port: Option, - #[serde(rename = "username", skip_serializing_if = "Option::is_none")] - pub username: Option, - #[serde(rename = "use_tls", skip_serializing_if = "Option::is_none")] - pub use_tls: Option, - #[serde(rename = "use_ssl", skip_serializing_if = "Option::is_none")] - pub use_ssl: Option, - #[serde(rename = "timeout", skip_serializing_if = "Option::is_none")] - pub timeout: Option, - #[serde(rename = "from_address", skip_serializing_if = "Option::is_none")] - pub from_address: Option, - /// Time the token sent is valid (Format: hours=3,minutes=17,seconds=300). - #[serde(rename = "token_expiry", skip_serializing_if = "Option::is_none")] - pub token_expiry: Option, - #[serde(rename = "subject", skip_serializing_if = "Option::is_none")] - pub subject: Option, - #[serde(rename = "template", skip_serializing_if = "Option::is_none")] - pub template: Option, - /// Activate users upon completion of stage. - #[serde( - rename = "activate_user_on_success", - skip_serializing_if = "Option::is_none" - )] - pub activate_user_on_success: Option, - #[serde( - rename = "recovery_max_attempts", - skip_serializing_if = "Option::is_none" - )] - pub recovery_max_attempts: Option, - /// 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). - #[serde( - rename = "recovery_cache_timeout", - skip_serializing_if = "Option::is_none" - )] - pub recovery_cache_timeout: Option, -} - -impl EmailStage { - /// EmailStage Serializer - pub fn new( - pk: uuid::Uuid, - name: String, - component: String, - verbose_name: String, - verbose_name_plural: String, - meta_model_name: String, - flow_set: Vec, - ) -> EmailStage { - EmailStage { - pk, - name, - component, - verbose_name, - verbose_name_plural, - meta_model_name, - flow_set, - use_global_settings: None, - host: None, - port: None, - username: None, - use_tls: None, - use_ssl: None, - timeout: None, - from_address: None, - token_expiry: None, - subject: None, - template: None, - activate_user_on_success: None, - recovery_max_attempts: None, - recovery_cache_timeout: None, - } - } -} diff --git a/packages/client-rust/src/models/email_stage_request.rs b/packages/client-rust/src/models/email_stage_request.rs deleted file mode 100644 index ee7a9a7e47..0000000000 --- a/packages/client-rust/src/models/email_stage_request.rs +++ /dev/null @@ -1,91 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// EmailStageRequest : EmailStage Serializer -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct EmailStageRequest { - #[serde(rename = "name")] - pub name: String, - /// When enabled, global Email connection settings will be used and connection settings below - /// will be ignored. - #[serde( - rename = "use_global_settings", - skip_serializing_if = "Option::is_none" - )] - pub use_global_settings: Option, - #[serde(rename = "host", skip_serializing_if = "Option::is_none")] - pub host: Option, - #[serde(rename = "port", skip_serializing_if = "Option::is_none")] - pub port: Option, - #[serde(rename = "username", skip_serializing_if = "Option::is_none")] - pub username: Option, - #[serde(rename = "password", skip_serializing_if = "Option::is_none")] - pub password: Option, - #[serde(rename = "use_tls", skip_serializing_if = "Option::is_none")] - pub use_tls: Option, - #[serde(rename = "use_ssl", skip_serializing_if = "Option::is_none")] - pub use_ssl: Option, - #[serde(rename = "timeout", skip_serializing_if = "Option::is_none")] - pub timeout: Option, - #[serde(rename = "from_address", skip_serializing_if = "Option::is_none")] - pub from_address: Option, - /// Time the token sent is valid (Format: hours=3,minutes=17,seconds=300). - #[serde(rename = "token_expiry", skip_serializing_if = "Option::is_none")] - pub token_expiry: Option, - #[serde(rename = "subject", skip_serializing_if = "Option::is_none")] - pub subject: Option, - #[serde(rename = "template", skip_serializing_if = "Option::is_none")] - pub template: Option, - /// Activate users upon completion of stage. - #[serde( - rename = "activate_user_on_success", - skip_serializing_if = "Option::is_none" - )] - pub activate_user_on_success: Option, - #[serde( - rename = "recovery_max_attempts", - skip_serializing_if = "Option::is_none" - )] - pub recovery_max_attempts: Option, - /// 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). - #[serde( - rename = "recovery_cache_timeout", - skip_serializing_if = "Option::is_none" - )] - pub recovery_cache_timeout: Option, -} - -impl EmailStageRequest { - /// EmailStage Serializer - pub fn new(name: String) -> EmailStageRequest { - EmailStageRequest { - name, - use_global_settings: None, - host: None, - port: None, - username: None, - password: None, - use_tls: None, - use_ssl: None, - timeout: None, - from_address: None, - token_expiry: None, - subject: None, - template: None, - activate_user_on_success: None, - recovery_max_attempts: None, - recovery_cache_timeout: None, - } - } -} diff --git a/packages/client-rust/src/models/endpoint.rs b/packages/client-rust/src/models/endpoint.rs deleted file mode 100644 index 51941afe2f..0000000000 --- a/packages/client-rust/src/models/endpoint.rs +++ /dev/null @@ -1,70 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// Endpoint : Endpoint Serializer -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct Endpoint { - #[serde(rename = "pk")] - pub pk: uuid::Uuid, - #[serde(rename = "name")] - pub name: String, - #[serde(rename = "provider")] - pub provider: i32, - #[serde(rename = "provider_obj")] - pub provider_obj: models::RacProvider, - #[serde(rename = "protocol")] - pub protocol: models::ProtocolEnum, - #[serde(rename = "host")] - pub host: String, - #[serde(rename = "settings", skip_serializing_if = "Option::is_none")] - pub settings: Option>, - #[serde(rename = "property_mappings", skip_serializing_if = "Option::is_none")] - pub property_mappings: Option>, - #[serde(rename = "auth_mode")] - pub auth_mode: models::EndpointAuthModeEnum, - /// Build actual launch URL (the provider itself does not have one, just individual endpoints) - #[serde(rename = "launch_url", deserialize_with = "Option::deserialize")] - pub launch_url: Option, - #[serde( - rename = "maximum_connections", - skip_serializing_if = "Option::is_none" - )] - pub maximum_connections: Option, -} - -impl Endpoint { - /// Endpoint Serializer - pub fn new( - pk: uuid::Uuid, - name: String, - provider: i32, - provider_obj: models::RacProvider, - protocol: models::ProtocolEnum, - host: String, - auth_mode: models::EndpointAuthModeEnum, - launch_url: Option, - ) -> Endpoint { - Endpoint { - pk, - name, - provider, - provider_obj, - protocol, - host, - settings: None, - property_mappings: None, - auth_mode, - launch_url, - maximum_connections: None, - } - } -} diff --git a/packages/client-rust/src/models/endpoint_auth_mode_enum.rs b/packages/client-rust/src/models/endpoint_auth_mode_enum.rs deleted file mode 100644 index 36d380d266..0000000000 --- a/packages/client-rust/src/models/endpoint_auth_mode_enum.rs +++ /dev/null @@ -1,35 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// -#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] -pub enum EndpointAuthModeEnum { - #[serde(rename = "static")] - Static, - #[serde(rename = "prompt")] - Prompt, -} - -impl std::fmt::Display for EndpointAuthModeEnum { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - match self { - Self::Static => write!(f, "static"), - Self::Prompt => write!(f, "prompt"), - } - } -} - -impl Default for EndpointAuthModeEnum { - fn default() -> EndpointAuthModeEnum { - Self::Static - } -} diff --git a/packages/client-rust/src/models/endpoint_device.rs b/packages/client-rust/src/models/endpoint_device.rs deleted file mode 100644 index 522d3326bd..0000000000 --- a/packages/client-rust/src/models/endpoint_device.rs +++ /dev/null @@ -1,63 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct EndpointDevice { - #[serde(rename = "device_uuid", skip_serializing_if = "Option::is_none")] - pub device_uuid: Option, - #[serde(rename = "pbm_uuid")] - pub pbm_uuid: uuid::Uuid, - #[serde(rename = "name")] - pub name: String, - #[serde( - rename = "access_group", - default, - with = "::serde_with::rust::double_option", - skip_serializing_if = "Option::is_none" - )] - pub access_group: Option>, - #[serde(rename = "access_group_obj", skip_serializing_if = "Option::is_none")] - pub access_group_obj: Option, - #[serde(rename = "expiring", skip_serializing_if = "Option::is_none")] - pub expiring: Option, - #[serde( - rename = "expires", - default, - with = "::serde_with::rust::double_option", - skip_serializing_if = "Option::is_none" - )] - pub expires: Option>, - #[serde(rename = "facts")] - pub facts: models::DeviceFactSnapshot, - #[serde(rename = "attributes", skip_serializing_if = "Option::is_none")] - pub attributes: Option>, -} - -impl EndpointDevice { - pub fn new( - pbm_uuid: uuid::Uuid, - name: String, - facts: models::DeviceFactSnapshot, - ) -> EndpointDevice { - EndpointDevice { - device_uuid: None, - pbm_uuid, - name, - access_group: None, - access_group_obj: None, - expiring: None, - expires: None, - facts, - attributes: None, - } - } -} diff --git a/packages/client-rust/src/models/endpoint_device_details.rs b/packages/client-rust/src/models/endpoint_device_details.rs deleted file mode 100644 index 1998315509..0000000000 --- a/packages/client-rust/src/models/endpoint_device_details.rs +++ /dev/null @@ -1,75 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct EndpointDeviceDetails { - #[serde(rename = "device_uuid", skip_serializing_if = "Option::is_none")] - pub device_uuid: Option, - #[serde(rename = "pbm_uuid")] - pub pbm_uuid: uuid::Uuid, - #[serde(rename = "name")] - pub name: String, - #[serde( - rename = "access_group", - default, - with = "::serde_with::rust::double_option", - skip_serializing_if = "Option::is_none" - )] - pub access_group: Option>, - #[serde(rename = "access_group_obj", skip_serializing_if = "Option::is_none")] - pub access_group_obj: Option, - #[serde(rename = "expiring", skip_serializing_if = "Option::is_none")] - pub expiring: Option, - #[serde( - rename = "expires", - default, - with = "::serde_with::rust::double_option", - skip_serializing_if = "Option::is_none" - )] - pub expires: Option>, - #[serde(rename = "facts")] - pub facts: models::DeviceFactSnapshot, - #[serde(rename = "attributes", skip_serializing_if = "Option::is_none")] - pub attributes: Option>, - #[serde(rename = "connections_obj")] - pub connections_obj: Vec, - #[serde(rename = "policies")] - pub policies: Vec, - #[serde(rename = "connections")] - pub connections: Vec, -} - -impl EndpointDeviceDetails { - pub fn new( - pbm_uuid: uuid::Uuid, - name: String, - facts: models::DeviceFactSnapshot, - connections_obj: Vec, - policies: Vec, - connections: Vec, - ) -> EndpointDeviceDetails { - EndpointDeviceDetails { - device_uuid: None, - pbm_uuid, - name, - access_group: None, - access_group_obj: None, - expiring: None, - expires: None, - facts, - attributes: None, - connections_obj, - policies, - connections, - } - } -} diff --git a/packages/client-rust/src/models/endpoint_device_request.rs b/packages/client-rust/src/models/endpoint_device_request.rs deleted file mode 100644 index 2cdbe459fb..0000000000 --- a/packages/client-rust/src/models/endpoint_device_request.rs +++ /dev/null @@ -1,53 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct EndpointDeviceRequest { - #[serde(rename = "device_uuid", skip_serializing_if = "Option::is_none")] - pub device_uuid: Option, - #[serde(rename = "name")] - pub name: String, - #[serde( - rename = "access_group", - default, - with = "::serde_with::rust::double_option", - skip_serializing_if = "Option::is_none" - )] - pub access_group: Option>, - #[serde(rename = "access_group_obj", skip_serializing_if = "Option::is_none")] - pub access_group_obj: Option, - #[serde(rename = "expiring", skip_serializing_if = "Option::is_none")] - pub expiring: Option, - #[serde( - rename = "expires", - default, - with = "::serde_with::rust::double_option", - skip_serializing_if = "Option::is_none" - )] - pub expires: Option>, - #[serde(rename = "attributes", skip_serializing_if = "Option::is_none")] - pub attributes: Option>, -} - -impl EndpointDeviceRequest { - pub fn new(name: String) -> EndpointDeviceRequest { - EndpointDeviceRequest { - device_uuid: None, - name, - access_group: None, - access_group_obj: None, - expiring: None, - expires: None, - attributes: None, - } - } -} diff --git a/packages/client-rust/src/models/endpoint_request.rs b/packages/client-rust/src/models/endpoint_request.rs deleted file mode 100644 index 40f4a69528..0000000000 --- a/packages/client-rust/src/models/endpoint_request.rs +++ /dev/null @@ -1,57 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// EndpointRequest : Endpoint Serializer -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct EndpointRequest { - #[serde(rename = "name")] - pub name: String, - #[serde(rename = "provider")] - pub provider: i32, - #[serde(rename = "protocol")] - pub protocol: models::ProtocolEnum, - #[serde(rename = "host")] - pub host: String, - #[serde(rename = "settings", skip_serializing_if = "Option::is_none")] - pub settings: Option>, - #[serde(rename = "property_mappings", skip_serializing_if = "Option::is_none")] - pub property_mappings: Option>, - #[serde(rename = "auth_mode")] - pub auth_mode: models::EndpointAuthModeEnum, - #[serde( - rename = "maximum_connections", - skip_serializing_if = "Option::is_none" - )] - pub maximum_connections: Option, -} - -impl EndpointRequest { - /// Endpoint Serializer - pub fn new( - name: String, - provider: i32, - protocol: models::ProtocolEnum, - host: String, - auth_mode: models::EndpointAuthModeEnum, - ) -> EndpointRequest { - EndpointRequest { - name, - provider, - protocol, - host, - settings: None, - property_mappings: None, - auth_mode, - maximum_connections: None, - } - } -} diff --git a/packages/client-rust/src/models/endpoint_stage.rs b/packages/client-rust/src/models/endpoint_stage.rs deleted file mode 100644 index 5e646e7459..0000000000 --- a/packages/client-rust/src/models/endpoint_stage.rs +++ /dev/null @@ -1,68 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// EndpointStage : EndpointStage Serializer -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct EndpointStage { - #[serde(rename = "pk")] - pub pk: uuid::Uuid, - #[serde(rename = "name")] - pub name: String, - /// Get object type so that we know how to edit the object - #[serde(rename = "component")] - pub component: String, - /// Return object's verbose_name - #[serde(rename = "verbose_name")] - pub verbose_name: String, - /// Return object's plural verbose_name - #[serde(rename = "verbose_name_plural")] - pub verbose_name_plural: String, - /// Return internal model name - #[serde(rename = "meta_model_name")] - pub meta_model_name: String, - #[serde(rename = "flow_set")] - pub flow_set: Vec, - #[serde(rename = "connector")] - pub connector: uuid::Uuid, - #[serde(rename = "connector_obj")] - pub connector_obj: models::Connector, - #[serde(rename = "mode", skip_serializing_if = "Option::is_none")] - pub mode: Option, -} - -impl EndpointStage { - /// EndpointStage Serializer - pub fn new( - pk: uuid::Uuid, - name: String, - component: String, - verbose_name: String, - verbose_name_plural: String, - meta_model_name: String, - flow_set: Vec, - connector: uuid::Uuid, - connector_obj: models::Connector, - ) -> EndpointStage { - EndpointStage { - pk, - name, - component, - verbose_name, - verbose_name_plural, - meta_model_name, - flow_set, - connector, - connector_obj, - mode: None, - } - } -} diff --git a/packages/client-rust/src/models/endpoint_stage_request.rs b/packages/client-rust/src/models/endpoint_stage_request.rs deleted file mode 100644 index ee7f08f587..0000000000 --- a/packages/client-rust/src/models/endpoint_stage_request.rs +++ /dev/null @@ -1,33 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// EndpointStageRequest : EndpointStage Serializer -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct EndpointStageRequest { - #[serde(rename = "name")] - pub name: String, - #[serde(rename = "connector")] - pub connector: uuid::Uuid, - #[serde(rename = "mode", skip_serializing_if = "Option::is_none")] - pub mode: Option, -} - -impl EndpointStageRequest { - /// EndpointStage Serializer - pub fn new(name: String, connector: uuid::Uuid) -> EndpointStageRequest { - EndpointStageRequest { - name, - connector, - mode: None, - } - } -} diff --git a/packages/client-rust/src/models/enroll_request.rs b/packages/client-rust/src/models/enroll_request.rs deleted file mode 100644 index 67e7a407f1..0000000000 --- a/packages/client-rust/src/models/enroll_request.rs +++ /dev/null @@ -1,30 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// EnrollRequest : Base serializer class which doesn't implement create/update methods -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct EnrollRequest { - #[serde(rename = "device_serial")] - pub device_serial: String, - #[serde(rename = "device_name")] - pub device_name: String, -} - -impl EnrollRequest { - /// Base serializer class which doesn't implement create/update methods - pub fn new(device_serial: String, device_name: String) -> EnrollRequest { - EnrollRequest { - device_serial, - device_name, - } - } -} diff --git a/packages/client-rust/src/models/enrollment_token.rs b/packages/client-rust/src/models/enrollment_token.rs deleted file mode 100644 index 73f994e996..0000000000 --- a/packages/client-rust/src/models/enrollment_token.rs +++ /dev/null @@ -1,58 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct EnrollmentToken { - #[serde(rename = "token_uuid")] - pub token_uuid: uuid::Uuid, - #[serde( - rename = "device_group", - default, - with = "::serde_with::rust::double_option", - skip_serializing_if = "Option::is_none" - )] - pub device_group: Option>, - #[serde(rename = "device_group_obj", deserialize_with = "Option::deserialize")] - pub device_group_obj: Option, - #[serde(rename = "connector")] - pub connector: uuid::Uuid, - #[serde(rename = "name")] - pub name: String, - #[serde(rename = "expiring", skip_serializing_if = "Option::is_none")] - pub expiring: Option, - #[serde( - rename = "expires", - default, - with = "::serde_with::rust::double_option", - skip_serializing_if = "Option::is_none" - )] - pub expires: Option>, -} - -impl EnrollmentToken { - pub fn new( - token_uuid: uuid::Uuid, - device_group_obj: Option, - connector: uuid::Uuid, - name: String, - ) -> EnrollmentToken { - EnrollmentToken { - token_uuid, - device_group: None, - device_group_obj, - connector, - name, - expiring: None, - expires: None, - } - } -} diff --git a/packages/client-rust/src/models/enrollment_token_request.rs b/packages/client-rust/src/models/enrollment_token_request.rs deleted file mode 100644 index d4fd7052ae..0000000000 --- a/packages/client-rust/src/models/enrollment_token_request.rs +++ /dev/null @@ -1,47 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct EnrollmentTokenRequest { - #[serde( - rename = "device_group", - default, - with = "::serde_with::rust::double_option", - skip_serializing_if = "Option::is_none" - )] - pub device_group: Option>, - #[serde(rename = "connector")] - pub connector: uuid::Uuid, - #[serde(rename = "name")] - pub name: String, - #[serde(rename = "expiring", skip_serializing_if = "Option::is_none")] - pub expiring: Option, - #[serde( - rename = "expires", - default, - with = "::serde_with::rust::double_option", - skip_serializing_if = "Option::is_none" - )] - pub expires: Option>, -} - -impl EnrollmentTokenRequest { - pub fn new(connector: uuid::Uuid, name: String) -> EnrollmentTokenRequest { - EnrollmentTokenRequest { - device_group: None, - connector, - name, - expiring: None, - expires: None, - } - } -} diff --git a/packages/client-rust/src/models/event_matcher_policy.rs b/packages/client-rust/src/models/event_matcher_policy.rs deleted file mode 100644 index 48aa1e6d60..0000000000 --- a/packages/client-rust/src/models/event_matcher_policy.rs +++ /dev/null @@ -1,102 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// EventMatcherPolicy : Event Matcher Policy Serializer -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct EventMatcherPolicy { - #[serde(rename = "pk")] - pub pk: uuid::Uuid, - #[serde(rename = "name")] - pub name: String, - /// When this option is enabled, all executions of this policy will be logged. By default, only - /// execution errors are logged. - #[serde(rename = "execution_logging", skip_serializing_if = "Option::is_none")] - pub execution_logging: Option, - /// Get object component so that we know how to edit the object - #[serde(rename = "component")] - pub component: String, - /// Return object's verbose_name - #[serde(rename = "verbose_name")] - pub verbose_name: String, - /// Return object's plural verbose_name - #[serde(rename = "verbose_name_plural")] - pub verbose_name_plural: String, - /// Return internal model name - #[serde(rename = "meta_model_name")] - pub meta_model_name: String, - /// Return objects policy is bound to - #[serde(rename = "bound_to")] - pub bound_to: i32, - /// Match created events with this action type. When left empty, all action types will be - /// matched. - #[serde( - rename = "action", - default, - with = "::serde_with::rust::double_option", - skip_serializing_if = "Option::is_none" - )] - pub action: Option>, - /// Matches Event's Client IP (strict matching, for network matching use an Expression Policy) - #[serde( - rename = "client_ip", - default, - with = "::serde_with::rust::double_option", - skip_serializing_if = "Option::is_none" - )] - pub client_ip: Option>, - /// Match events created by selected application. When left empty, all applications are - /// matched. - #[serde( - rename = "app", - default, - with = "::serde_with::rust::double_option", - skip_serializing_if = "Option::is_none" - )] - pub app: Option>, - /// 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. - #[serde( - rename = "model", - default, - with = "::serde_with::rust::double_option", - skip_serializing_if = "Option::is_none" - )] - pub model: Option>, -} - -impl EventMatcherPolicy { - /// Event Matcher Policy Serializer - pub fn new( - pk: uuid::Uuid, - name: String, - component: String, - verbose_name: String, - verbose_name_plural: String, - meta_model_name: String, - bound_to: i32, - ) -> EventMatcherPolicy { - EventMatcherPolicy { - pk, - name, - execution_logging: None, - component, - verbose_name, - verbose_name_plural, - meta_model_name, - bound_to, - action: None, - client_ip: None, - app: None, - model: None, - } - } -} diff --git a/packages/client-rust/src/models/event_matcher_policy_request.rs b/packages/client-rust/src/models/event_matcher_policy_request.rs deleted file mode 100644 index fba6b64673..0000000000 --- a/packages/client-rust/src/models/event_matcher_policy_request.rs +++ /dev/null @@ -1,71 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// EventMatcherPolicyRequest : Event Matcher Policy Serializer -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct EventMatcherPolicyRequest { - #[serde(rename = "name")] - pub name: String, - /// When this option is enabled, all executions of this policy will be logged. By default, only - /// execution errors are logged. - #[serde(rename = "execution_logging", skip_serializing_if = "Option::is_none")] - pub execution_logging: Option, - /// Match created events with this action type. When left empty, all action types will be - /// matched. - #[serde( - rename = "action", - default, - with = "::serde_with::rust::double_option", - skip_serializing_if = "Option::is_none" - )] - pub action: Option>, - /// Matches Event's Client IP (strict matching, for network matching use an Expression Policy) - #[serde( - rename = "client_ip", - default, - with = "::serde_with::rust::double_option", - skip_serializing_if = "Option::is_none" - )] - pub client_ip: Option>, - /// Match events created by selected application. When left empty, all applications are - /// matched. - #[serde( - rename = "app", - default, - with = "::serde_with::rust::double_option", - skip_serializing_if = "Option::is_none" - )] - pub app: Option>, - /// 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. - #[serde( - rename = "model", - default, - with = "::serde_with::rust::double_option", - skip_serializing_if = "Option::is_none" - )] - pub model: Option>, -} - -impl EventMatcherPolicyRequest { - /// Event Matcher Policy Serializer - pub fn new(name: String) -> EventMatcherPolicyRequest { - EventMatcherPolicyRequest { - name, - execution_logging: None, - action: None, - client_ip: None, - app: None, - model: None, - } - } -} diff --git a/packages/client-rust/src/models/event_stats.rs b/packages/client-rust/src/models/event_stats.rs deleted file mode 100644 index 1ff8844a1a..0000000000 --- a/packages/client-rust/src/models/event_stats.rs +++ /dev/null @@ -1,33 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// EventStats : Count of unique users in events and aggregated counts per specified deltas -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct EventStats { - #[serde(rename = "unique_users")] - pub unique_users: i32, - #[serde(rename = "count_step")] - pub count_step: std::collections::HashMap, -} - -impl EventStats { - /// Count of unique users in events and aggregated counts per specified deltas - pub fn new( - unique_users: i32, - count_step: std::collections::HashMap, - ) -> EventStats { - EventStats { - unique_users, - count_step, - } - } -} diff --git a/packages/client-rust/src/models/event_top_per_user.rs b/packages/client-rust/src/models/event_top_per_user.rs deleted file mode 100644 index b346c33a0b..0000000000 --- a/packages/client-rust/src/models/event_top_per_user.rs +++ /dev/null @@ -1,37 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// EventTopPerUser : Response object of Event's top_per_user -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct EventTopPerUser { - #[serde(rename = "application")] - pub application: std::collections::HashMap, - #[serde(rename = "counted_events")] - pub counted_events: i32, - #[serde(rename = "unique_users")] - pub unique_users: i32, -} - -impl EventTopPerUser { - /// Response object of Event's top_per_user - pub fn new( - application: std::collections::HashMap, - counted_events: i32, - unique_users: i32, - ) -> EventTopPerUser { - EventTopPerUser { - application, - counted_events, - unique_users, - } - } -} diff --git a/packages/client-rust/src/models/event_volume.rs b/packages/client-rust/src/models/event_volume.rs deleted file mode 100644 index 99a8aa72f3..0000000000 --- a/packages/client-rust/src/models/event_volume.rs +++ /dev/null @@ -1,33 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// EventVolume : Count of events of action created on day for a single event action -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct EventVolume { - #[serde(rename = "action")] - pub action: models::EventActions, - #[serde(rename = "time")] - pub time: String, - #[serde(rename = "count")] - pub count: i32, -} - -impl EventVolume { - /// Count of events of action created on day for a single event action - pub fn new(action: models::EventActions, time: String, count: i32) -> EventVolume { - EventVolume { - action, - time, - count, - } - } -} diff --git a/packages/client-rust/src/models/events_requested_enum.rs b/packages/client-rust/src/models/events_requested_enum.rs deleted file mode 100644 index 637f14651d..0000000000 --- a/packages/client-rust/src/models/events_requested_enum.rs +++ /dev/null @@ -1,38 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// -#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] -pub enum EventsRequestedEnum { - #[serde(rename = "https://schemas.openid.net/secevent/caep/event-type/session-revoked")] - HttpsColonSlashSlashSchemasOpenidNetSlashSeceventSlashCaepSlashEventTypeSlashSessionRevoked, - #[serde(rename = "https://schemas.openid.net/secevent/caep/event-type/credential-change")] - HttpsColonSlashSlashSchemasOpenidNetSlashSeceventSlashCaepSlashEventTypeSlashCredentialChange, - #[serde(rename = "https://schemas.openid.net/secevent/ssf/event-type/verification")] - HttpsColonSlashSlashSchemasOpenidNetSlashSeceventSlashSsfSlashEventTypeSlashVerification, -} - -impl std::fmt::Display for EventsRequestedEnum { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - match self { - Self::HttpsColonSlashSlashSchemasOpenidNetSlashSeceventSlashCaepSlashEventTypeSlashSessionRevoked => write!(f, "https://schemas.openid.net/secevent/caep/event-type/session-revoked"), - Self::HttpsColonSlashSlashSchemasOpenidNetSlashSeceventSlashCaepSlashEventTypeSlashCredentialChange => write!(f, "https://schemas.openid.net/secevent/caep/event-type/credential-change"), - Self::HttpsColonSlashSlashSchemasOpenidNetSlashSeceventSlashSsfSlashEventTypeSlashVerification => write!(f, "https://schemas.openid.net/secevent/ssf/event-type/verification"), - } - } -} - -impl Default for EventsRequestedEnum { - fn default() -> EventsRequestedEnum { - Self::HttpsColonSlashSlashSchemasOpenidNetSlashSeceventSlashCaepSlashEventTypeSlashSessionRevoked - } -} diff --git a/packages/client-rust/src/models/expiring_base_grant_model.rs b/packages/client-rust/src/models/expiring_base_grant_model.rs deleted file mode 100644 index d20d192011..0000000000 --- a/packages/client-rust/src/models/expiring_base_grant_model.rs +++ /dev/null @@ -1,54 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// ExpiringBaseGrantModel : Serializer for BaseGrantModel and ExpiringBaseGrant -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct ExpiringBaseGrantModel { - #[serde(rename = "pk")] - pub pk: i32, - #[serde(rename = "provider")] - pub provider: models::OAuth2Provider, - #[serde(rename = "user")] - pub user: models::User, - /// Check if token is expired yet. - #[serde(rename = "is_expired")] - pub is_expired: bool, - #[serde( - rename = "expires", - default, - with = "::serde_with::rust::double_option", - skip_serializing_if = "Option::is_none" - )] - pub expires: Option>, - #[serde(rename = "scope")] - pub scope: Vec, -} - -impl ExpiringBaseGrantModel { - /// Serializer for BaseGrantModel and ExpiringBaseGrant - pub fn new( - pk: i32, - provider: models::OAuth2Provider, - user: models::User, - is_expired: bool, - scope: Vec, - ) -> ExpiringBaseGrantModel { - ExpiringBaseGrantModel { - pk, - provider, - user, - is_expired, - expires: None, - scope, - } - } -} diff --git a/packages/client-rust/src/models/expression_policy.rs b/packages/client-rust/src/models/expression_policy.rs deleted file mode 100644 index 197e6a8eff..0000000000 --- a/packages/client-rust/src/models/expression_policy.rs +++ /dev/null @@ -1,67 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// ExpressionPolicy : Group Membership Policy Serializer -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct ExpressionPolicy { - #[serde(rename = "pk")] - pub pk: uuid::Uuid, - #[serde(rename = "name")] - pub name: String, - /// When this option is enabled, all executions of this policy will be logged. By default, only - /// execution errors are logged. - #[serde(rename = "execution_logging", skip_serializing_if = "Option::is_none")] - pub execution_logging: Option, - /// Get object component so that we know how to edit the object - #[serde(rename = "component")] - pub component: String, - /// Return object's verbose_name - #[serde(rename = "verbose_name")] - pub verbose_name: String, - /// Return object's plural verbose_name - #[serde(rename = "verbose_name_plural")] - pub verbose_name_plural: String, - /// Return internal model name - #[serde(rename = "meta_model_name")] - pub meta_model_name: String, - /// Return objects policy is bound to - #[serde(rename = "bound_to")] - pub bound_to: i32, - #[serde(rename = "expression")] - pub expression: String, -} - -impl ExpressionPolicy { - /// Group Membership Policy Serializer - pub fn new( - pk: uuid::Uuid, - name: String, - component: String, - verbose_name: String, - verbose_name_plural: String, - meta_model_name: String, - bound_to: i32, - expression: String, - ) -> ExpressionPolicy { - ExpressionPolicy { - pk, - name, - execution_logging: None, - component, - verbose_name, - verbose_name_plural, - meta_model_name, - bound_to, - expression, - } - } -} diff --git a/packages/client-rust/src/models/expression_policy_request.rs b/packages/client-rust/src/models/expression_policy_request.rs deleted file mode 100644 index 8a0a0baa95..0000000000 --- a/packages/client-rust/src/models/expression_policy_request.rs +++ /dev/null @@ -1,35 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// ExpressionPolicyRequest : Group Membership Policy Serializer -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct ExpressionPolicyRequest { - #[serde(rename = "name")] - pub name: String, - /// When this option is enabled, all executions of this policy will be logged. By default, only - /// execution errors are logged. - #[serde(rename = "execution_logging", skip_serializing_if = "Option::is_none")] - pub execution_logging: Option, - #[serde(rename = "expression")] - pub expression: String, -} - -impl ExpressionPolicyRequest { - /// Group Membership Policy Serializer - pub fn new(name: String, expression: String) -> ExpressionPolicyRequest { - ExpressionPolicyRequest { - name, - execution_logging: None, - expression, - } - } -} diff --git a/packages/client-rust/src/models/extra_role_object_permission.rs b/packages/client-rust/src/models/extra_role_object_permission.rs deleted file mode 100644 index 9cc40c4e18..0000000000 --- a/packages/client-rust/src/models/extra_role_object_permission.rs +++ /dev/null @@ -1,68 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// ExtraRoleObjectPermission : Role permission with additional object-related data -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct ExtraRoleObjectPermission { - #[serde(rename = "id")] - pub id: i32, - #[serde(rename = "codename")] - pub codename: String, - #[serde(rename = "model")] - pub model: String, - #[serde(rename = "app_label")] - pub app_label: String, - #[serde(rename = "object_pk")] - pub object_pk: String, - #[serde(rename = "name")] - pub name: String, - /// Get app label from permission's model - #[serde(rename = "app_label_verbose")] - pub app_label_verbose: String, - /// Get model label from permission's model - #[serde(rename = "model_verbose")] - pub model_verbose: String, - /// 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 - #[serde( - rename = "object_description", - deserialize_with = "Option::deserialize" - )] - pub object_description: Option, -} - -impl ExtraRoleObjectPermission { - /// Role permission with additional object-related data - pub fn new( - id: i32, - codename: String, - model: String, - app_label: String, - object_pk: String, - name: String, - app_label_verbose: String, - model_verbose: String, - object_description: Option, - ) -> ExtraRoleObjectPermission { - ExtraRoleObjectPermission { - id, - codename, - model, - app_label, - object_pk, - name, - app_label_verbose, - model_verbose, - object_description, - } - } -} diff --git a/packages/client-rust/src/models/file_list.rs b/packages/client-rust/src/models/file_list.rs deleted file mode 100644 index 71b464283e..0000000000 --- a/packages/client-rust/src/models/file_list.rs +++ /dev/null @@ -1,41 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// FileList : Base serializer class which doesn't implement create/update methods -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct FileList { - #[serde(rename = "name")] - pub name: String, - #[serde(rename = "mime_type")] - pub mime_type: String, - #[serde(rename = "url")] - pub url: String, - #[serde( - rename = "themed_urls", - default, - with = "::serde_with::rust::double_option", - skip_serializing_if = "Option::is_none" - )] - pub themed_urls: Option>, -} - -impl FileList { - /// Base serializer class which doesn't implement create/update methods - pub fn new(name: String, mime_type: String, url: String) -> FileList { - FileList { - name, - mime_type, - url, - themed_urls: None, - } - } -} diff --git a/packages/client-rust/src/models/fleet_connector.rs b/packages/client-rust/src/models/fleet_connector.rs deleted file mode 100644 index 995f65a8cd..0000000000 --- a/packages/client-rust/src/models/fleet_connector.rs +++ /dev/null @@ -1,78 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// FleetConnector : FleetConnector Serializer -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct FleetConnector { - #[serde(rename = "connector_uuid", skip_serializing_if = "Option::is_none")] - pub connector_uuid: Option, - #[serde(rename = "name")] - pub name: String, - #[serde(rename = "enabled", skip_serializing_if = "Option::is_none")] - pub enabled: Option, - /// Get object component so that we know how to edit the object - #[serde(rename = "component")] - pub component: String, - /// Return object's verbose_name - #[serde(rename = "verbose_name")] - pub verbose_name: String, - /// Return object's plural verbose_name - #[serde(rename = "verbose_name_plural")] - pub verbose_name_plural: String, - /// Return internal model name - #[serde(rename = "meta_model_name")] - pub meta_model_name: String, - #[serde(rename = "url")] - pub url: String, - /// Configure additional headers to be sent. Mapping should return a dictionary of key-value - /// pairs - #[serde( - rename = "headers_mapping", - default, - with = "::serde_with::rust::double_option", - skip_serializing_if = "Option::is_none" - )] - pub headers_mapping: Option>, - #[serde(rename = "map_users", skip_serializing_if = "Option::is_none")] - pub map_users: Option, - #[serde( - rename = "map_teams_access_group", - skip_serializing_if = "Option::is_none" - )] - pub map_teams_access_group: Option, -} - -impl FleetConnector { - /// FleetConnector Serializer - pub fn new( - name: String, - component: String, - verbose_name: String, - verbose_name_plural: String, - meta_model_name: String, - url: String, - ) -> FleetConnector { - FleetConnector { - connector_uuid: None, - name, - enabled: None, - component, - verbose_name, - verbose_name_plural, - meta_model_name, - url, - headers_mapping: None, - map_users: None, - map_teams_access_group: None, - } - } -} diff --git a/packages/client-rust/src/models/fleet_connector_request.rs b/packages/client-rust/src/models/fleet_connector_request.rs deleted file mode 100644 index 42b90a6ff8..0000000000 --- a/packages/client-rust/src/models/fleet_connector_request.rs +++ /dev/null @@ -1,58 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// FleetConnectorRequest : FleetConnector Serializer -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct FleetConnectorRequest { - #[serde(rename = "connector_uuid", skip_serializing_if = "Option::is_none")] - pub connector_uuid: Option, - #[serde(rename = "name")] - pub name: String, - #[serde(rename = "enabled", skip_serializing_if = "Option::is_none")] - pub enabled: Option, - #[serde(rename = "url")] - pub url: String, - #[serde(rename = "token")] - pub token: String, - /// Configure additional headers to be sent. Mapping should return a dictionary of key-value - /// pairs - #[serde( - rename = "headers_mapping", - default, - with = "::serde_with::rust::double_option", - skip_serializing_if = "Option::is_none" - )] - pub headers_mapping: Option>, - #[serde(rename = "map_users", skip_serializing_if = "Option::is_none")] - pub map_users: Option, - #[serde( - rename = "map_teams_access_group", - skip_serializing_if = "Option::is_none" - )] - pub map_teams_access_group: Option, -} - -impl FleetConnectorRequest { - /// FleetConnector Serializer - pub fn new(name: String, url: String, token: String) -> FleetConnectorRequest { - FleetConnectorRequest { - connector_uuid: None, - name, - enabled: None, - url, - token, - headers_mapping: None, - map_users: None, - map_teams_access_group: None, - } - } -} diff --git a/packages/client-rust/src/models/flow.rs b/packages/client-rust/src/models/flow.rs deleted file mode 100644 index a21a91dc2b..0000000000 --- a/packages/client-rust/src/models/flow.rs +++ /dev/null @@ -1,106 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// Flow : Flow Serializer -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct Flow { - #[serde(rename = "pk")] - pub pk: uuid::Uuid, - #[serde(rename = "policybindingmodel_ptr_id")] - pub policybindingmodel_ptr_id: uuid::Uuid, - #[serde(rename = "name")] - pub name: String, - /// Visible in the URL. - #[serde(rename = "slug")] - pub slug: String, - /// Shown as the Title in Flow pages. - #[serde(rename = "title")] - pub title: String, - /// Decides what this Flow is used for. For example, the Authentication flow is redirect to - /// when an un-authenticated user visits authentik. - #[serde(rename = "designation")] - pub designation: models::FlowDesignationEnum, - /// Background shown during execution - #[serde(rename = "background", skip_serializing_if = "Option::is_none")] - pub background: Option, - /// Get the URL to the background image - #[serde(rename = "background_url")] - pub background_url: String, - #[serde( - rename = "background_themed_urls", - deserialize_with = "Option::deserialize" - )] - pub background_themed_urls: Option, - #[serde(rename = "stages")] - pub stages: Vec, - #[serde(rename = "policies")] - pub policies: Vec, - /// Get count of cached flows - #[serde(rename = "cache_count")] - pub cache_count: i32, - #[serde(rename = "policy_engine_mode", skip_serializing_if = "Option::is_none")] - pub policy_engine_mode: Option, - /// Enable compatibility mode, increases compatibility with password managers on mobile - /// devices. - #[serde(rename = "compatibility_mode", skip_serializing_if = "Option::is_none")] - pub compatibility_mode: Option, - /// Get export URL for flow - #[serde(rename = "export_url")] - pub export_url: String, - #[serde(rename = "layout", skip_serializing_if = "Option::is_none")] - pub layout: Option, - /// Configure what should happen when a flow denies access to a user. - #[serde(rename = "denied_action", skip_serializing_if = "Option::is_none")] - pub denied_action: Option, - /// Required level of authentication and authorization to access a flow. - #[serde(rename = "authentication", skip_serializing_if = "Option::is_none")] - pub authentication: Option, -} - -impl Flow { - /// Flow Serializer - pub fn new( - pk: uuid::Uuid, - policybindingmodel_ptr_id: uuid::Uuid, - name: String, - slug: String, - title: String, - designation: models::FlowDesignationEnum, - background_url: String, - background_themed_urls: Option, - stages: Vec, - policies: Vec, - cache_count: i32, - export_url: String, - ) -> Flow { - Flow { - pk, - policybindingmodel_ptr_id, - name, - slug, - title, - designation, - background: None, - background_url, - background_themed_urls, - stages, - policies, - cache_count, - policy_engine_mode: None, - compatibility_mode: None, - export_url, - layout: None, - denied_action: None, - authentication: None, - } - } -} diff --git a/packages/client-rust/src/models/flow_diagram.rs b/packages/client-rust/src/models/flow_diagram.rs deleted file mode 100644 index 0b2f0438ec..0000000000 --- a/packages/client-rust/src/models/flow_diagram.rs +++ /dev/null @@ -1,25 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// FlowDiagram : response of the flow's diagram action -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct FlowDiagram { - #[serde(rename = "diagram")] - pub diagram: String, -} - -impl FlowDiagram { - /// response of the flow's diagram action - pub fn new(diagram: String) -> FlowDiagram { - FlowDiagram { diagram } - } -} diff --git a/packages/client-rust/src/models/flow_inspection.rs b/packages/client-rust/src/models/flow_inspection.rs deleted file mode 100644 index 66b6278c8f..0000000000 --- a/packages/client-rust/src/models/flow_inspection.rs +++ /dev/null @@ -1,33 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// FlowInspection : Serializer for inspect endpoint -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct FlowInspection { - #[serde(rename = "plans")] - pub plans: Vec, - #[serde(rename = "current_plan", skip_serializing_if = "Option::is_none")] - pub current_plan: Option, - #[serde(rename = "is_completed")] - pub is_completed: bool, -} - -impl FlowInspection { - /// Serializer for inspect endpoint - pub fn new(plans: Vec, is_completed: bool) -> FlowInspection { - FlowInspection { - plans, - current_plan: None, - is_completed, - } - } -} diff --git a/packages/client-rust/src/models/flow_inspector_plan.rs b/packages/client-rust/src/models/flow_inspector_plan.rs deleted file mode 100644 index 40d6fc09f7..0000000000 --- a/packages/client-rust/src/models/flow_inspector_plan.rs +++ /dev/null @@ -1,43 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// FlowInspectorPlan : Serializer for an active FlowPlan -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct FlowInspectorPlan { - #[serde(rename = "current_stage")] - pub current_stage: models::FlowStageBinding, - #[serde(rename = "next_planned_stage")] - pub next_planned_stage: models::FlowStageBinding, - /// Get the plan's context, sanitized - #[serde(rename = "plan_context")] - pub plan_context: std::collections::HashMap, - /// Get a unique session ID - #[serde(rename = "session_id")] - pub session_id: String, -} - -impl FlowInspectorPlan { - /// Serializer for an active FlowPlan - pub fn new( - current_stage: models::FlowStageBinding, - next_planned_stage: models::FlowStageBinding, - plan_context: std::collections::HashMap, - session_id: String, - ) -> FlowInspectorPlan { - FlowInspectorPlan { - current_stage, - next_planned_stage, - plan_context, - session_id, - } - } -} diff --git a/packages/client-rust/src/models/flow_layout_enum.rs b/packages/client-rust/src/models/flow_layout_enum.rs deleted file mode 100644 index b5fa759eb3..0000000000 --- a/packages/client-rust/src/models/flow_layout_enum.rs +++ /dev/null @@ -1,50 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// -#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] -pub enum FlowLayoutEnum { - #[serde(rename = "stacked")] - Stacked, - #[serde(rename = "content_left")] - ContentLeft, - #[serde(rename = "content_right")] - ContentRight, - #[serde(rename = "sidebar_left")] - SidebarLeft, - #[serde(rename = "sidebar_right")] - SidebarRight, - #[serde(rename = "sidebar_left_frame_background")] - SidebarLeftFrameBackground, - #[serde(rename = "sidebar_right_frame_background")] - SidebarRightFrameBackground, -} - -impl std::fmt::Display for FlowLayoutEnum { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - match self { - Self::Stacked => write!(f, "stacked"), - Self::ContentLeft => write!(f, "content_left"), - Self::ContentRight => write!(f, "content_right"), - Self::SidebarLeft => write!(f, "sidebar_left"), - Self::SidebarRight => write!(f, "sidebar_right"), - Self::SidebarLeftFrameBackground => write!(f, "sidebar_left_frame_background"), - Self::SidebarRightFrameBackground => write!(f, "sidebar_right_frame_background"), - } - } -} - -impl Default for FlowLayoutEnum { - fn default() -> FlowLayoutEnum { - Self::Stacked - } -} diff --git a/packages/client-rust/src/models/flow_request.rs b/packages/client-rust/src/models/flow_request.rs deleted file mode 100644 index a832b22e53..0000000000 --- a/packages/client-rust/src/models/flow_request.rs +++ /dev/null @@ -1,68 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// FlowRequest : Flow Serializer -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct FlowRequest { - #[serde(rename = "name")] - pub name: String, - /// Visible in the URL. - #[serde(rename = "slug")] - pub slug: String, - /// Shown as the Title in Flow pages. - #[serde(rename = "title")] - pub title: String, - /// Decides what this Flow is used for. For example, the Authentication flow is redirect to - /// when an un-authenticated user visits authentik. - #[serde(rename = "designation")] - pub designation: models::FlowDesignationEnum, - /// Background shown during execution - #[serde(rename = "background", skip_serializing_if = "Option::is_none")] - pub background: Option, - #[serde(rename = "policy_engine_mode", skip_serializing_if = "Option::is_none")] - pub policy_engine_mode: Option, - /// Enable compatibility mode, increases compatibility with password managers on mobile - /// devices. - #[serde(rename = "compatibility_mode", skip_serializing_if = "Option::is_none")] - pub compatibility_mode: Option, - #[serde(rename = "layout", skip_serializing_if = "Option::is_none")] - pub layout: Option, - /// Configure what should happen when a flow denies access to a user. - #[serde(rename = "denied_action", skip_serializing_if = "Option::is_none")] - pub denied_action: Option, - /// Required level of authentication and authorization to access a flow. - #[serde(rename = "authentication", skip_serializing_if = "Option::is_none")] - pub authentication: Option, -} - -impl FlowRequest { - /// Flow Serializer - pub fn new( - name: String, - slug: String, - title: String, - designation: models::FlowDesignationEnum, - ) -> FlowRequest { - FlowRequest { - name, - slug, - title, - designation, - background: None, - policy_engine_mode: None, - compatibility_mode: None, - layout: None, - denied_action: None, - authentication: None, - } - } -} diff --git a/packages/client-rust/src/models/flow_set.rs b/packages/client-rust/src/models/flow_set.rs deleted file mode 100644 index 81432e3a3b..0000000000 --- a/packages/client-rust/src/models/flow_set.rs +++ /dev/null @@ -1,78 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// FlowSet : Stripped down flow serializer -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct FlowSet { - #[serde(rename = "pk")] - pub pk: uuid::Uuid, - #[serde(rename = "policybindingmodel_ptr_id")] - pub policybindingmodel_ptr_id: uuid::Uuid, - #[serde(rename = "name")] - pub name: String, - /// Visible in the URL. - #[serde(rename = "slug")] - pub slug: String, - /// Shown as the Title in Flow pages. - #[serde(rename = "title")] - pub title: String, - /// Decides what this Flow is used for. For example, the Authentication flow is redirect to - /// when an un-authenticated user visits authentik. - #[serde(rename = "designation")] - pub designation: models::FlowDesignationEnum, - /// Get the URL to the background image - #[serde(rename = "background_url")] - pub background_url: String, - #[serde(rename = "policy_engine_mode", skip_serializing_if = "Option::is_none")] - pub policy_engine_mode: Option, - /// Enable compatibility mode, increases compatibility with password managers on mobile - /// devices. - #[serde(rename = "compatibility_mode", skip_serializing_if = "Option::is_none")] - pub compatibility_mode: Option, - /// Get export URL for flow - #[serde(rename = "export_url")] - pub export_url: String, - #[serde(rename = "layout", skip_serializing_if = "Option::is_none")] - pub layout: Option, - /// Configure what should happen when a flow denies access to a user. - #[serde(rename = "denied_action", skip_serializing_if = "Option::is_none")] - pub denied_action: Option, -} - -impl FlowSet { - /// Stripped down flow serializer - pub fn new( - pk: uuid::Uuid, - policybindingmodel_ptr_id: uuid::Uuid, - name: String, - slug: String, - title: String, - designation: models::FlowDesignationEnum, - background_url: String, - export_url: String, - ) -> FlowSet { - FlowSet { - pk, - policybindingmodel_ptr_id, - name, - slug, - title, - designation, - background_url, - policy_engine_mode: None, - compatibility_mode: None, - export_url, - layout: None, - denied_action: None, - } - } -} diff --git a/packages/client-rust/src/models/flow_stage_binding.rs b/packages/client-rust/src/models/flow_stage_binding.rs deleted file mode 100644 index 15d8a6b431..0000000000 --- a/packages/client-rust/src/models/flow_stage_binding.rs +++ /dev/null @@ -1,73 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// FlowStageBinding : FlowStageBinding Serializer -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct FlowStageBinding { - #[serde(rename = "pk")] - pub pk: uuid::Uuid, - #[serde(rename = "policybindingmodel_ptr_id")] - pub policybindingmodel_ptr_id: uuid::Uuid, - #[serde(rename = "target")] - pub target: uuid::Uuid, - #[serde(rename = "stage")] - pub stage: uuid::Uuid, - #[serde(rename = "stage_obj")] - pub stage_obj: models::Stage, - /// Evaluate policies during the Flow planning process. - #[serde(rename = "evaluate_on_plan", skip_serializing_if = "Option::is_none")] - pub evaluate_on_plan: Option, - /// Evaluate policies when the Stage is presented to the user. - #[serde( - rename = "re_evaluate_policies", - skip_serializing_if = "Option::is_none" - )] - pub re_evaluate_policies: Option, - #[serde(rename = "order")] - pub order: i32, - #[serde(rename = "policy_engine_mode", skip_serializing_if = "Option::is_none")] - pub policy_engine_mode: Option, - /// 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. - #[serde( - rename = "invalid_response_action", - skip_serializing_if = "Option::is_none" - )] - pub invalid_response_action: Option, -} - -impl FlowStageBinding { - /// FlowStageBinding Serializer - pub fn new( - pk: uuid::Uuid, - policybindingmodel_ptr_id: uuid::Uuid, - target: uuid::Uuid, - stage: uuid::Uuid, - stage_obj: models::Stage, - order: i32, - ) -> FlowStageBinding { - FlowStageBinding { - pk, - policybindingmodel_ptr_id, - target, - stage, - stage_obj, - evaluate_on_plan: None, - re_evaluate_policies: None, - order, - policy_engine_mode: None, - invalid_response_action: None, - } - } -} diff --git a/packages/client-rust/src/models/flow_stage_binding_request.rs b/packages/client-rust/src/models/flow_stage_binding_request.rs deleted file mode 100644 index a03c8d57b3..0000000000 --- a/packages/client-rust/src/models/flow_stage_binding_request.rs +++ /dev/null @@ -1,57 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// FlowStageBindingRequest : FlowStageBinding Serializer -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct FlowStageBindingRequest { - #[serde(rename = "target")] - pub target: uuid::Uuid, - #[serde(rename = "stage")] - pub stage: uuid::Uuid, - /// Evaluate policies during the Flow planning process. - #[serde(rename = "evaluate_on_plan", skip_serializing_if = "Option::is_none")] - pub evaluate_on_plan: Option, - /// Evaluate policies when the Stage is presented to the user. - #[serde( - rename = "re_evaluate_policies", - skip_serializing_if = "Option::is_none" - )] - pub re_evaluate_policies: Option, - #[serde(rename = "order")] - pub order: i32, - #[serde(rename = "policy_engine_mode", skip_serializing_if = "Option::is_none")] - pub policy_engine_mode: Option, - /// 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. - #[serde( - rename = "invalid_response_action", - skip_serializing_if = "Option::is_none" - )] - pub invalid_response_action: Option, -} - -impl FlowStageBindingRequest { - /// FlowStageBinding Serializer - pub fn new(target: uuid::Uuid, stage: uuid::Uuid, order: i32) -> FlowStageBindingRequest { - FlowStageBindingRequest { - target, - stage, - evaluate_on_plan: None, - re_evaluate_policies: None, - order, - policy_engine_mode: None, - invalid_response_action: None, - } - } -} diff --git a/packages/client-rust/src/models/footer_link.rs b/packages/client-rust/src/models/footer_link.rs deleted file mode 100644 index 8964b740dd..0000000000 --- a/packages/client-rust/src/models/footer_link.rs +++ /dev/null @@ -1,27 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// FooterLink : Links returned in Config API -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct FooterLink { - #[serde(rename = "href", deserialize_with = "Option::deserialize")] - pub href: Option, - #[serde(rename = "name")] - pub name: String, -} - -impl FooterLink { - /// Links returned in Config API - pub fn new(href: Option, name: String) -> FooterLink { - FooterLink { href, name } - } -} diff --git a/packages/client-rust/src/models/force_binding_enum.rs b/packages/client-rust/src/models/force_binding_enum.rs deleted file mode 100644 index 467851a6f7..0000000000 --- a/packages/client-rust/src/models/force_binding_enum.rs +++ /dev/null @@ -1,39 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// -#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] -pub enum ForceBindingEnum { - #[serde(rename = "urn:oasis:names:tc:SAML:2.0:bindings:HTTP-POST")] - UrnColonOasisColonNamesColonTcColonSamlColon20ColonBindingsColonHttpPost, - #[serde(rename = "urn:oasis:names:tc:SAML:2.0:bindings:HTTP-Redirect")] - UrnColonOasisColonNamesColonTcColonSamlColon20ColonBindingsColonHttpRedirect, -} - -impl std::fmt::Display for ForceBindingEnum { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - match self { - Self::UrnColonOasisColonNamesColonTcColonSamlColon20ColonBindingsColonHttpPost => { - write!(f, "urn:oasis:names:tc:SAML:2.0:bindings:HTTP-POST") - } - Self::UrnColonOasisColonNamesColonTcColonSamlColon20ColonBindingsColonHttpRedirect => { - write!(f, "urn:oasis:names:tc:SAML:2.0:bindings:HTTP-Redirect") - } - } - } -} - -impl Default for ForceBindingEnum { - fn default() -> ForceBindingEnum { - Self::UrnColonOasisColonNamesColonTcColonSamlColon20ColonBindingsColonHttpPost - } -} diff --git a/packages/client-rust/src/models/format_enum.rs b/packages/client-rust/src/models/format_enum.rs deleted file mode 100644 index 1eaa5f1aca..0000000000 --- a/packages/client-rust/src/models/format_enum.rs +++ /dev/null @@ -1,35 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// -#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] -pub enum FormatEnum { - #[serde(rename = "json")] - Json, - #[serde(rename = "yaml")] - Yaml, -} - -impl std::fmt::Display for FormatEnum { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - match self { - Self::Json => write!(f, "json"), - Self::Yaml => write!(f, "yaml"), - } - } -} - -impl Default for FormatEnum { - fn default() -> FormatEnum { - Self::Json - } -} diff --git a/packages/client-rust/src/models/geo_ip_policy.rs b/packages/client-rust/src/models/geo_ip_policy.rs deleted file mode 100644 index 83335d1f52..0000000000 --- a/packages/client-rust/src/models/geo_ip_policy.rs +++ /dev/null @@ -1,110 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// GeoIpPolicy : GeoIP Policy Serializer -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct GeoIpPolicy { - #[serde(rename = "pk")] - pub pk: uuid::Uuid, - #[serde(rename = "name")] - pub name: String, - /// When this option is enabled, all executions of this policy will be logged. By default, only - /// execution errors are logged. - #[serde(rename = "execution_logging", skip_serializing_if = "Option::is_none")] - pub execution_logging: Option, - /// Get object component so that we know how to edit the object - #[serde(rename = "component")] - pub component: String, - /// Return object's verbose_name - #[serde(rename = "verbose_name")] - pub verbose_name: String, - /// Return object's plural verbose_name - #[serde(rename = "verbose_name_plural")] - pub verbose_name_plural: String, - /// Return internal model name - #[serde(rename = "meta_model_name")] - pub meta_model_name: String, - /// Return objects policy is bound to - #[serde(rename = "bound_to")] - pub bound_to: i32, - #[serde(rename = "asns", skip_serializing_if = "Option::is_none")] - pub asns: Option>, - #[serde(rename = "countries")] - pub countries: Vec, - #[serde(rename = "countries_obj")] - pub countries_obj: Vec, - #[serde( - rename = "check_history_distance", - skip_serializing_if = "Option::is_none" - )] - pub check_history_distance: Option, - #[serde( - rename = "history_max_distance_km", - skip_serializing_if = "Option::is_none" - )] - pub history_max_distance_km: Option, - #[serde( - rename = "distance_tolerance_km", - skip_serializing_if = "Option::is_none" - )] - pub distance_tolerance_km: Option, - #[serde( - rename = "history_login_count", - skip_serializing_if = "Option::is_none" - )] - pub history_login_count: Option, - #[serde( - rename = "check_impossible_travel", - skip_serializing_if = "Option::is_none" - )] - pub check_impossible_travel: Option, - #[serde( - rename = "impossible_tolerance_km", - skip_serializing_if = "Option::is_none" - )] - pub impossible_tolerance_km: Option, -} - -impl GeoIpPolicy { - /// GeoIP Policy Serializer - pub fn new( - pk: uuid::Uuid, - name: String, - component: String, - verbose_name: String, - verbose_name_plural: String, - meta_model_name: String, - bound_to: i32, - countries: Vec, - countries_obj: Vec, - ) -> GeoIpPolicy { - GeoIpPolicy { - pk, - name, - execution_logging: None, - component, - verbose_name, - verbose_name_plural, - meta_model_name, - bound_to, - asns: None, - countries, - countries_obj, - check_history_distance: None, - history_max_distance_km: None, - distance_tolerance_km: None, - history_login_count: None, - check_impossible_travel: None, - impossible_tolerance_km: None, - } - } -} diff --git a/packages/client-rust/src/models/geo_ip_policy_countries_obj_inner.rs b/packages/client-rust/src/models/geo_ip_policy_countries_obj_inner.rs deleted file mode 100644 index 1f650c36f0..0000000000 --- a/packages/client-rust/src/models/geo_ip_policy_countries_obj_inner.rs +++ /dev/null @@ -1,25 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct GeoIpPolicyCountriesObjInner { - #[serde(rename = "code")] - pub code: String, - #[serde(rename = "name")] - pub name: String, -} - -impl GeoIpPolicyCountriesObjInner { - pub fn new(code: String, name: String) -> GeoIpPolicyCountriesObjInner { - GeoIpPolicyCountriesObjInner { code, name } - } -} diff --git a/packages/client-rust/src/models/geo_ip_policy_request.rs b/packages/client-rust/src/models/geo_ip_policy_request.rs deleted file mode 100644 index 3a05ed7af2..0000000000 --- a/packages/client-rust/src/models/geo_ip_policy_request.rs +++ /dev/null @@ -1,74 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// GeoIpPolicyRequest : GeoIP Policy Serializer -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct GeoIpPolicyRequest { - #[serde(rename = "name")] - pub name: String, - /// When this option is enabled, all executions of this policy will be logged. By default, only - /// execution errors are logged. - #[serde(rename = "execution_logging", skip_serializing_if = "Option::is_none")] - pub execution_logging: Option, - #[serde(rename = "asns", skip_serializing_if = "Option::is_none")] - pub asns: Option>, - #[serde(rename = "countries")] - pub countries: Vec, - #[serde( - rename = "check_history_distance", - skip_serializing_if = "Option::is_none" - )] - pub check_history_distance: Option, - #[serde( - rename = "history_max_distance_km", - skip_serializing_if = "Option::is_none" - )] - pub history_max_distance_km: Option, - #[serde( - rename = "distance_tolerance_km", - skip_serializing_if = "Option::is_none" - )] - pub distance_tolerance_km: Option, - #[serde( - rename = "history_login_count", - skip_serializing_if = "Option::is_none" - )] - pub history_login_count: Option, - #[serde( - rename = "check_impossible_travel", - skip_serializing_if = "Option::is_none" - )] - pub check_impossible_travel: Option, - #[serde( - rename = "impossible_tolerance_km", - skip_serializing_if = "Option::is_none" - )] - pub impossible_tolerance_km: Option, -} - -impl GeoIpPolicyRequest { - /// GeoIP Policy Serializer - pub fn new(name: String, countries: Vec) -> GeoIpPolicyRequest { - GeoIpPolicyRequest { - name, - execution_logging: None, - asns: None, - countries, - check_history_distance: None, - history_max_distance_km: None, - distance_tolerance_km: None, - history_login_count: None, - check_impossible_travel: None, - impossible_tolerance_km: None, - } - } -} diff --git a/packages/client-rust/src/models/geoip_binding_enum.rs b/packages/client-rust/src/models/geoip_binding_enum.rs deleted file mode 100644 index fee9bbd80b..0000000000 --- a/packages/client-rust/src/models/geoip_binding_enum.rs +++ /dev/null @@ -1,41 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// -#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] -pub enum GeoipBindingEnum { - #[serde(rename = "no_binding")] - NoBinding, - #[serde(rename = "bind_continent")] - BindContinent, - #[serde(rename = "bind_continent_country")] - BindContinentCountry, - #[serde(rename = "bind_continent_country_city")] - BindContinentCountryCity, -} - -impl std::fmt::Display for GeoipBindingEnum { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - match self { - Self::NoBinding => write!(f, "no_binding"), - Self::BindContinent => write!(f, "bind_continent"), - Self::BindContinentCountry => write!(f, "bind_continent_country"), - Self::BindContinentCountryCity => write!(f, "bind_continent_country_city"), - } - } -} - -impl Default for GeoipBindingEnum { - fn default() -> GeoipBindingEnum { - Self::NoBinding - } -} diff --git a/packages/client-rust/src/models/global_task_status.rs b/packages/client-rust/src/models/global_task_status.rs deleted file mode 100644 index 40da0fa866..0000000000 --- a/packages/client-rust/src/models/global_task_status.rs +++ /dev/null @@ -1,63 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct GlobalTaskStatus { - #[serde(rename = "queued")] - pub queued: i32, - #[serde(rename = "consumed")] - pub consumed: i32, - #[serde(rename = "preprocess")] - pub preprocess: i32, - #[serde(rename = "running")] - pub running: i32, - #[serde(rename = "postprocess")] - pub postprocess: i32, - #[serde(rename = "rejected")] - pub rejected: i32, - #[serde(rename = "done")] - pub done: i32, - #[serde(rename = "info")] - pub info: i32, - #[serde(rename = "warning")] - pub warning: i32, - #[serde(rename = "error")] - pub error: i32, -} - -impl GlobalTaskStatus { - pub fn new( - queued: i32, - consumed: i32, - preprocess: i32, - running: i32, - postprocess: i32, - rejected: i32, - done: i32, - info: i32, - warning: i32, - error: i32, - ) -> GlobalTaskStatus { - GlobalTaskStatus { - queued, - consumed, - preprocess, - running, - postprocess, - rejected, - done, - info, - warning, - error, - } - } -} diff --git a/packages/client-rust/src/models/google_chrome_connector.rs b/packages/client-rust/src/models/google_chrome_connector.rs deleted file mode 100644 index f22866a9ec..0000000000 --- a/packages/client-rust/src/models/google_chrome_connector.rs +++ /dev/null @@ -1,64 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// GoogleChromeConnector : GoogleChromeConnector Serializer -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct GoogleChromeConnector { - #[serde(rename = "connector_uuid", skip_serializing_if = "Option::is_none")] - pub connector_uuid: Option, - #[serde(rename = "name")] - pub name: String, - #[serde(rename = "enabled", skip_serializing_if = "Option::is_none")] - pub enabled: Option, - /// Get object component so that we know how to edit the object - #[serde(rename = "component")] - pub component: String, - /// Return object's verbose_name - #[serde(rename = "verbose_name")] - pub verbose_name: String, - /// Return object's plural verbose_name - #[serde(rename = "verbose_name_plural")] - pub verbose_name_plural: String, - /// Return internal model name - #[serde(rename = "meta_model_name")] - pub meta_model_name: String, - #[serde(rename = "credentials")] - pub credentials: std::collections::HashMap, - /// Full URL to be used in Google Workspace configuration - #[serde(rename = "chrome_url", deserialize_with = "Option::deserialize")] - pub chrome_url: Option, -} - -impl GoogleChromeConnector { - /// GoogleChromeConnector Serializer - pub fn new( - name: String, - component: String, - verbose_name: String, - verbose_name_plural: String, - meta_model_name: String, - credentials: std::collections::HashMap, - chrome_url: Option, - ) -> GoogleChromeConnector { - GoogleChromeConnector { - connector_uuid: None, - name, - enabled: None, - component, - verbose_name, - verbose_name_plural, - meta_model_name, - credentials, - chrome_url, - } - } -} diff --git a/packages/client-rust/src/models/google_chrome_connector_request.rs b/packages/client-rust/src/models/google_chrome_connector_request.rs deleted file mode 100644 index cac1e795fa..0000000000 --- a/packages/client-rust/src/models/google_chrome_connector_request.rs +++ /dev/null @@ -1,39 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// GoogleChromeConnectorRequest : GoogleChromeConnector Serializer -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct GoogleChromeConnectorRequest { - #[serde(rename = "connector_uuid", skip_serializing_if = "Option::is_none")] - pub connector_uuid: Option, - #[serde(rename = "name")] - pub name: String, - #[serde(rename = "enabled", skip_serializing_if = "Option::is_none")] - pub enabled: Option, - #[serde(rename = "credentials")] - pub credentials: std::collections::HashMap, -} - -impl GoogleChromeConnectorRequest { - /// GoogleChromeConnector Serializer - pub fn new( - name: String, - credentials: std::collections::HashMap, - ) -> GoogleChromeConnectorRequest { - GoogleChromeConnectorRequest { - connector_uuid: None, - name, - enabled: None, - credentials, - } - } -} diff --git a/packages/client-rust/src/models/google_endpoint_device.rs b/packages/client-rust/src/models/google_endpoint_device.rs deleted file mode 100644 index 88d22805ca..0000000000 --- a/packages/client-rust/src/models/google_endpoint_device.rs +++ /dev/null @@ -1,28 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// GoogleEndpointDevice : Serializer for Endpoint authenticator devices -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct GoogleEndpointDevice { - #[serde(rename = "pk", skip_serializing_if = "Option::is_none")] - pub pk: Option, - /// The human-readable name of this device. - #[serde(rename = "name")] - pub name: String, -} - -impl GoogleEndpointDevice { - /// Serializer for Endpoint authenticator devices - pub fn new(name: String) -> GoogleEndpointDevice { - GoogleEndpointDevice { pk: None, name } - } -} diff --git a/packages/client-rust/src/models/google_endpoint_device_request.rs b/packages/client-rust/src/models/google_endpoint_device_request.rs deleted file mode 100644 index c6b349e789..0000000000 --- a/packages/client-rust/src/models/google_endpoint_device_request.rs +++ /dev/null @@ -1,28 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// GoogleEndpointDeviceRequest : Serializer for Endpoint authenticator devices -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct GoogleEndpointDeviceRequest { - #[serde(rename = "pk", skip_serializing_if = "Option::is_none")] - pub pk: Option, - /// The human-readable name of this device. - #[serde(rename = "name")] - pub name: String, -} - -impl GoogleEndpointDeviceRequest { - /// Serializer for Endpoint authenticator devices - pub fn new(name: String) -> GoogleEndpointDeviceRequest { - GoogleEndpointDeviceRequest { pk: None, name } - } -} diff --git a/packages/client-rust/src/models/google_workspace_provider.rs b/packages/client-rust/src/models/google_workspace_provider.rs deleted file mode 100644 index fab5d1806f..0000000000 --- a/packages/client-rust/src/models/google_workspace_provider.rs +++ /dev/null @@ -1,129 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// GoogleWorkspaceProvider : GoogleWorkspaceProvider Serializer -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct GoogleWorkspaceProvider { - #[serde(rename = "pk")] - pub pk: i32, - #[serde(rename = "name")] - pub name: String, - #[serde(rename = "property_mappings", skip_serializing_if = "Option::is_none")] - pub property_mappings: Option>, - /// Property mappings used for group creation/updating. - #[serde( - rename = "property_mappings_group", - skip_serializing_if = "Option::is_none" - )] - pub property_mappings_group: Option>, - /// Get object component so that we know how to edit the object - #[serde(rename = "component")] - pub component: String, - /// Internal application name, used in URLs. - #[serde( - rename = "assigned_backchannel_application_slug", - deserialize_with = "Option::deserialize" - )] - pub assigned_backchannel_application_slug: Option, - /// Application's display Name. - #[serde( - rename = "assigned_backchannel_application_name", - deserialize_with = "Option::deserialize" - )] - pub assigned_backchannel_application_name: Option, - /// Return object's verbose_name - #[serde(rename = "verbose_name")] - pub verbose_name: String, - /// Return object's plural verbose_name - #[serde(rename = "verbose_name_plural")] - pub verbose_name_plural: String, - /// Return internal model name - #[serde(rename = "meta_model_name")] - pub meta_model_name: String, - #[serde(rename = "delegated_subject")] - pub delegated_subject: String, - #[serde(rename = "credentials")] - pub credentials: std::collections::HashMap, - #[serde(rename = "scopes", skip_serializing_if = "Option::is_none")] - pub scopes: Option, - #[serde( - rename = "exclude_users_service_account", - skip_serializing_if = "Option::is_none" - )] - pub exclude_users_service_account: Option, - #[serde( - rename = "filter_group", - default, - with = "::serde_with::rust::double_option", - skip_serializing_if = "Option::is_none" - )] - pub filter_group: Option>, - #[serde(rename = "user_delete_action", skip_serializing_if = "Option::is_none")] - pub user_delete_action: Option, - #[serde( - rename = "group_delete_action", - skip_serializing_if = "Option::is_none" - )] - pub group_delete_action: Option, - #[serde(rename = "default_group_email_domain")] - pub default_group_email_domain: String, - /// Controls the number of objects synced in a single task - #[serde(rename = "sync_page_size", skip_serializing_if = "Option::is_none")] - pub sync_page_size: Option, - /// Timeout for synchronization of a single page - #[serde(rename = "sync_page_timeout", skip_serializing_if = "Option::is_none")] - pub sync_page_timeout: Option, - /// When enabled, provider will not modify or create objects in the remote system. - #[serde(rename = "dry_run", skip_serializing_if = "Option::is_none")] - pub dry_run: Option, -} - -impl GoogleWorkspaceProvider { - /// GoogleWorkspaceProvider Serializer - pub fn new( - pk: i32, - name: String, - component: String, - assigned_backchannel_application_slug: Option, - assigned_backchannel_application_name: Option, - verbose_name: String, - verbose_name_plural: String, - meta_model_name: String, - delegated_subject: String, - credentials: std::collections::HashMap, - default_group_email_domain: String, - ) -> GoogleWorkspaceProvider { - GoogleWorkspaceProvider { - pk, - name, - property_mappings: None, - property_mappings_group: None, - component, - assigned_backchannel_application_slug, - assigned_backchannel_application_name, - verbose_name, - verbose_name_plural, - meta_model_name, - delegated_subject, - credentials, - scopes: None, - exclude_users_service_account: None, - filter_group: None, - user_delete_action: None, - group_delete_action: None, - default_group_email_domain, - sync_page_size: None, - sync_page_timeout: None, - dry_run: None, - } - } -} diff --git a/packages/client-rust/src/models/google_workspace_provider_group.rs b/packages/client-rust/src/models/google_workspace_provider_group.rs deleted file mode 100644 index ea8226e630..0000000000 --- a/packages/client-rust/src/models/google_workspace_provider_group.rs +++ /dev/null @@ -1,49 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// GoogleWorkspaceProviderGroup : GoogleWorkspaceProviderGroup Serializer -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct GoogleWorkspaceProviderGroup { - #[serde(rename = "id")] - pub id: uuid::Uuid, - #[serde(rename = "google_id")] - pub google_id: String, - #[serde(rename = "group")] - pub group: uuid::Uuid, - #[serde(rename = "group_obj")] - pub group_obj: models::PartialGroup, - #[serde(rename = "provider")] - pub provider: i32, - #[serde(rename = "attributes")] - pub attributes: std::collections::HashMap, -} - -impl GoogleWorkspaceProviderGroup { - /// GoogleWorkspaceProviderGroup Serializer - pub fn new( - id: uuid::Uuid, - google_id: String, - group: uuid::Uuid, - group_obj: models::PartialGroup, - provider: i32, - attributes: std::collections::HashMap, - ) -> GoogleWorkspaceProviderGroup { - GoogleWorkspaceProviderGroup { - id, - google_id, - group, - group_obj, - provider, - attributes, - } - } -} diff --git a/packages/client-rust/src/models/google_workspace_provider_group_request.rs b/packages/client-rust/src/models/google_workspace_provider_group_request.rs deleted file mode 100644 index 65be2b7e9a..0000000000 --- a/packages/client-rust/src/models/google_workspace_provider_group_request.rs +++ /dev/null @@ -1,37 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// GoogleWorkspaceProviderGroupRequest : GoogleWorkspaceProviderGroup Serializer -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct GoogleWorkspaceProviderGroupRequest { - #[serde(rename = "google_id")] - pub google_id: String, - #[serde(rename = "group")] - pub group: uuid::Uuid, - #[serde(rename = "provider")] - pub provider: i32, -} - -impl GoogleWorkspaceProviderGroupRequest { - /// GoogleWorkspaceProviderGroup Serializer - pub fn new( - google_id: String, - group: uuid::Uuid, - provider: i32, - ) -> GoogleWorkspaceProviderGroupRequest { - GoogleWorkspaceProviderGroupRequest { - google_id, - group, - provider, - } - } -} diff --git a/packages/client-rust/src/models/google_workspace_provider_mapping.rs b/packages/client-rust/src/models/google_workspace_provider_mapping.rs deleted file mode 100644 index a90768baa7..0000000000 --- a/packages/client-rust/src/models/google_workspace_provider_mapping.rs +++ /dev/null @@ -1,68 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// GoogleWorkspaceProviderMapping : GoogleWorkspaceProviderMapping Serializer -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct GoogleWorkspaceProviderMapping { - #[serde(rename = "pk")] - pub pk: uuid::Uuid, - /// 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. - #[serde( - rename = "managed", - default, - with = "::serde_with::rust::double_option", - skip_serializing_if = "Option::is_none" - )] - pub managed: Option>, - #[serde(rename = "name")] - pub name: String, - #[serde(rename = "expression")] - pub expression: String, - /// Get object's component so that we know how to edit the object - #[serde(rename = "component")] - pub component: String, - /// Return object's verbose_name - #[serde(rename = "verbose_name")] - pub verbose_name: String, - /// Return object's plural verbose_name - #[serde(rename = "verbose_name_plural")] - pub verbose_name_plural: String, - /// Return internal model name - #[serde(rename = "meta_model_name")] - pub meta_model_name: String, -} - -impl GoogleWorkspaceProviderMapping { - /// GoogleWorkspaceProviderMapping Serializer - pub fn new( - pk: uuid::Uuid, - name: String, - expression: String, - component: String, - verbose_name: String, - verbose_name_plural: String, - meta_model_name: String, - ) -> GoogleWorkspaceProviderMapping { - GoogleWorkspaceProviderMapping { - pk, - managed: None, - name, - expression, - component, - verbose_name, - verbose_name_plural, - meta_model_name, - } - } -} diff --git a/packages/client-rust/src/models/google_workspace_provider_mapping_request.rs b/packages/client-rust/src/models/google_workspace_provider_mapping_request.rs deleted file mode 100644 index fa3ffc82c6..0000000000 --- a/packages/client-rust/src/models/google_workspace_provider_mapping_request.rs +++ /dev/null @@ -1,41 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// GoogleWorkspaceProviderMappingRequest : GoogleWorkspaceProviderMapping Serializer -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct GoogleWorkspaceProviderMappingRequest { - /// 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. - #[serde( - rename = "managed", - default, - with = "::serde_with::rust::double_option", - skip_serializing_if = "Option::is_none" - )] - pub managed: Option>, - #[serde(rename = "name")] - pub name: String, - #[serde(rename = "expression")] - pub expression: String, -} - -impl GoogleWorkspaceProviderMappingRequest { - /// GoogleWorkspaceProviderMapping Serializer - pub fn new(name: String, expression: String) -> GoogleWorkspaceProviderMappingRequest { - GoogleWorkspaceProviderMappingRequest { - managed: None, - name, - expression, - } - } -} diff --git a/packages/client-rust/src/models/google_workspace_provider_request.rs b/packages/client-rust/src/models/google_workspace_provider_request.rs deleted file mode 100644 index 98a586259f..0000000000 --- a/packages/client-rust/src/models/google_workspace_provider_request.rs +++ /dev/null @@ -1,89 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// GoogleWorkspaceProviderRequest : GoogleWorkspaceProvider Serializer -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct GoogleWorkspaceProviderRequest { - #[serde(rename = "name")] - pub name: String, - #[serde(rename = "property_mappings", skip_serializing_if = "Option::is_none")] - pub property_mappings: Option>, - /// Property mappings used for group creation/updating. - #[serde( - rename = "property_mappings_group", - skip_serializing_if = "Option::is_none" - )] - pub property_mappings_group: Option>, - #[serde(rename = "delegated_subject")] - pub delegated_subject: String, - #[serde(rename = "credentials")] - pub credentials: std::collections::HashMap, - #[serde(rename = "scopes", skip_serializing_if = "Option::is_none")] - pub scopes: Option, - #[serde( - rename = "exclude_users_service_account", - skip_serializing_if = "Option::is_none" - )] - pub exclude_users_service_account: Option, - #[serde( - rename = "filter_group", - default, - with = "::serde_with::rust::double_option", - skip_serializing_if = "Option::is_none" - )] - pub filter_group: Option>, - #[serde(rename = "user_delete_action", skip_serializing_if = "Option::is_none")] - pub user_delete_action: Option, - #[serde( - rename = "group_delete_action", - skip_serializing_if = "Option::is_none" - )] - pub group_delete_action: Option, - #[serde(rename = "default_group_email_domain")] - pub default_group_email_domain: String, - /// Controls the number of objects synced in a single task - #[serde(rename = "sync_page_size", skip_serializing_if = "Option::is_none")] - pub sync_page_size: Option, - /// Timeout for synchronization of a single page - #[serde(rename = "sync_page_timeout", skip_serializing_if = "Option::is_none")] - pub sync_page_timeout: Option, - /// When enabled, provider will not modify or create objects in the remote system. - #[serde(rename = "dry_run", skip_serializing_if = "Option::is_none")] - pub dry_run: Option, -} - -impl GoogleWorkspaceProviderRequest { - /// GoogleWorkspaceProvider Serializer - pub fn new( - name: String, - delegated_subject: String, - credentials: std::collections::HashMap, - default_group_email_domain: String, - ) -> GoogleWorkspaceProviderRequest { - GoogleWorkspaceProviderRequest { - name, - property_mappings: None, - property_mappings_group: None, - delegated_subject, - credentials, - scopes: None, - exclude_users_service_account: None, - filter_group: None, - user_delete_action: None, - group_delete_action: None, - default_group_email_domain, - sync_page_size: None, - sync_page_timeout: None, - dry_run: None, - } - } -} diff --git a/packages/client-rust/src/models/google_workspace_provider_user.rs b/packages/client-rust/src/models/google_workspace_provider_user.rs deleted file mode 100644 index 98d6ddbe5e..0000000000 --- a/packages/client-rust/src/models/google_workspace_provider_user.rs +++ /dev/null @@ -1,49 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// GoogleWorkspaceProviderUser : GoogleWorkspaceProviderUser Serializer -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct GoogleWorkspaceProviderUser { - #[serde(rename = "id")] - pub id: uuid::Uuid, - #[serde(rename = "google_id")] - pub google_id: String, - #[serde(rename = "user")] - pub user: i32, - #[serde(rename = "user_obj")] - pub user_obj: models::PartialUser, - #[serde(rename = "provider")] - pub provider: i32, - #[serde(rename = "attributes")] - pub attributes: std::collections::HashMap, -} - -impl GoogleWorkspaceProviderUser { - /// GoogleWorkspaceProviderUser Serializer - pub fn new( - id: uuid::Uuid, - google_id: String, - user: i32, - user_obj: models::PartialUser, - provider: i32, - attributes: std::collections::HashMap, - ) -> GoogleWorkspaceProviderUser { - GoogleWorkspaceProviderUser { - id, - google_id, - user, - user_obj, - provider, - attributes, - } - } -} diff --git a/packages/client-rust/src/models/google_workspace_provider_user_request.rs b/packages/client-rust/src/models/google_workspace_provider_user_request.rs deleted file mode 100644 index 04e4aececd..0000000000 --- a/packages/client-rust/src/models/google_workspace_provider_user_request.rs +++ /dev/null @@ -1,33 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// GoogleWorkspaceProviderUserRequest : GoogleWorkspaceProviderUser Serializer -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct GoogleWorkspaceProviderUserRequest { - #[serde(rename = "google_id")] - pub google_id: String, - #[serde(rename = "user")] - pub user: i32, - #[serde(rename = "provider")] - pub provider: i32, -} - -impl GoogleWorkspaceProviderUserRequest { - /// GoogleWorkspaceProviderUser Serializer - pub fn new(google_id: String, user: i32, provider: i32) -> GoogleWorkspaceProviderUserRequest { - GoogleWorkspaceProviderUserRequest { - google_id, - user, - provider, - } - } -} diff --git a/packages/client-rust/src/models/group_kerberos_source_connection.rs b/packages/client-rust/src/models/group_kerberos_source_connection.rs deleted file mode 100644 index e76e1b7575..0000000000 --- a/packages/client-rust/src/models/group_kerberos_source_connection.rs +++ /dev/null @@ -1,53 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// GroupKerberosSourceConnection : Group Source Connection -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct GroupKerberosSourceConnection { - #[serde(rename = "pk")] - pub pk: i32, - #[serde(rename = "group")] - pub group: uuid::Uuid, - #[serde(rename = "source")] - pub source: uuid::Uuid, - #[serde(rename = "source_obj")] - pub source_obj: models::Source, - #[serde(rename = "identifier")] - pub identifier: String, - #[serde(rename = "created")] - pub created: String, - #[serde(rename = "last_updated")] - pub last_updated: String, -} - -impl GroupKerberosSourceConnection { - /// Group Source Connection - pub fn new( - pk: i32, - group: uuid::Uuid, - source: uuid::Uuid, - source_obj: models::Source, - identifier: String, - created: String, - last_updated: String, - ) -> GroupKerberosSourceConnection { - GroupKerberosSourceConnection { - pk, - group, - source, - source_obj, - identifier, - created, - last_updated, - } - } -} diff --git a/packages/client-rust/src/models/group_kerberos_source_connection_request.rs b/packages/client-rust/src/models/group_kerberos_source_connection_request.rs deleted file mode 100644 index ebb0ff9438..0000000000 --- a/packages/client-rust/src/models/group_kerberos_source_connection_request.rs +++ /dev/null @@ -1,37 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// GroupKerberosSourceConnectionRequest : Group Source Connection -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct GroupKerberosSourceConnectionRequest { - #[serde(rename = "group")] - pub group: uuid::Uuid, - #[serde(rename = "source")] - pub source: uuid::Uuid, - #[serde(rename = "identifier")] - pub identifier: String, -} - -impl GroupKerberosSourceConnectionRequest { - /// Group Source Connection - pub fn new( - group: uuid::Uuid, - source: uuid::Uuid, - identifier: String, - ) -> GroupKerberosSourceConnectionRequest { - GroupKerberosSourceConnectionRequest { - group, - source, - identifier, - } - } -} diff --git a/packages/client-rust/src/models/group_ldap_source_connection.rs b/packages/client-rust/src/models/group_ldap_source_connection.rs deleted file mode 100644 index 060798a6fa..0000000000 --- a/packages/client-rust/src/models/group_ldap_source_connection.rs +++ /dev/null @@ -1,57 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// GroupLdapSourceConnection : Group Source Connection -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct GroupLdapSourceConnection { - #[serde(rename = "pk")] - pub pk: i32, - #[serde(rename = "group")] - pub group: uuid::Uuid, - #[serde(rename = "source")] - pub source: uuid::Uuid, - #[serde(rename = "source_obj")] - pub source_obj: models::Source, - #[serde(rename = "identifier")] - pub identifier: String, - #[serde(rename = "created")] - pub created: String, - #[serde(rename = "last_updated")] - pub last_updated: String, - #[serde(rename = "group_obj")] - pub group_obj: models::PartialGroup, -} - -impl GroupLdapSourceConnection { - /// Group Source Connection - pub fn new( - pk: i32, - group: uuid::Uuid, - source: uuid::Uuid, - source_obj: models::Source, - identifier: String, - created: String, - last_updated: String, - group_obj: models::PartialGroup, - ) -> GroupLdapSourceConnection { - GroupLdapSourceConnection { - pk, - group, - source, - source_obj, - identifier, - created, - last_updated, - group_obj, - } - } -} diff --git a/packages/client-rust/src/models/group_ldap_source_connection_request.rs b/packages/client-rust/src/models/group_ldap_source_connection_request.rs deleted file mode 100644 index 6978ee5f5a..0000000000 --- a/packages/client-rust/src/models/group_ldap_source_connection_request.rs +++ /dev/null @@ -1,37 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// GroupLdapSourceConnectionRequest : Group Source Connection -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct GroupLdapSourceConnectionRequest { - #[serde(rename = "group")] - pub group: uuid::Uuid, - #[serde(rename = "source")] - pub source: uuid::Uuid, - #[serde(rename = "identifier")] - pub identifier: String, -} - -impl GroupLdapSourceConnectionRequest { - /// Group Source Connection - pub fn new( - group: uuid::Uuid, - source: uuid::Uuid, - identifier: String, - ) -> GroupLdapSourceConnectionRequest { - GroupLdapSourceConnectionRequest { - group, - source, - identifier, - } - } -} diff --git a/packages/client-rust/src/models/group_matching_mode_enum.rs b/packages/client-rust/src/models/group_matching_mode_enum.rs deleted file mode 100644 index 109a8b12bc..0000000000 --- a/packages/client-rust/src/models/group_matching_mode_enum.rs +++ /dev/null @@ -1,38 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// -#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] -pub enum GroupMatchingModeEnum { - #[serde(rename = "identifier")] - Identifier, - #[serde(rename = "name_link")] - NameLink, - #[serde(rename = "name_deny")] - NameDeny, -} - -impl std::fmt::Display for GroupMatchingModeEnum { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - match self { - Self::Identifier => write!(f, "identifier"), - Self::NameLink => write!(f, "name_link"), - Self::NameDeny => write!(f, "name_deny"), - } - } -} - -impl Default for GroupMatchingModeEnum { - fn default() -> GroupMatchingModeEnum { - Self::Identifier - } -} diff --git a/packages/client-rust/src/models/group_o_auth_source_connection.rs b/packages/client-rust/src/models/group_o_auth_source_connection.rs deleted file mode 100644 index 10bdacb8cc..0000000000 --- a/packages/client-rust/src/models/group_o_auth_source_connection.rs +++ /dev/null @@ -1,53 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// GroupOAuthSourceConnection : Group Source Connection -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct GroupOAuthSourceConnection { - #[serde(rename = "pk")] - pub pk: i32, - #[serde(rename = "group")] - pub group: uuid::Uuid, - #[serde(rename = "source")] - pub source: uuid::Uuid, - #[serde(rename = "source_obj")] - pub source_obj: models::Source, - #[serde(rename = "identifier")] - pub identifier: String, - #[serde(rename = "created")] - pub created: String, - #[serde(rename = "last_updated")] - pub last_updated: String, -} - -impl GroupOAuthSourceConnection { - /// Group Source Connection - pub fn new( - pk: i32, - group: uuid::Uuid, - source: uuid::Uuid, - source_obj: models::Source, - identifier: String, - created: String, - last_updated: String, - ) -> GroupOAuthSourceConnection { - GroupOAuthSourceConnection { - pk, - group, - source, - source_obj, - identifier, - created, - last_updated, - } - } -} diff --git a/packages/client-rust/src/models/group_o_auth_source_connection_request.rs b/packages/client-rust/src/models/group_o_auth_source_connection_request.rs deleted file mode 100644 index 029f46a923..0000000000 --- a/packages/client-rust/src/models/group_o_auth_source_connection_request.rs +++ /dev/null @@ -1,37 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// GroupOAuthSourceConnectionRequest : Group Source Connection -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct GroupOAuthSourceConnectionRequest { - #[serde(rename = "group")] - pub group: uuid::Uuid, - #[serde(rename = "source")] - pub source: uuid::Uuid, - #[serde(rename = "identifier")] - pub identifier: String, -} - -impl GroupOAuthSourceConnectionRequest { - /// Group Source Connection - pub fn new( - group: uuid::Uuid, - source: uuid::Uuid, - identifier: String, - ) -> GroupOAuthSourceConnectionRequest { - GroupOAuthSourceConnectionRequest { - group, - source, - identifier, - } - } -} diff --git a/packages/client-rust/src/models/group_plex_source_connection.rs b/packages/client-rust/src/models/group_plex_source_connection.rs deleted file mode 100644 index e2777c3441..0000000000 --- a/packages/client-rust/src/models/group_plex_source_connection.rs +++ /dev/null @@ -1,53 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// GroupPlexSourceConnection : Group Source Connection -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct GroupPlexSourceConnection { - #[serde(rename = "pk")] - pub pk: i32, - #[serde(rename = "group")] - pub group: uuid::Uuid, - #[serde(rename = "source")] - pub source: uuid::Uuid, - #[serde(rename = "source_obj")] - pub source_obj: models::Source, - #[serde(rename = "identifier")] - pub identifier: String, - #[serde(rename = "created")] - pub created: String, - #[serde(rename = "last_updated")] - pub last_updated: String, -} - -impl GroupPlexSourceConnection { - /// Group Source Connection - pub fn new( - pk: i32, - group: uuid::Uuid, - source: uuid::Uuid, - source_obj: models::Source, - identifier: String, - created: String, - last_updated: String, - ) -> GroupPlexSourceConnection { - GroupPlexSourceConnection { - pk, - group, - source, - source_obj, - identifier, - created, - last_updated, - } - } -} diff --git a/packages/client-rust/src/models/group_plex_source_connection_request.rs b/packages/client-rust/src/models/group_plex_source_connection_request.rs deleted file mode 100644 index 70afd701cc..0000000000 --- a/packages/client-rust/src/models/group_plex_source_connection_request.rs +++ /dev/null @@ -1,37 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// GroupPlexSourceConnectionRequest : Group Source Connection -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct GroupPlexSourceConnectionRequest { - #[serde(rename = "group")] - pub group: uuid::Uuid, - #[serde(rename = "source")] - pub source: uuid::Uuid, - #[serde(rename = "identifier")] - pub identifier: String, -} - -impl GroupPlexSourceConnectionRequest { - /// Group Source Connection - pub fn new( - group: uuid::Uuid, - source: uuid::Uuid, - identifier: String, - ) -> GroupPlexSourceConnectionRequest { - GroupPlexSourceConnectionRequest { - group, - source, - identifier, - } - } -} diff --git a/packages/client-rust/src/models/group_request.rs b/packages/client-rust/src/models/group_request.rs deleted file mode 100644 index 8f587faa83..0000000000 --- a/packages/client-rust/src/models/group_request.rs +++ /dev/null @@ -1,43 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// GroupRequest : Group Serializer -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct GroupRequest { - #[serde(rename = "name")] - pub name: String, - /// Users added to this group will be superusers. - #[serde(rename = "is_superuser", skip_serializing_if = "Option::is_none")] - pub is_superuser: Option, - #[serde(rename = "parents", skip_serializing_if = "Option::is_none")] - pub parents: Option>, - #[serde(rename = "users", skip_serializing_if = "Option::is_none")] - pub users: Option>, - #[serde(rename = "attributes", skip_serializing_if = "Option::is_none")] - pub attributes: Option>, - #[serde(rename = "roles", skip_serializing_if = "Option::is_none")] - pub roles: Option>, -} - -impl GroupRequest { - /// Group Serializer - pub fn new(name: String) -> GroupRequest { - GroupRequest { - name, - is_superuser: None, - parents: None, - users: None, - attributes: None, - roles: None, - } - } -} diff --git a/packages/client-rust/src/models/group_saml_source_connection.rs b/packages/client-rust/src/models/group_saml_source_connection.rs deleted file mode 100644 index 655676eb19..0000000000 --- a/packages/client-rust/src/models/group_saml_source_connection.rs +++ /dev/null @@ -1,53 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// GroupSamlSourceConnection : Group Source Connection -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct GroupSamlSourceConnection { - #[serde(rename = "pk")] - pub pk: i32, - #[serde(rename = "group")] - pub group: uuid::Uuid, - #[serde(rename = "source")] - pub source: uuid::Uuid, - #[serde(rename = "source_obj")] - pub source_obj: models::Source, - #[serde(rename = "identifier")] - pub identifier: String, - #[serde(rename = "created")] - pub created: String, - #[serde(rename = "last_updated")] - pub last_updated: String, -} - -impl GroupSamlSourceConnection { - /// Group Source Connection - pub fn new( - pk: i32, - group: uuid::Uuid, - source: uuid::Uuid, - source_obj: models::Source, - identifier: String, - created: String, - last_updated: String, - ) -> GroupSamlSourceConnection { - GroupSamlSourceConnection { - pk, - group, - source, - source_obj, - identifier, - created, - last_updated, - } - } -} diff --git a/packages/client-rust/src/models/group_saml_source_connection_request.rs b/packages/client-rust/src/models/group_saml_source_connection_request.rs deleted file mode 100644 index 2827db8a37..0000000000 --- a/packages/client-rust/src/models/group_saml_source_connection_request.rs +++ /dev/null @@ -1,37 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// GroupSamlSourceConnectionRequest : Group Source Connection -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct GroupSamlSourceConnectionRequest { - #[serde(rename = "group")] - pub group: uuid::Uuid, - #[serde(rename = "source")] - pub source: uuid::Uuid, - #[serde(rename = "identifier")] - pub identifier: String, -} - -impl GroupSamlSourceConnectionRequest { - /// Group Source Connection - pub fn new( - group: uuid::Uuid, - source: uuid::Uuid, - identifier: String, - ) -> GroupSamlSourceConnectionRequest { - GroupSamlSourceConnectionRequest { - group, - source, - identifier, - } - } -} diff --git a/packages/client-rust/src/models/group_source_connection.rs b/packages/client-rust/src/models/group_source_connection.rs deleted file mode 100644 index a726c768df..0000000000 --- a/packages/client-rust/src/models/group_source_connection.rs +++ /dev/null @@ -1,53 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// GroupSourceConnection : Group Source Connection -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct GroupSourceConnection { - #[serde(rename = "pk")] - pub pk: i32, - #[serde(rename = "group")] - pub group: uuid::Uuid, - #[serde(rename = "source")] - pub source: uuid::Uuid, - #[serde(rename = "source_obj")] - pub source_obj: models::Source, - #[serde(rename = "identifier")] - pub identifier: String, - #[serde(rename = "created")] - pub created: String, - #[serde(rename = "last_updated")] - pub last_updated: String, -} - -impl GroupSourceConnection { - /// Group Source Connection - pub fn new( - pk: i32, - group: uuid::Uuid, - source: uuid::Uuid, - source_obj: models::Source, - identifier: String, - created: String, - last_updated: String, - ) -> GroupSourceConnection { - GroupSourceConnection { - pk, - group, - source, - source_obj, - identifier, - created, - last_updated, - } - } -} diff --git a/packages/client-rust/src/models/group_source_connection_request.rs b/packages/client-rust/src/models/group_source_connection_request.rs deleted file mode 100644 index 277fe286aa..0000000000 --- a/packages/client-rust/src/models/group_source_connection_request.rs +++ /dev/null @@ -1,37 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// GroupSourceConnectionRequest : Group Source Connection -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct GroupSourceConnectionRequest { - #[serde(rename = "group")] - pub group: uuid::Uuid, - #[serde(rename = "source")] - pub source: uuid::Uuid, - #[serde(rename = "identifier")] - pub identifier: String, -} - -impl GroupSourceConnectionRequest { - /// Group Source Connection - pub fn new( - group: uuid::Uuid, - source: uuid::Uuid, - identifier: String, - ) -> GroupSourceConnectionRequest { - GroupSourceConnectionRequest { - group, - source, - identifier, - } - } -} diff --git a/packages/client-rust/src/models/group_telegram_source_connection.rs b/packages/client-rust/src/models/group_telegram_source_connection.rs deleted file mode 100644 index 18a16cad47..0000000000 --- a/packages/client-rust/src/models/group_telegram_source_connection.rs +++ /dev/null @@ -1,53 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// GroupTelegramSourceConnection : Group Source Connection -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct GroupTelegramSourceConnection { - #[serde(rename = "pk")] - pub pk: i32, - #[serde(rename = "group")] - pub group: uuid::Uuid, - #[serde(rename = "source")] - pub source: uuid::Uuid, - #[serde(rename = "source_obj")] - pub source_obj: models::Source, - #[serde(rename = "identifier")] - pub identifier: String, - #[serde(rename = "created")] - pub created: String, - #[serde(rename = "last_updated")] - pub last_updated: String, -} - -impl GroupTelegramSourceConnection { - /// Group Source Connection - pub fn new( - pk: i32, - group: uuid::Uuid, - source: uuid::Uuid, - source_obj: models::Source, - identifier: String, - created: String, - last_updated: String, - ) -> GroupTelegramSourceConnection { - GroupTelegramSourceConnection { - pk, - group, - source, - source_obj, - identifier, - created, - last_updated, - } - } -} diff --git a/packages/client-rust/src/models/group_telegram_source_connection_request.rs b/packages/client-rust/src/models/group_telegram_source_connection_request.rs deleted file mode 100644 index 6722c3de57..0000000000 --- a/packages/client-rust/src/models/group_telegram_source_connection_request.rs +++ /dev/null @@ -1,37 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// GroupTelegramSourceConnectionRequest : Group Source Connection -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct GroupTelegramSourceConnectionRequest { - #[serde(rename = "group")] - pub group: uuid::Uuid, - #[serde(rename = "source")] - pub source: uuid::Uuid, - #[serde(rename = "identifier")] - pub identifier: String, -} - -impl GroupTelegramSourceConnectionRequest { - /// Group Source Connection - pub fn new( - group: uuid::Uuid, - source: uuid::Uuid, - identifier: String, - ) -> GroupTelegramSourceConnectionRequest { - GroupTelegramSourceConnectionRequest { - group, - source, - identifier, - } - } -} diff --git a/packages/client-rust/src/models/hardware.rs b/packages/client-rust/src/models/hardware.rs deleted file mode 100644 index 15493f39fc..0000000000 --- a/packages/client-rust/src/models/hardware.rs +++ /dev/null @@ -1,40 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct Hardware { - #[serde(rename = "model", skip_serializing_if = "Option::is_none")] - pub model: Option, - #[serde(rename = "manufacturer", skip_serializing_if = "Option::is_none")] - pub manufacturer: Option, - #[serde(rename = "serial")] - pub serial: String, - #[serde(rename = "cpu_name", skip_serializing_if = "Option::is_none")] - pub cpu_name: Option, - #[serde(rename = "cpu_count", skip_serializing_if = "Option::is_none")] - pub cpu_count: Option, - #[serde(rename = "memory_bytes", skip_serializing_if = "Option::is_none")] - pub memory_bytes: Option, -} - -impl Hardware { - pub fn new(serial: String) -> Hardware { - Hardware { - model: None, - manufacturer: None, - serial, - cpu_name: None, - cpu_count: None, - memory_bytes: None, - } - } -} diff --git a/packages/client-rust/src/models/hardware_request.rs b/packages/client-rust/src/models/hardware_request.rs deleted file mode 100644 index ec9871aada..0000000000 --- a/packages/client-rust/src/models/hardware_request.rs +++ /dev/null @@ -1,40 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct HardwareRequest { - #[serde(rename = "model", skip_serializing_if = "Option::is_none")] - pub model: Option, - #[serde(rename = "manufacturer", skip_serializing_if = "Option::is_none")] - pub manufacturer: Option, - #[serde(rename = "serial")] - pub serial: String, - #[serde(rename = "cpu_name", skip_serializing_if = "Option::is_none")] - pub cpu_name: Option, - #[serde(rename = "cpu_count", skip_serializing_if = "Option::is_none")] - pub cpu_count: Option, - #[serde(rename = "memory_bytes", skip_serializing_if = "Option::is_none")] - pub memory_bytes: Option, -} - -impl HardwareRequest { - pub fn new(serial: String) -> HardwareRequest { - HardwareRequest { - model: None, - manufacturer: None, - serial, - cpu_name: None, - cpu_count: None, - memory_bytes: None, - } - } -} diff --git a/packages/client-rust/src/models/identification_stage.rs b/packages/client-rust/src/models/identification_stage.rs deleted file mode 100644 index 3296ddee41..0000000000 --- a/packages/client-rust/src/models/identification_stage.rs +++ /dev/null @@ -1,148 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// IdentificationStage : IdentificationStage Serializer -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct IdentificationStage { - #[serde(rename = "pk")] - pub pk: uuid::Uuid, - #[serde(rename = "name")] - pub name: String, - /// Get object type so that we know how to edit the object - #[serde(rename = "component")] - pub component: String, - /// Return object's verbose_name - #[serde(rename = "verbose_name")] - pub verbose_name: String, - /// Return object's plural verbose_name - #[serde(rename = "verbose_name_plural")] - pub verbose_name_plural: String, - /// Return internal model name - #[serde(rename = "meta_model_name")] - pub meta_model_name: String, - #[serde(rename = "flow_set")] - pub flow_set: Vec, - /// Fields of the user object to match against. (Hold shift to select multiple options) - #[serde(rename = "user_fields", skip_serializing_if = "Option::is_none")] - pub user_fields: Option>, - /// When set, shows a password field, instead of showing the password field as separate step. - #[serde( - rename = "password_stage", - default, - with = "::serde_with::rust::double_option", - skip_serializing_if = "Option::is_none" - )] - pub password_stage: Option>, - /// When set, adds functionality exactly like a Captcha stage, but baked into the - /// Identification stage. - #[serde( - rename = "captcha_stage", - default, - with = "::serde_with::rust::double_option", - skip_serializing_if = "Option::is_none" - )] - pub captcha_stage: Option>, - /// When enabled, user fields are matched regardless of their casing. - #[serde( - rename = "case_insensitive_matching", - skip_serializing_if = "Option::is_none" - )] - pub case_insensitive_matching: Option, - /// 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 - #[serde(rename = "show_matched_user", skip_serializing_if = "Option::is_none")] - pub show_matched_user: Option, - /// Optional enrollment flow, which is linked at the bottom of the page. - #[serde( - rename = "enrollment_flow", - default, - with = "::serde_with::rust::double_option", - skip_serializing_if = "Option::is_none" - )] - pub enrollment_flow: Option>, - /// Optional recovery flow, which is linked at the bottom of the page. - #[serde( - rename = "recovery_flow", - default, - with = "::serde_with::rust::double_option", - skip_serializing_if = "Option::is_none" - )] - pub recovery_flow: Option>, - /// Optional passwordless flow, which is linked at the bottom of the page. - #[serde( - rename = "passwordless_flow", - default, - with = "::serde_with::rust::double_option", - skip_serializing_if = "Option::is_none" - )] - pub passwordless_flow: Option>, - /// Specify which sources should be shown. - #[serde(rename = "sources", skip_serializing_if = "Option::is_none")] - pub sources: Option>, - #[serde(rename = "show_source_labels", skip_serializing_if = "Option::is_none")] - pub show_source_labels: Option, - /// When enabled, the stage will succeed and continue even when incorrect user info is entered. - #[serde( - rename = "pretend_user_exists", - skip_serializing_if = "Option::is_none" - )] - pub pretend_user_exists: Option, - /// Show the user the 'Remember me on this device' toggle, allowing repeat users to skip - /// straight to entering their password. - #[serde(rename = "enable_remember_me", skip_serializing_if = "Option::is_none")] - pub enable_remember_me: Option, - /// When set, and conditional WebAuthn is available, allow the user to use their passkey as a - /// first factor. - #[serde( - rename = "webauthn_stage", - default, - with = "::serde_with::rust::double_option", - skip_serializing_if = "Option::is_none" - )] - pub webauthn_stage: Option>, -} - -impl IdentificationStage { - /// IdentificationStage Serializer - pub fn new( - pk: uuid::Uuid, - name: String, - component: String, - verbose_name: String, - verbose_name_plural: String, - meta_model_name: String, - flow_set: Vec, - ) -> IdentificationStage { - IdentificationStage { - pk, - name, - component, - verbose_name, - verbose_name_plural, - meta_model_name, - flow_set, - user_fields: None, - password_stage: None, - captcha_stage: None, - case_insensitive_matching: None, - show_matched_user: None, - enrollment_flow: None, - recovery_flow: None, - passwordless_flow: None, - sources: None, - show_source_labels: None, - pretend_user_exists: None, - enable_remember_me: None, - webauthn_stage: None, - } - } -} diff --git a/packages/client-rust/src/models/identification_stage_request.rs b/packages/client-rust/src/models/identification_stage_request.rs deleted file mode 100644 index 9626eec5ed..0000000000 --- a/packages/client-rust/src/models/identification_stage_request.rs +++ /dev/null @@ -1,118 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// IdentificationStageRequest : IdentificationStage Serializer -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct IdentificationStageRequest { - #[serde(rename = "name")] - pub name: String, - /// Fields of the user object to match against. (Hold shift to select multiple options) - #[serde(rename = "user_fields", skip_serializing_if = "Option::is_none")] - pub user_fields: Option>, - /// When set, shows a password field, instead of showing the password field as separate step. - #[serde( - rename = "password_stage", - default, - with = "::serde_with::rust::double_option", - skip_serializing_if = "Option::is_none" - )] - pub password_stage: Option>, - /// When set, adds functionality exactly like a Captcha stage, but baked into the - /// Identification stage. - #[serde( - rename = "captcha_stage", - default, - with = "::serde_with::rust::double_option", - skip_serializing_if = "Option::is_none" - )] - pub captcha_stage: Option>, - /// When enabled, user fields are matched regardless of their casing. - #[serde( - rename = "case_insensitive_matching", - skip_serializing_if = "Option::is_none" - )] - pub case_insensitive_matching: Option, - /// 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 - #[serde(rename = "show_matched_user", skip_serializing_if = "Option::is_none")] - pub show_matched_user: Option, - /// Optional enrollment flow, which is linked at the bottom of the page. - #[serde( - rename = "enrollment_flow", - default, - with = "::serde_with::rust::double_option", - skip_serializing_if = "Option::is_none" - )] - pub enrollment_flow: Option>, - /// Optional recovery flow, which is linked at the bottom of the page. - #[serde( - rename = "recovery_flow", - default, - with = "::serde_with::rust::double_option", - skip_serializing_if = "Option::is_none" - )] - pub recovery_flow: Option>, - /// Optional passwordless flow, which is linked at the bottom of the page. - #[serde( - rename = "passwordless_flow", - default, - with = "::serde_with::rust::double_option", - skip_serializing_if = "Option::is_none" - )] - pub passwordless_flow: Option>, - /// Specify which sources should be shown. - #[serde(rename = "sources", skip_serializing_if = "Option::is_none")] - pub sources: Option>, - #[serde(rename = "show_source_labels", skip_serializing_if = "Option::is_none")] - pub show_source_labels: Option, - /// When enabled, the stage will succeed and continue even when incorrect user info is entered. - #[serde( - rename = "pretend_user_exists", - skip_serializing_if = "Option::is_none" - )] - pub pretend_user_exists: Option, - /// Show the user the 'Remember me on this device' toggle, allowing repeat users to skip - /// straight to entering their password. - #[serde(rename = "enable_remember_me", skip_serializing_if = "Option::is_none")] - pub enable_remember_me: Option, - /// When set, and conditional WebAuthn is available, allow the user to use their passkey as a - /// first factor. - #[serde( - rename = "webauthn_stage", - default, - with = "::serde_with::rust::double_option", - skip_serializing_if = "Option::is_none" - )] - pub webauthn_stage: Option>, -} - -impl IdentificationStageRequest { - /// IdentificationStage Serializer - pub fn new(name: String) -> IdentificationStageRequest { - IdentificationStageRequest { - name, - user_fields: None, - password_stage: None, - captcha_stage: None, - case_insensitive_matching: None, - show_matched_user: None, - enrollment_flow: None, - recovery_flow: None, - passwordless_flow: None, - sources: None, - show_source_labels: None, - pretend_user_exists: None, - enable_remember_me: None, - webauthn_stage: None, - } - } -} diff --git a/packages/client-rust/src/models/impersonation_request.rs b/packages/client-rust/src/models/impersonation_request.rs deleted file mode 100644 index 82f6b3a63d..0000000000 --- a/packages/client-rust/src/models/impersonation_request.rs +++ /dev/null @@ -1,23 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct ImpersonationRequest { - #[serde(rename = "reason")] - pub reason: String, -} - -impl ImpersonationRequest { - pub fn new(reason: String) -> ImpersonationRequest { - ImpersonationRequest { reason } - } -} diff --git a/packages/client-rust/src/models/initial_permissions.rs b/packages/client-rust/src/models/initial_permissions.rs deleted file mode 100644 index 0127cced34..0000000000 --- a/packages/client-rust/src/models/initial_permissions.rs +++ /dev/null @@ -1,44 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// InitialPermissions : InitialPermissions serializer -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct InitialPermissions { - #[serde(rename = "pk")] - pub pk: i32, - #[serde(rename = "name")] - pub name: String, - #[serde(rename = "role")] - pub role: uuid::Uuid, - #[serde(rename = "permissions", skip_serializing_if = "Option::is_none")] - pub permissions: Option>, - #[serde(rename = "permissions_obj")] - pub permissions_obj: Vec, -} - -impl InitialPermissions { - /// InitialPermissions serializer - pub fn new( - pk: i32, - name: String, - role: uuid::Uuid, - permissions_obj: Vec, - ) -> InitialPermissions { - InitialPermissions { - pk, - name, - role, - permissions: None, - permissions_obj, - } - } -} diff --git a/packages/client-rust/src/models/initial_permissions_request.rs b/packages/client-rust/src/models/initial_permissions_request.rs deleted file mode 100644 index 6f4bf85697..0000000000 --- a/packages/client-rust/src/models/initial_permissions_request.rs +++ /dev/null @@ -1,33 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// InitialPermissionsRequest : InitialPermissions serializer -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct InitialPermissionsRequest { - #[serde(rename = "name")] - pub name: String, - #[serde(rename = "role")] - pub role: uuid::Uuid, - #[serde(rename = "permissions", skip_serializing_if = "Option::is_none")] - pub permissions: Option>, -} - -impl InitialPermissionsRequest { - /// InitialPermissions serializer - pub fn new(name: String, role: uuid::Uuid) -> InitialPermissionsRequest { - InitialPermissionsRequest { - name, - role, - permissions: None, - } - } -} diff --git a/packages/client-rust/src/models/install_id.rs b/packages/client-rust/src/models/install_id.rs deleted file mode 100644 index c8a3ffbbcd..0000000000 --- a/packages/client-rust/src/models/install_id.rs +++ /dev/null @@ -1,23 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct InstallId { - #[serde(rename = "install_id")] - pub install_id: String, -} - -impl InstallId { - pub fn new(install_id: String) -> InstallId { - InstallId { install_id } - } -} diff --git a/packages/client-rust/src/models/intent_enum.rs b/packages/client-rust/src/models/intent_enum.rs deleted file mode 100644 index 386ab42dd5..0000000000 --- a/packages/client-rust/src/models/intent_enum.rs +++ /dev/null @@ -1,41 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// -#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] -pub enum IntentEnum { - #[serde(rename = "verification")] - Verification, - #[serde(rename = "api")] - Api, - #[serde(rename = "recovery")] - Recovery, - #[serde(rename = "app_password")] - AppPassword, -} - -impl std::fmt::Display for IntentEnum { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - match self { - Self::Verification => write!(f, "verification"), - Self::Api => write!(f, "api"), - Self::Recovery => write!(f, "recovery"), - Self::AppPassword => write!(f, "app_password"), - } - } -} - -impl Default for IntentEnum { - fn default() -> IntentEnum { - Self::Verification - } -} diff --git a/packages/client-rust/src/models/invalid_response_action_enum.rs b/packages/client-rust/src/models/invalid_response_action_enum.rs deleted file mode 100644 index 904b20a790..0000000000 --- a/packages/client-rust/src/models/invalid_response_action_enum.rs +++ /dev/null @@ -1,38 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// -#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] -pub enum InvalidResponseActionEnum { - #[serde(rename = "retry")] - Retry, - #[serde(rename = "restart")] - Restart, - #[serde(rename = "restart_with_context")] - RestartWithContext, -} - -impl std::fmt::Display for InvalidResponseActionEnum { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - match self { - Self::Retry => write!(f, "retry"), - Self::Restart => write!(f, "restart"), - Self::RestartWithContext => write!(f, "restart_with_context"), - } - } -} - -impl Default for InvalidResponseActionEnum { - fn default() -> InvalidResponseActionEnum { - Self::Retry - } -} diff --git a/packages/client-rust/src/models/invitation.rs b/packages/client-rust/src/models/invitation.rs deleted file mode 100644 index c49cf2890d..0000000000 --- a/packages/client-rust/src/models/invitation.rs +++ /dev/null @@ -1,65 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// Invitation : Invitation Serializer -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct Invitation { - #[serde(rename = "pk")] - pub pk: uuid::Uuid, - #[serde(rename = "name")] - pub name: String, - #[serde( - rename = "expires", - default, - with = "::serde_with::rust::double_option", - skip_serializing_if = "Option::is_none" - )] - pub expires: Option>, - #[serde(rename = "fixed_data", skip_serializing_if = "Option::is_none")] - pub fixed_data: Option>, - #[serde(rename = "created_by")] - pub created_by: models::PartialUser, - /// When enabled, the invitation will be deleted after usage. - #[serde(rename = "single_use", skip_serializing_if = "Option::is_none")] - pub single_use: Option, - /// When set, only the configured flow can use this invitation. - #[serde( - rename = "flow", - default, - with = "::serde_with::rust::double_option", - skip_serializing_if = "Option::is_none" - )] - pub flow: Option>, - #[serde(rename = "flow_obj")] - pub flow_obj: models::Flow, -} - -impl Invitation { - /// Invitation Serializer - pub fn new( - pk: uuid::Uuid, - name: String, - created_by: models::PartialUser, - flow_obj: models::Flow, - ) -> Invitation { - Invitation { - pk, - name, - expires: None, - fixed_data: None, - created_by, - single_use: None, - flow: None, - flow_obj, - } - } -} diff --git a/packages/client-rust/src/models/invitation_request.rs b/packages/client-rust/src/models/invitation_request.rs deleted file mode 100644 index 14b10f06d3..0000000000 --- a/packages/client-rust/src/models/invitation_request.rs +++ /dev/null @@ -1,51 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// InvitationRequest : Invitation Serializer -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct InvitationRequest { - #[serde(rename = "name")] - pub name: String, - #[serde( - rename = "expires", - default, - with = "::serde_with::rust::double_option", - skip_serializing_if = "Option::is_none" - )] - pub expires: Option>, - #[serde(rename = "fixed_data", skip_serializing_if = "Option::is_none")] - pub fixed_data: Option>, - /// When enabled, the invitation will be deleted after usage. - #[serde(rename = "single_use", skip_serializing_if = "Option::is_none")] - pub single_use: Option, - /// When set, only the configured flow can use this invitation. - #[serde( - rename = "flow", - default, - with = "::serde_with::rust::double_option", - skip_serializing_if = "Option::is_none" - )] - pub flow: Option>, -} - -impl InvitationRequest { - /// Invitation Serializer - pub fn new(name: String) -> InvitationRequest { - InvitationRequest { - name, - expires: None, - fixed_data: None, - single_use: None, - flow: None, - } - } -} diff --git a/packages/client-rust/src/models/invitation_send_email_request.rs b/packages/client-rust/src/models/invitation_send_email_request.rs deleted file mode 100644 index 03a1167a35..0000000000 --- a/packages/client-rust/src/models/invitation_send_email_request.rs +++ /dev/null @@ -1,36 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// InvitationSendEmailRequest : Serializer for sending invitation emails -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct InvitationSendEmailRequest { - #[serde(rename = "email_addresses")] - pub email_addresses: Vec, - #[serde(rename = "cc_addresses", skip_serializing_if = "Option::is_none")] - pub cc_addresses: Option>, - #[serde(rename = "bcc_addresses", skip_serializing_if = "Option::is_none")] - pub bcc_addresses: Option>, - #[serde(rename = "template", skip_serializing_if = "Option::is_none")] - pub template: Option, -} - -impl InvitationSendEmailRequest { - /// Serializer for sending invitation emails - pub fn new(email_addresses: Vec) -> InvitationSendEmailRequest { - InvitationSendEmailRequest { - email_addresses, - cc_addresses: None, - bcc_addresses: None, - template: None, - } - } -} diff --git a/packages/client-rust/src/models/invitation_stage.rs b/packages/client-rust/src/models/invitation_stage.rs deleted file mode 100644 index 66aa75b683..0000000000 --- a/packages/client-rust/src/models/invitation_stage.rs +++ /dev/null @@ -1,65 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// InvitationStage : InvitationStage Serializer -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct InvitationStage { - #[serde(rename = "pk")] - pub pk: uuid::Uuid, - #[serde(rename = "name")] - pub name: String, - /// Get object type so that we know how to edit the object - #[serde(rename = "component")] - pub component: String, - /// Return object's verbose_name - #[serde(rename = "verbose_name")] - pub verbose_name: String, - /// Return object's plural verbose_name - #[serde(rename = "verbose_name_plural")] - pub verbose_name_plural: String, - /// Return internal model name - #[serde(rename = "meta_model_name")] - pub meta_model_name: String, - #[serde(rename = "flow_set")] - pub flow_set: Vec, - /// 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. - #[serde( - rename = "continue_flow_without_invitation", - skip_serializing_if = "Option::is_none" - )] - pub continue_flow_without_invitation: Option, -} - -impl InvitationStage { - /// InvitationStage Serializer - pub fn new( - pk: uuid::Uuid, - name: String, - component: String, - verbose_name: String, - verbose_name_plural: String, - meta_model_name: String, - flow_set: Vec, - ) -> InvitationStage { - InvitationStage { - pk, - name, - component, - verbose_name, - verbose_name_plural, - meta_model_name, - flow_set, - continue_flow_without_invitation: None, - } - } -} diff --git a/packages/client-rust/src/models/invitation_stage_request.rs b/packages/client-rust/src/models/invitation_stage_request.rs deleted file mode 100644 index 78e674e1d3..0000000000 --- a/packages/client-rust/src/models/invitation_stage_request.rs +++ /dev/null @@ -1,35 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// InvitationStageRequest : InvitationStage Serializer -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct InvitationStageRequest { - #[serde(rename = "name")] - pub name: String, - /// 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. - #[serde( - rename = "continue_flow_without_invitation", - skip_serializing_if = "Option::is_none" - )] - pub continue_flow_without_invitation: Option, -} - -impl InvitationStageRequest { - /// InvitationStage Serializer - pub fn new(name: String) -> InvitationStageRequest { - InvitationStageRequest { - name, - continue_flow_without_invitation: None, - } - } -} diff --git a/packages/client-rust/src/models/issuer_mode_enum.rs b/packages/client-rust/src/models/issuer_mode_enum.rs deleted file mode 100644 index ce6c9fceae..0000000000 --- a/packages/client-rust/src/models/issuer_mode_enum.rs +++ /dev/null @@ -1,35 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// -#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] -pub enum IssuerModeEnum { - #[serde(rename = "global")] - Global, - #[serde(rename = "per_provider")] - PerProvider, -} - -impl std::fmt::Display for IssuerModeEnum { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - match self { - Self::Global => write!(f, "global"), - Self::PerProvider => write!(f, "per_provider"), - } - } -} - -impl Default for IssuerModeEnum { - fn default() -> IssuerModeEnum { - Self::Global - } -} diff --git a/packages/client-rust/src/models/kadmin_type_enum.rs b/packages/client-rust/src/models/kadmin_type_enum.rs deleted file mode 100644 index 95425b5dc0..0000000000 --- a/packages/client-rust/src/models/kadmin_type_enum.rs +++ /dev/null @@ -1,35 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// -#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] -pub enum KadminTypeEnum { - #[serde(rename = "MIT")] - Mit, - #[serde(rename = "Heimdal")] - Heimdal, -} - -impl std::fmt::Display for KadminTypeEnum { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - match self { - Self::Mit => write!(f, "MIT"), - Self::Heimdal => write!(f, "Heimdal"), - } - } -} - -impl Default for KadminTypeEnum { - fn default() -> KadminTypeEnum { - Self::Mit - } -} diff --git a/packages/client-rust/src/models/kerberos_source.rs b/packages/client-rust/src/models/kerberos_source.rs deleted file mode 100644 index e1d2a84193..0000000000 --- a/packages/client-rust/src/models/kerberos_source.rs +++ /dev/null @@ -1,193 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// KerberosSource : Kerberos Source Serializer -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct KerberosSource { - #[serde(rename = "pk")] - pub pk: uuid::Uuid, - /// Source's display Name. - #[serde(rename = "name")] - pub name: String, - /// Internal source name, used in URLs. - #[serde(rename = "slug")] - pub slug: String, - #[serde(rename = "enabled", skip_serializing_if = "Option::is_none")] - pub enabled: Option, - /// When enabled, this source will be displayed as a prominent button on the login page, - /// instead of a small icon. - #[serde(rename = "promoted", skip_serializing_if = "Option::is_none")] - pub promoted: Option, - /// Flow to use when authenticating existing users. - #[serde( - rename = "authentication_flow", - default, - with = "::serde_with::rust::double_option", - skip_serializing_if = "Option::is_none" - )] - pub authentication_flow: Option>, - /// Flow to use when enrolling new users. - #[serde( - rename = "enrollment_flow", - default, - with = "::serde_with::rust::double_option", - skip_serializing_if = "Option::is_none" - )] - pub enrollment_flow: Option>, - #[serde( - rename = "user_property_mappings", - skip_serializing_if = "Option::is_none" - )] - pub user_property_mappings: Option>, - #[serde( - rename = "group_property_mappings", - skip_serializing_if = "Option::is_none" - )] - pub group_property_mappings: Option>, - /// Get object component so that we know how to edit the object - #[serde(rename = "component")] - pub component: String, - /// Return object's verbose_name - #[serde(rename = "verbose_name")] - pub verbose_name: String, - /// Return object's plural verbose_name - #[serde(rename = "verbose_name_plural")] - pub verbose_name_plural: String, - /// Return internal model name - #[serde(rename = "meta_model_name")] - pub meta_model_name: String, - #[serde(rename = "policy_engine_mode", skip_serializing_if = "Option::is_none")] - pub policy_engine_mode: Option, - /// How the source determines if an existing user should be authenticated or a new user - /// enrolled. - #[serde(rename = "user_matching_mode", skip_serializing_if = "Option::is_none")] - pub user_matching_mode: Option, - /// 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. - #[serde(rename = "managed", deserialize_with = "Option::deserialize")] - pub managed: Option, - #[serde(rename = "user_path_template", skip_serializing_if = "Option::is_none")] - pub user_path_template: Option, - #[serde(rename = "icon", skip_serializing_if = "Option::is_none")] - pub icon: Option, - #[serde(rename = "icon_url")] - pub icon_url: String, - #[serde(rename = "icon_themed_urls", deserialize_with = "Option::deserialize")] - pub icon_themed_urls: Option, - /// How the source determines if an existing group should be used or a new group created. - #[serde( - rename = "group_matching_mode", - skip_serializing_if = "Option::is_none" - )] - pub group_matching_mode: Option, - /// Kerberos realm - #[serde(rename = "realm")] - pub realm: String, - /// Custom krb5.conf to use. Uses the system one by default - #[serde(rename = "krb5_conf", skip_serializing_if = "Option::is_none")] - pub krb5_conf: Option, - /// KAdmin server type - #[serde(rename = "kadmin_type", skip_serializing_if = "Option::is_none")] - pub kadmin_type: Option, - /// Sync users from Kerberos into authentik - #[serde(rename = "sync_users", skip_serializing_if = "Option::is_none")] - pub sync_users: Option, - /// When a user changes their password, sync it back to Kerberos - #[serde( - rename = "sync_users_password", - skip_serializing_if = "Option::is_none" - )] - pub sync_users_password: Option, - /// Principal to authenticate to kadmin for sync. - #[serde(rename = "sync_principal", skip_serializing_if = "Option::is_none")] - pub sync_principal: Option, - /// Credentials cache to authenticate to kadmin for sync. Must be in the form TYPE:residual - #[serde(rename = "sync_ccache", skip_serializing_if = "Option::is_none")] - pub sync_ccache: Option, - /// Get cached source connectivity - #[serde(rename = "connectivity", deserialize_with = "Option::deserialize")] - pub connectivity: Option>, - /// Force the use of a specific server name for SPNEGO. Must be in the form HTTP@hostname - #[serde(rename = "spnego_server_name", skip_serializing_if = "Option::is_none")] - pub spnego_server_name: Option, - /// Credential cache to use for SPNEGO in form type:residual - #[serde(rename = "spnego_ccache", skip_serializing_if = "Option::is_none")] - pub spnego_ccache: Option, - /// If enabled, the authentik-stored password will be updated upon login with the Kerberos - /// password backend - #[serde( - rename = "password_login_update_internal_password", - skip_serializing_if = "Option::is_none" - )] - pub password_login_update_internal_password: Option, - /// When to trigger sync for outgoing providers - #[serde( - rename = "sync_outgoing_trigger_mode", - skip_serializing_if = "Option::is_none" - )] - pub sync_outgoing_trigger_mode: Option, -} - -impl KerberosSource { - /// Kerberos Source Serializer - pub fn new( - pk: uuid::Uuid, - name: String, - slug: String, - component: String, - verbose_name: String, - verbose_name_plural: String, - meta_model_name: String, - managed: Option, - icon_url: String, - icon_themed_urls: Option, - realm: String, - connectivity: Option>, - ) -> KerberosSource { - KerberosSource { - pk, - name, - slug, - enabled: None, - promoted: None, - authentication_flow: None, - enrollment_flow: None, - user_property_mappings: None, - group_property_mappings: None, - component, - verbose_name, - verbose_name_plural, - meta_model_name, - policy_engine_mode: None, - user_matching_mode: None, - managed, - user_path_template: None, - icon: None, - icon_url, - icon_themed_urls, - group_matching_mode: None, - realm, - krb5_conf: None, - kadmin_type: None, - sync_users: None, - sync_users_password: None, - sync_principal: None, - sync_ccache: None, - connectivity, - spnego_server_name: None, - spnego_ccache: None, - password_login_update_internal_password: None, - sync_outgoing_trigger_mode: None, - } - } -} diff --git a/packages/client-rust/src/models/kerberos_source_property_mapping.rs b/packages/client-rust/src/models/kerberos_source_property_mapping.rs deleted file mode 100644 index 0280403133..0000000000 --- a/packages/client-rust/src/models/kerberos_source_property_mapping.rs +++ /dev/null @@ -1,68 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// KerberosSourcePropertyMapping : Kerberos PropertyMapping Serializer -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct KerberosSourcePropertyMapping { - #[serde(rename = "pk")] - pub pk: uuid::Uuid, - /// 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. - #[serde( - rename = "managed", - default, - with = "::serde_with::rust::double_option", - skip_serializing_if = "Option::is_none" - )] - pub managed: Option>, - #[serde(rename = "name")] - pub name: String, - #[serde(rename = "expression")] - pub expression: String, - /// Get object's component so that we know how to edit the object - #[serde(rename = "component")] - pub component: String, - /// Return object's verbose_name - #[serde(rename = "verbose_name")] - pub verbose_name: String, - /// Return object's plural verbose_name - #[serde(rename = "verbose_name_plural")] - pub verbose_name_plural: String, - /// Return internal model name - #[serde(rename = "meta_model_name")] - pub meta_model_name: String, -} - -impl KerberosSourcePropertyMapping { - /// Kerberos PropertyMapping Serializer - pub fn new( - pk: uuid::Uuid, - name: String, - expression: String, - component: String, - verbose_name: String, - verbose_name_plural: String, - meta_model_name: String, - ) -> KerberosSourcePropertyMapping { - KerberosSourcePropertyMapping { - pk, - managed: None, - name, - expression, - component, - verbose_name, - verbose_name_plural, - meta_model_name, - } - } -} diff --git a/packages/client-rust/src/models/kerberos_source_property_mapping_request.rs b/packages/client-rust/src/models/kerberos_source_property_mapping_request.rs deleted file mode 100644 index c4b516c9e8..0000000000 --- a/packages/client-rust/src/models/kerberos_source_property_mapping_request.rs +++ /dev/null @@ -1,41 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// KerberosSourcePropertyMappingRequest : Kerberos PropertyMapping Serializer -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct KerberosSourcePropertyMappingRequest { - /// 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. - #[serde( - rename = "managed", - default, - with = "::serde_with::rust::double_option", - skip_serializing_if = "Option::is_none" - )] - pub managed: Option>, - #[serde(rename = "name")] - pub name: String, - #[serde(rename = "expression")] - pub expression: String, -} - -impl KerberosSourcePropertyMappingRequest { - /// Kerberos PropertyMapping Serializer - pub fn new(name: String, expression: String) -> KerberosSourcePropertyMappingRequest { - KerberosSourcePropertyMappingRequest { - managed: None, - name, - expression, - } - } -} diff --git a/packages/client-rust/src/models/kerberos_source_request.rs b/packages/client-rust/src/models/kerberos_source_request.rs deleted file mode 100644 index 25f387fb81..0000000000 --- a/packages/client-rust/src/models/kerberos_source_request.rs +++ /dev/null @@ -1,158 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// KerberosSourceRequest : Kerberos Source Serializer -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct KerberosSourceRequest { - /// Source's display Name. - #[serde(rename = "name")] - pub name: String, - /// Internal source name, used in URLs. - #[serde(rename = "slug")] - pub slug: String, - #[serde(rename = "enabled", skip_serializing_if = "Option::is_none")] - pub enabled: Option, - /// When enabled, this source will be displayed as a prominent button on the login page, - /// instead of a small icon. - #[serde(rename = "promoted", skip_serializing_if = "Option::is_none")] - pub promoted: Option, - /// Flow to use when authenticating existing users. - #[serde( - rename = "authentication_flow", - default, - with = "::serde_with::rust::double_option", - skip_serializing_if = "Option::is_none" - )] - pub authentication_flow: Option>, - /// Flow to use when enrolling new users. - #[serde( - rename = "enrollment_flow", - default, - with = "::serde_with::rust::double_option", - skip_serializing_if = "Option::is_none" - )] - pub enrollment_flow: Option>, - #[serde( - rename = "user_property_mappings", - skip_serializing_if = "Option::is_none" - )] - pub user_property_mappings: Option>, - #[serde( - rename = "group_property_mappings", - skip_serializing_if = "Option::is_none" - )] - pub group_property_mappings: Option>, - #[serde(rename = "policy_engine_mode", skip_serializing_if = "Option::is_none")] - pub policy_engine_mode: Option, - /// How the source determines if an existing user should be authenticated or a new user - /// enrolled. - #[serde(rename = "user_matching_mode", skip_serializing_if = "Option::is_none")] - pub user_matching_mode: Option, - #[serde(rename = "user_path_template", skip_serializing_if = "Option::is_none")] - pub user_path_template: Option, - #[serde(rename = "icon", skip_serializing_if = "Option::is_none")] - pub icon: Option, - /// How the source determines if an existing group should be used or a new group created. - #[serde( - rename = "group_matching_mode", - skip_serializing_if = "Option::is_none" - )] - pub group_matching_mode: Option, - /// Kerberos realm - #[serde(rename = "realm")] - pub realm: String, - /// Custom krb5.conf to use. Uses the system one by default - #[serde(rename = "krb5_conf", skip_serializing_if = "Option::is_none")] - pub krb5_conf: Option, - /// KAdmin server type - #[serde(rename = "kadmin_type", skip_serializing_if = "Option::is_none")] - pub kadmin_type: Option, - /// Sync users from Kerberos into authentik - #[serde(rename = "sync_users", skip_serializing_if = "Option::is_none")] - pub sync_users: Option, - /// When a user changes their password, sync it back to Kerberos - #[serde( - rename = "sync_users_password", - skip_serializing_if = "Option::is_none" - )] - pub sync_users_password: Option, - /// Principal to authenticate to kadmin for sync. - #[serde(rename = "sync_principal", skip_serializing_if = "Option::is_none")] - pub sync_principal: Option, - /// Password to authenticate to kadmin for sync - #[serde(rename = "sync_password", skip_serializing_if = "Option::is_none")] - pub sync_password: Option, - /// Keytab to authenticate to kadmin for sync. Must be base64-encoded or in the form - /// TYPE:residual - #[serde(rename = "sync_keytab", skip_serializing_if = "Option::is_none")] - pub sync_keytab: Option, - /// Credentials cache to authenticate to kadmin for sync. Must be in the form TYPE:residual - #[serde(rename = "sync_ccache", skip_serializing_if = "Option::is_none")] - pub sync_ccache: Option, - /// Force the use of a specific server name for SPNEGO. Must be in the form HTTP@hostname - #[serde(rename = "spnego_server_name", skip_serializing_if = "Option::is_none")] - pub spnego_server_name: Option, - /// SPNEGO keytab base64-encoded or path to keytab in the form FILE:path - #[serde(rename = "spnego_keytab", skip_serializing_if = "Option::is_none")] - pub spnego_keytab: Option, - /// Credential cache to use for SPNEGO in form type:residual - #[serde(rename = "spnego_ccache", skip_serializing_if = "Option::is_none")] - pub spnego_ccache: Option, - /// If enabled, the authentik-stored password will be updated upon login with the Kerberos - /// password backend - #[serde( - rename = "password_login_update_internal_password", - skip_serializing_if = "Option::is_none" - )] - pub password_login_update_internal_password: Option, - /// When to trigger sync for outgoing providers - #[serde( - rename = "sync_outgoing_trigger_mode", - skip_serializing_if = "Option::is_none" - )] - pub sync_outgoing_trigger_mode: Option, -} - -impl KerberosSourceRequest { - /// Kerberos Source Serializer - pub fn new(name: String, slug: String, realm: String) -> KerberosSourceRequest { - KerberosSourceRequest { - name, - slug, - enabled: None, - promoted: None, - authentication_flow: None, - enrollment_flow: None, - user_property_mappings: None, - group_property_mappings: None, - policy_engine_mode: None, - user_matching_mode: None, - user_path_template: None, - icon: None, - group_matching_mode: None, - realm, - krb5_conf: None, - kadmin_type: None, - sync_users: None, - sync_users_password: None, - sync_principal: None, - sync_password: None, - sync_keytab: None, - sync_ccache: None, - spnego_server_name: None, - spnego_keytab: None, - spnego_ccache: None, - password_login_update_internal_password: None, - sync_outgoing_trigger_mode: None, - } - } -} diff --git a/packages/client-rust/src/models/key_type_enum.rs b/packages/client-rust/src/models/key_type_enum.rs deleted file mode 100644 index 482d89ebba..0000000000 --- a/packages/client-rust/src/models/key_type_enum.rs +++ /dev/null @@ -1,44 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// -#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] -pub enum KeyTypeEnum { - #[serde(rename = "dsa")] - Dsa, - #[serde(rename = "ec")] - Ec, - #[serde(rename = "ed25519")] - Ed25519, - #[serde(rename = "ed448")] - Ed448, - #[serde(rename = "rsa")] - Rsa, -} - -impl std::fmt::Display for KeyTypeEnum { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - match self { - Self::Dsa => write!(f, "dsa"), - Self::Ec => write!(f, "ec"), - Self::Ed25519 => write!(f, "ed25519"), - Self::Ed448 => write!(f, "ed448"), - Self::Rsa => write!(f, "rsa"), - } - } -} - -impl Default for KeyTypeEnum { - fn default() -> KeyTypeEnum { - Self::Dsa - } -} diff --git a/packages/client-rust/src/models/kubernetes_service_connection.rs b/packages/client-rust/src/models/kubernetes_service_connection.rs deleted file mode 100644 index 1a3cc53ceb..0000000000 --- a/packages/client-rust/src/models/kubernetes_service_connection.rs +++ /dev/null @@ -1,65 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// KubernetesServiceConnection : KubernetesServiceConnection Serializer -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct KubernetesServiceConnection { - #[serde(rename = "pk")] - pub pk: uuid::Uuid, - #[serde(rename = "name")] - pub name: String, - /// If enabled, use the local connection. Required Docker socket/Kubernetes Integration - #[serde(rename = "local", skip_serializing_if = "Option::is_none")] - pub local: Option, - #[serde(rename = "component")] - pub component: String, - /// Return object's verbose_name - #[serde(rename = "verbose_name")] - pub verbose_name: String, - /// Return object's plural verbose_name - #[serde(rename = "verbose_name_plural")] - pub verbose_name_plural: String, - /// Return internal model name - #[serde(rename = "meta_model_name")] - pub meta_model_name: String, - /// Paste your kubeconfig here. authentik will automatically use the currently selected - /// context. - #[serde(rename = "kubeconfig", skip_serializing_if = "Option::is_none")] - pub kubeconfig: Option>, - /// Verify SSL Certificates of the Kubernetes API endpoint - #[serde(rename = "verify_ssl", skip_serializing_if = "Option::is_none")] - pub verify_ssl: Option, -} - -impl KubernetesServiceConnection { - /// KubernetesServiceConnection Serializer - pub fn new( - pk: uuid::Uuid, - name: String, - component: String, - verbose_name: String, - verbose_name_plural: String, - meta_model_name: String, - ) -> KubernetesServiceConnection { - KubernetesServiceConnection { - pk, - name, - local: None, - component, - verbose_name, - verbose_name_plural, - meta_model_name, - kubeconfig: None, - verify_ssl: None, - } - } -} diff --git a/packages/client-rust/src/models/kubernetes_service_connection_request.rs b/packages/client-rust/src/models/kubernetes_service_connection_request.rs deleted file mode 100644 index 5aa8535c85..0000000000 --- a/packages/client-rust/src/models/kubernetes_service_connection_request.rs +++ /dev/null @@ -1,40 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// KubernetesServiceConnectionRequest : KubernetesServiceConnection Serializer -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct KubernetesServiceConnectionRequest { - #[serde(rename = "name")] - pub name: String, - /// If enabled, use the local connection. Required Docker socket/Kubernetes Integration - #[serde(rename = "local", skip_serializing_if = "Option::is_none")] - pub local: Option, - /// Paste your kubeconfig here. authentik will automatically use the currently selected - /// context. - #[serde(rename = "kubeconfig", skip_serializing_if = "Option::is_none")] - pub kubeconfig: Option>, - /// Verify SSL Certificates of the Kubernetes API endpoint - #[serde(rename = "verify_ssl", skip_serializing_if = "Option::is_none")] - pub verify_ssl: Option, -} - -impl KubernetesServiceConnectionRequest { - /// KubernetesServiceConnection Serializer - pub fn new(name: String) -> KubernetesServiceConnectionRequest { - KubernetesServiceConnectionRequest { - name, - local: None, - kubeconfig: None, - verify_ssl: None, - } - } -} diff --git a/packages/client-rust/src/models/lang_enum.rs b/packages/client-rust/src/models/lang_enum.rs deleted file mode 100644 index 88334893b6..0000000000 --- a/packages/client-rust/src/models/lang_enum.rs +++ /dev/null @@ -1,326 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// -#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] -pub enum LangEnum { - #[serde(rename = "af")] - Af, - #[serde(rename = "ar")] - Ar, - #[serde(rename = "ar-dz")] - ArDz, - #[serde(rename = "ast")] - Ast, - #[serde(rename = "az")] - Az, - #[serde(rename = "be")] - Be, - #[serde(rename = "bg")] - Bg, - #[serde(rename = "bn")] - Bn, - #[serde(rename = "br")] - Br, - #[serde(rename = "bs")] - Bs, - #[serde(rename = "ca")] - Ca, - #[serde(rename = "ckb")] - Ckb, - #[serde(rename = "cs")] - Cs, - #[serde(rename = "cy")] - Cy, - #[serde(rename = "da")] - Da, - #[serde(rename = "de")] - De, - #[serde(rename = "dsb")] - Dsb, - #[serde(rename = "el")] - El, - #[serde(rename = "en")] - En, - #[serde(rename = "en-au")] - EnAu, - #[serde(rename = "en-gb")] - EnGb, - #[serde(rename = "eo")] - Eo, - #[serde(rename = "es")] - Es, - #[serde(rename = "es-ar")] - EsAr, - #[serde(rename = "es-co")] - EsCo, - #[serde(rename = "es-mx")] - EsMx, - #[serde(rename = "es-ni")] - EsNi, - #[serde(rename = "es-ve")] - EsVe, - #[serde(rename = "et")] - Et, - #[serde(rename = "eu")] - Eu, - #[serde(rename = "fa")] - Fa, - #[serde(rename = "fi")] - Fi, - #[serde(rename = "fr")] - Fr, - #[serde(rename = "fy")] - Fy, - #[serde(rename = "ga")] - Ga, - #[serde(rename = "gd")] - Gd, - #[serde(rename = "gl")] - Gl, - #[serde(rename = "he")] - He, - #[serde(rename = "hi")] - Hi, - #[serde(rename = "hr")] - Hr, - #[serde(rename = "hsb")] - Hsb, - #[serde(rename = "hu")] - Hu, - #[serde(rename = "hy")] - Hy, - #[serde(rename = "ia")] - Ia, - #[serde(rename = "id")] - Id, - #[serde(rename = "ig")] - Ig, - #[serde(rename = "io")] - Io, - #[serde(rename = "is")] - Is, - #[serde(rename = "it")] - It, - #[serde(rename = "ja")] - Ja, - #[serde(rename = "ka")] - Ka, - #[serde(rename = "kab")] - Kab, - #[serde(rename = "kk")] - Kk, - #[serde(rename = "km")] - Km, - #[serde(rename = "kn")] - Kn, - #[serde(rename = "ko")] - Ko, - #[serde(rename = "ky")] - Ky, - #[serde(rename = "lb")] - Lb, - #[serde(rename = "lt")] - Lt, - #[serde(rename = "lv")] - Lv, - #[serde(rename = "mk")] - Mk, - #[serde(rename = "ml")] - Ml, - #[serde(rename = "mn")] - Mn, - #[serde(rename = "mr")] - Mr, - #[serde(rename = "ms")] - Ms, - #[serde(rename = "my")] - My, - #[serde(rename = "nb")] - Nb, - #[serde(rename = "ne")] - Ne, - #[serde(rename = "nl")] - Nl, - #[serde(rename = "nn")] - Nn, - #[serde(rename = "os")] - Os, - #[serde(rename = "pa")] - Pa, - #[serde(rename = "pl")] - Pl, - #[serde(rename = "pt")] - Pt, - #[serde(rename = "pt-br")] - PtBr, - #[serde(rename = "ro")] - Ro, - #[serde(rename = "ru")] - Ru, - #[serde(rename = "sk")] - Sk, - #[serde(rename = "sl")] - Sl, - #[serde(rename = "sq")] - Sq, - #[serde(rename = "sr")] - Sr, - #[serde(rename = "sr-latn")] - SrLatn, - #[serde(rename = "sv")] - Sv, - #[serde(rename = "sw")] - Sw, - #[serde(rename = "ta")] - Ta, - #[serde(rename = "te")] - Te, - #[serde(rename = "tg")] - Tg, - #[serde(rename = "th")] - Th, - #[serde(rename = "tk")] - Tk, - #[serde(rename = "tr")] - Tr, - #[serde(rename = "tt")] - Tt, - #[serde(rename = "udm")] - Udm, - #[serde(rename = "ug")] - Ug, - #[serde(rename = "uk")] - Uk, - #[serde(rename = "ur")] - Ur, - #[serde(rename = "uz")] - Uz, - #[serde(rename = "vi")] - Vi, - #[serde(rename = "zh-hans")] - ZhHans, - #[serde(rename = "zh-hant")] - ZhHant, -} - -impl std::fmt::Display for LangEnum { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - match self { - Self::Af => write!(f, "af"), - Self::Ar => write!(f, "ar"), - Self::ArDz => write!(f, "ar-dz"), - Self::Ast => write!(f, "ast"), - Self::Az => write!(f, "az"), - Self::Be => write!(f, "be"), - Self::Bg => write!(f, "bg"), - Self::Bn => write!(f, "bn"), - Self::Br => write!(f, "br"), - Self::Bs => write!(f, "bs"), - Self::Ca => write!(f, "ca"), - Self::Ckb => write!(f, "ckb"), - Self::Cs => write!(f, "cs"), - Self::Cy => write!(f, "cy"), - Self::Da => write!(f, "da"), - Self::De => write!(f, "de"), - Self::Dsb => write!(f, "dsb"), - Self::El => write!(f, "el"), - Self::En => write!(f, "en"), - Self::EnAu => write!(f, "en-au"), - Self::EnGb => write!(f, "en-gb"), - Self::Eo => write!(f, "eo"), - Self::Es => write!(f, "es"), - Self::EsAr => write!(f, "es-ar"), - Self::EsCo => write!(f, "es-co"), - Self::EsMx => write!(f, "es-mx"), - Self::EsNi => write!(f, "es-ni"), - Self::EsVe => write!(f, "es-ve"), - Self::Et => write!(f, "et"), - Self::Eu => write!(f, "eu"), - Self::Fa => write!(f, "fa"), - Self::Fi => write!(f, "fi"), - Self::Fr => write!(f, "fr"), - Self::Fy => write!(f, "fy"), - Self::Ga => write!(f, "ga"), - Self::Gd => write!(f, "gd"), - Self::Gl => write!(f, "gl"), - Self::He => write!(f, "he"), - Self::Hi => write!(f, "hi"), - Self::Hr => write!(f, "hr"), - Self::Hsb => write!(f, "hsb"), - Self::Hu => write!(f, "hu"), - Self::Hy => write!(f, "hy"), - Self::Ia => write!(f, "ia"), - Self::Id => write!(f, "id"), - Self::Ig => write!(f, "ig"), - Self::Io => write!(f, "io"), - Self::Is => write!(f, "is"), - Self::It => write!(f, "it"), - Self::Ja => write!(f, "ja"), - Self::Ka => write!(f, "ka"), - Self::Kab => write!(f, "kab"), - Self::Kk => write!(f, "kk"), - Self::Km => write!(f, "km"), - Self::Kn => write!(f, "kn"), - Self::Ko => write!(f, "ko"), - Self::Ky => write!(f, "ky"), - Self::Lb => write!(f, "lb"), - Self::Lt => write!(f, "lt"), - Self::Lv => write!(f, "lv"), - Self::Mk => write!(f, "mk"), - Self::Ml => write!(f, "ml"), - Self::Mn => write!(f, "mn"), - Self::Mr => write!(f, "mr"), - Self::Ms => write!(f, "ms"), - Self::My => write!(f, "my"), - Self::Nb => write!(f, "nb"), - Self::Ne => write!(f, "ne"), - Self::Nl => write!(f, "nl"), - Self::Nn => write!(f, "nn"), - Self::Os => write!(f, "os"), - Self::Pa => write!(f, "pa"), - Self::Pl => write!(f, "pl"), - Self::Pt => write!(f, "pt"), - Self::PtBr => write!(f, "pt-br"), - Self::Ro => write!(f, "ro"), - Self::Ru => write!(f, "ru"), - Self::Sk => write!(f, "sk"), - Self::Sl => write!(f, "sl"), - Self::Sq => write!(f, "sq"), - Self::Sr => write!(f, "sr"), - Self::SrLatn => write!(f, "sr-latn"), - Self::Sv => write!(f, "sv"), - Self::Sw => write!(f, "sw"), - Self::Ta => write!(f, "ta"), - Self::Te => write!(f, "te"), - Self::Tg => write!(f, "tg"), - Self::Th => write!(f, "th"), - Self::Tk => write!(f, "tk"), - Self::Tr => write!(f, "tr"), - Self::Tt => write!(f, "tt"), - Self::Udm => write!(f, "udm"), - Self::Ug => write!(f, "ug"), - Self::Uk => write!(f, "uk"), - Self::Ur => write!(f, "ur"), - Self::Uz => write!(f, "uz"), - Self::Vi => write!(f, "vi"), - Self::ZhHans => write!(f, "zh-hans"), - Self::ZhHant => write!(f, "zh-hant"), - } - } -} - -impl Default for LangEnum { - fn default() -> LangEnum { - Self::Af - } -} diff --git a/packages/client-rust/src/models/last_task_status_enum.rs b/packages/client-rust/src/models/last_task_status_enum.rs deleted file mode 100644 index 79575b26c8..0000000000 --- a/packages/client-rust/src/models/last_task_status_enum.rs +++ /dev/null @@ -1,59 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// -#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] -pub enum LastTaskStatusEnum { - #[serde(rename = "queued")] - Queued, - #[serde(rename = "consumed")] - Consumed, - #[serde(rename = "preprocess")] - Preprocess, - #[serde(rename = "running")] - Running, - #[serde(rename = "postprocess")] - Postprocess, - #[serde(rename = "rejected")] - Rejected, - #[serde(rename = "done")] - Done, - #[serde(rename = "info")] - Info, - #[serde(rename = "warning")] - Warning, - #[serde(rename = "error")] - Error, -} - -impl std::fmt::Display for LastTaskStatusEnum { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - match self { - Self::Queued => write!(f, "queued"), - Self::Consumed => write!(f, "consumed"), - Self::Preprocess => write!(f, "preprocess"), - Self::Running => write!(f, "running"), - Self::Postprocess => write!(f, "postprocess"), - Self::Rejected => write!(f, "rejected"), - Self::Done => write!(f, "done"), - Self::Info => write!(f, "info"), - Self::Warning => write!(f, "warning"), - Self::Error => write!(f, "error"), - } - } -} - -impl Default for LastTaskStatusEnum { - fn default() -> LastTaskStatusEnum { - Self::Queued - } -} diff --git a/packages/client-rust/src/models/ldap_debug.rs b/packages/client-rust/src/models/ldap_debug.rs deleted file mode 100644 index 0c8727e346..0000000000 --- a/packages/client-rust/src/models/ldap_debug.rs +++ /dev/null @@ -1,35 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct LdapDebug { - #[serde(rename = "user")] - pub user: Vec>, - #[serde(rename = "group")] - pub group: Vec>, - #[serde(rename = "membership")] - pub membership: Vec>, -} - -impl LdapDebug { - pub fn new( - user: Vec>, - group: Vec>, - membership: Vec>, - ) -> LdapDebug { - LdapDebug { - user, - group, - membership, - } - } -} diff --git a/packages/client-rust/src/models/ldap_provider.rs b/packages/client-rust/src/models/ldap_provider.rs deleted file mode 100644 index 87a4030de5..0000000000 --- a/packages/client-rust/src/models/ldap_provider.rs +++ /dev/null @@ -1,152 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// LdapProvider : LDAPProvider Serializer -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct LdapProvider { - #[serde(rename = "pk")] - pub pk: i32, - #[serde(rename = "name")] - pub name: String, - /// Flow used for authentication when the associated application is accessed by an - /// un-authenticated user. - #[serde( - rename = "authentication_flow", - default, - with = "::serde_with::rust::double_option", - skip_serializing_if = "Option::is_none" - )] - pub authentication_flow: Option>, - /// Flow used when authorizing this provider. - #[serde(rename = "authorization_flow")] - pub authorization_flow: uuid::Uuid, - /// Flow used ending the session from a provider. - #[serde(rename = "invalidation_flow")] - pub invalidation_flow: uuid::Uuid, - #[serde(rename = "property_mappings", skip_serializing_if = "Option::is_none")] - pub property_mappings: Option>, - /// Get object component so that we know how to edit the object - #[serde(rename = "component")] - pub component: String, - /// Internal application name, used in URLs. - #[serde( - rename = "assigned_application_slug", - deserialize_with = "Option::deserialize" - )] - pub assigned_application_slug: Option, - /// Application's display Name. - #[serde( - rename = "assigned_application_name", - deserialize_with = "Option::deserialize" - )] - pub assigned_application_name: Option, - /// Internal application name, used in URLs. - #[serde( - rename = "assigned_backchannel_application_slug", - deserialize_with = "Option::deserialize" - )] - pub assigned_backchannel_application_slug: Option, - /// Application's display Name. - #[serde( - rename = "assigned_backchannel_application_name", - deserialize_with = "Option::deserialize" - )] - pub assigned_backchannel_application_name: Option, - /// Return object's verbose_name - #[serde(rename = "verbose_name")] - pub verbose_name: String, - /// Return object's plural verbose_name - #[serde(rename = "verbose_name_plural")] - pub verbose_name_plural: String, - /// Return internal model name - #[serde(rename = "meta_model_name")] - pub meta_model_name: String, - /// DN under which objects are accessible. - #[serde(rename = "base_dn", skip_serializing_if = "Option::is_none")] - pub base_dn: Option, - #[serde( - rename = "certificate", - default, - with = "::serde_with::rust::double_option", - skip_serializing_if = "Option::is_none" - )] - pub certificate: Option>, - #[serde(rename = "tls_server_name", skip_serializing_if = "Option::is_none")] - pub tls_server_name: Option, - /// 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 - #[serde(rename = "uid_start_number", skip_serializing_if = "Option::is_none")] - pub uid_start_number: Option, - /// 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 - #[serde(rename = "gid_start_number", skip_serializing_if = "Option::is_none")] - pub gid_start_number: Option, - #[serde(rename = "outpost_set")] - pub outpost_set: Vec, - #[serde(rename = "search_mode", skip_serializing_if = "Option::is_none")] - pub search_mode: Option, - #[serde(rename = "bind_mode", skip_serializing_if = "Option::is_none")] - pub bind_mode: Option, - /// 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. - #[serde(rename = "mfa_support", skip_serializing_if = "Option::is_none")] - pub mfa_support: Option, -} - -impl LdapProvider { - /// LDAPProvider Serializer - pub fn new( - pk: i32, - name: String, - authorization_flow: uuid::Uuid, - invalidation_flow: uuid::Uuid, - component: String, - assigned_application_slug: Option, - assigned_application_name: Option, - assigned_backchannel_application_slug: Option, - assigned_backchannel_application_name: Option, - verbose_name: String, - verbose_name_plural: String, - meta_model_name: String, - outpost_set: Vec, - ) -> LdapProvider { - LdapProvider { - pk, - name, - authentication_flow: None, - authorization_flow, - invalidation_flow, - property_mappings: None, - component, - assigned_application_slug, - assigned_application_name, - assigned_backchannel_application_slug, - assigned_backchannel_application_name, - verbose_name, - verbose_name_plural, - meta_model_name, - base_dn: None, - certificate: None, - tls_server_name: None, - uid_start_number: None, - gid_start_number: None, - outpost_set, - search_mode: None, - bind_mode: None, - mfa_support: None, - } - } -} diff --git a/packages/client-rust/src/models/ldap_provider_request.rs b/packages/client-rust/src/models/ldap_provider_request.rs deleted file mode 100644 index 36e51c2f6e..0000000000 --- a/packages/client-rust/src/models/ldap_provider_request.rs +++ /dev/null @@ -1,92 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// LdapProviderRequest : LDAPProvider Serializer -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct LdapProviderRequest { - #[serde(rename = "name")] - pub name: String, - /// Flow used for authentication when the associated application is accessed by an - /// un-authenticated user. - #[serde( - rename = "authentication_flow", - default, - with = "::serde_with::rust::double_option", - skip_serializing_if = "Option::is_none" - )] - pub authentication_flow: Option>, - /// Flow used when authorizing this provider. - #[serde(rename = "authorization_flow")] - pub authorization_flow: uuid::Uuid, - /// Flow used ending the session from a provider. - #[serde(rename = "invalidation_flow")] - pub invalidation_flow: uuid::Uuid, - #[serde(rename = "property_mappings", skip_serializing_if = "Option::is_none")] - pub property_mappings: Option>, - /// DN under which objects are accessible. - #[serde(rename = "base_dn", skip_serializing_if = "Option::is_none")] - pub base_dn: Option, - #[serde( - rename = "certificate", - default, - with = "::serde_with::rust::double_option", - skip_serializing_if = "Option::is_none" - )] - pub certificate: Option>, - #[serde(rename = "tls_server_name", skip_serializing_if = "Option::is_none")] - pub tls_server_name: Option, - /// 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 - #[serde(rename = "uid_start_number", skip_serializing_if = "Option::is_none")] - pub uid_start_number: Option, - /// 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 - #[serde(rename = "gid_start_number", skip_serializing_if = "Option::is_none")] - pub gid_start_number: Option, - #[serde(rename = "search_mode", skip_serializing_if = "Option::is_none")] - pub search_mode: Option, - #[serde(rename = "bind_mode", skip_serializing_if = "Option::is_none")] - pub bind_mode: Option, - /// 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. - #[serde(rename = "mfa_support", skip_serializing_if = "Option::is_none")] - pub mfa_support: Option, -} - -impl LdapProviderRequest { - /// LDAPProvider Serializer - pub fn new( - name: String, - authorization_flow: uuid::Uuid, - invalidation_flow: uuid::Uuid, - ) -> LdapProviderRequest { - LdapProviderRequest { - name, - authentication_flow: None, - authorization_flow, - invalidation_flow, - property_mappings: None, - base_dn: None, - certificate: None, - tls_server_name: None, - uid_start_number: None, - gid_start_number: None, - search_mode: None, - bind_mode: None, - mfa_support: None, - } - } -} diff --git a/packages/client-rust/src/models/ldap_source.rs b/packages/client-rust/src/models/ldap_source.rs deleted file mode 100644 index 16f934bb70..0000000000 --- a/packages/client-rust/src/models/ldap_source.rs +++ /dev/null @@ -1,264 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// LdapSource : LDAP Source Serializer -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct LdapSource { - #[serde(rename = "pk")] - pub pk: uuid::Uuid, - /// Source's display Name. - #[serde(rename = "name")] - pub name: String, - /// Internal source name, used in URLs. - #[serde(rename = "slug")] - pub slug: String, - #[serde(rename = "enabled", skip_serializing_if = "Option::is_none")] - pub enabled: Option, - /// When enabled, this source will be displayed as a prominent button on the login page, - /// instead of a small icon. - #[serde(rename = "promoted", skip_serializing_if = "Option::is_none")] - pub promoted: Option, - /// Flow to use when authenticating existing users. - #[serde( - rename = "authentication_flow", - default, - with = "::serde_with::rust::double_option", - skip_serializing_if = "Option::is_none" - )] - pub authentication_flow: Option>, - /// Flow to use when enrolling new users. - #[serde( - rename = "enrollment_flow", - default, - with = "::serde_with::rust::double_option", - skip_serializing_if = "Option::is_none" - )] - pub enrollment_flow: Option>, - #[serde( - rename = "user_property_mappings", - skip_serializing_if = "Option::is_none" - )] - pub user_property_mappings: Option>, - #[serde( - rename = "group_property_mappings", - skip_serializing_if = "Option::is_none" - )] - pub group_property_mappings: Option>, - /// Get object component so that we know how to edit the object - #[serde(rename = "component")] - pub component: String, - /// Return object's verbose_name - #[serde(rename = "verbose_name")] - pub verbose_name: String, - /// Return object's plural verbose_name - #[serde(rename = "verbose_name_plural")] - pub verbose_name_plural: String, - /// Return internal model name - #[serde(rename = "meta_model_name")] - pub meta_model_name: String, - #[serde(rename = "policy_engine_mode", skip_serializing_if = "Option::is_none")] - pub policy_engine_mode: Option, - /// How the source determines if an existing user should be authenticated or a new user - /// enrolled. - #[serde(rename = "user_matching_mode", skip_serializing_if = "Option::is_none")] - pub user_matching_mode: Option, - /// 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. - #[serde(rename = "managed", deserialize_with = "Option::deserialize")] - pub managed: Option, - #[serde(rename = "user_path_template", skip_serializing_if = "Option::is_none")] - pub user_path_template: Option, - #[serde(rename = "icon", skip_serializing_if = "Option::is_none")] - pub icon: Option, - #[serde(rename = "icon_url")] - pub icon_url: String, - #[serde(rename = "icon_themed_urls", deserialize_with = "Option::deserialize")] - pub icon_themed_urls: Option, - #[serde(rename = "server_uri")] - pub server_uri: String, - /// Optionally verify the LDAP Server's Certificate against the CA Chain in this keypair. - #[serde( - rename = "peer_certificate", - default, - with = "::serde_with::rust::double_option", - skip_serializing_if = "Option::is_none" - )] - pub peer_certificate: Option>, - /// Client certificate to authenticate against the LDAP Server's Certificate. - #[serde( - rename = "client_certificate", - default, - with = "::serde_with::rust::double_option", - skip_serializing_if = "Option::is_none" - )] - pub client_certificate: Option>, - #[serde(rename = "bind_cn", skip_serializing_if = "Option::is_none")] - pub bind_cn: Option, - #[serde(rename = "start_tls", skip_serializing_if = "Option::is_none")] - pub start_tls: Option, - #[serde(rename = "sni", skip_serializing_if = "Option::is_none")] - pub sni: Option, - #[serde(rename = "base_dn")] - pub base_dn: String, - /// Prepended to Base DN for User-queries. - #[serde(rename = "additional_user_dn", skip_serializing_if = "Option::is_none")] - pub additional_user_dn: Option, - /// Prepended to Base DN for Group-queries. - #[serde( - rename = "additional_group_dn", - skip_serializing_if = "Option::is_none" - )] - pub additional_group_dn: Option, - /// Consider Objects matching this filter to be Users. - #[serde(rename = "user_object_filter", skip_serializing_if = "Option::is_none")] - pub user_object_filter: Option, - /// Consider Objects matching this filter to be Groups. - #[serde( - rename = "group_object_filter", - skip_serializing_if = "Option::is_none" - )] - pub group_object_filter: Option, - /// Field which contains members of a group. - #[serde( - rename = "group_membership_field", - skip_serializing_if = "Option::is_none" - )] - pub group_membership_field: Option, - /// Attribute which matches the value of `group_membership_field`. - #[serde( - rename = "user_membership_attribute", - skip_serializing_if = "Option::is_none" - )] - pub user_membership_attribute: Option, - /// Field which contains a unique Identifier. - #[serde( - rename = "object_uniqueness_field", - skip_serializing_if = "Option::is_none" - )] - pub object_uniqueness_field: Option, - /// Update internal authentik password when login succeeds with LDAP - #[serde( - rename = "password_login_update_internal_password", - skip_serializing_if = "Option::is_none" - )] - pub password_login_update_internal_password: Option, - #[serde(rename = "sync_users", skip_serializing_if = "Option::is_none")] - pub sync_users: Option, - /// When a user changes their password, sync it back to LDAP. This can only be enabled on a - /// single LDAP source. - #[serde( - rename = "sync_users_password", - skip_serializing_if = "Option::is_none" - )] - pub sync_users_password: Option, - #[serde(rename = "sync_groups", skip_serializing_if = "Option::is_none")] - pub sync_groups: Option, - #[serde( - rename = "sync_parent_group", - default, - with = "::serde_with::rust::double_option", - skip_serializing_if = "Option::is_none" - )] - pub sync_parent_group: Option>, - /// Get cached source connectivity - #[serde(rename = "connectivity", deserialize_with = "Option::deserialize")] - pub connectivity: - Option>>, - /// 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 - #[serde( - rename = "lookup_groups_from_user", - skip_serializing_if = "Option::is_none" - )] - pub lookup_groups_from_user: Option, - /// Delete authentik users and groups which were previously supplied by this source, but are - /// now missing from it. - #[serde( - rename = "delete_not_found_objects", - skip_serializing_if = "Option::is_none" - )] - pub delete_not_found_objects: Option, - /// When to trigger sync for outgoing providers - #[serde( - rename = "sync_outgoing_trigger_mode", - skip_serializing_if = "Option::is_none" - )] - pub sync_outgoing_trigger_mode: Option, -} - -impl LdapSource { - /// LDAP Source Serializer - pub fn new( - pk: uuid::Uuid, - name: String, - slug: String, - component: String, - verbose_name: String, - verbose_name_plural: String, - meta_model_name: String, - managed: Option, - icon_url: String, - icon_themed_urls: Option, - server_uri: String, - base_dn: String, - connectivity: Option< - std::collections::HashMap>, - >, - ) -> LdapSource { - LdapSource { - pk, - name, - slug, - enabled: None, - promoted: None, - authentication_flow: None, - enrollment_flow: None, - user_property_mappings: None, - group_property_mappings: None, - component, - verbose_name, - verbose_name_plural, - meta_model_name, - policy_engine_mode: None, - user_matching_mode: None, - managed, - user_path_template: None, - icon: None, - icon_url, - icon_themed_urls, - server_uri, - peer_certificate: None, - client_certificate: None, - bind_cn: None, - start_tls: None, - sni: None, - base_dn, - additional_user_dn: None, - additional_group_dn: None, - user_object_filter: None, - group_object_filter: None, - group_membership_field: None, - user_membership_attribute: None, - object_uniqueness_field: None, - password_login_update_internal_password: None, - sync_users: None, - sync_users_password: None, - sync_groups: None, - sync_parent_group: None, - connectivity, - lookup_groups_from_user: None, - delete_not_found_objects: None, - sync_outgoing_trigger_mode: None, - } - } -} diff --git a/packages/client-rust/src/models/ldap_source_property_mapping.rs b/packages/client-rust/src/models/ldap_source_property_mapping.rs deleted file mode 100644 index 7aba86e5ef..0000000000 --- a/packages/client-rust/src/models/ldap_source_property_mapping.rs +++ /dev/null @@ -1,68 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// LdapSourcePropertyMapping : LDAP PropertyMapping Serializer -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct LdapSourcePropertyMapping { - #[serde(rename = "pk")] - pub pk: uuid::Uuid, - /// 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. - #[serde( - rename = "managed", - default, - with = "::serde_with::rust::double_option", - skip_serializing_if = "Option::is_none" - )] - pub managed: Option>, - #[serde(rename = "name")] - pub name: String, - #[serde(rename = "expression")] - pub expression: String, - /// Get object's component so that we know how to edit the object - #[serde(rename = "component")] - pub component: String, - /// Return object's verbose_name - #[serde(rename = "verbose_name")] - pub verbose_name: String, - /// Return object's plural verbose_name - #[serde(rename = "verbose_name_plural")] - pub verbose_name_plural: String, - /// Return internal model name - #[serde(rename = "meta_model_name")] - pub meta_model_name: String, -} - -impl LdapSourcePropertyMapping { - /// LDAP PropertyMapping Serializer - pub fn new( - pk: uuid::Uuid, - name: String, - expression: String, - component: String, - verbose_name: String, - verbose_name_plural: String, - meta_model_name: String, - ) -> LdapSourcePropertyMapping { - LdapSourcePropertyMapping { - pk, - managed: None, - name, - expression, - component, - verbose_name, - verbose_name_plural, - meta_model_name, - } - } -} diff --git a/packages/client-rust/src/models/ldap_source_property_mapping_request.rs b/packages/client-rust/src/models/ldap_source_property_mapping_request.rs deleted file mode 100644 index b4b23ec18e..0000000000 --- a/packages/client-rust/src/models/ldap_source_property_mapping_request.rs +++ /dev/null @@ -1,41 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// LdapSourcePropertyMappingRequest : LDAP PropertyMapping Serializer -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct LdapSourcePropertyMappingRequest { - /// 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. - #[serde( - rename = "managed", - default, - with = "::serde_with::rust::double_option", - skip_serializing_if = "Option::is_none" - )] - pub managed: Option>, - #[serde(rename = "name")] - pub name: String, - #[serde(rename = "expression")] - pub expression: String, -} - -impl LdapSourcePropertyMappingRequest { - /// LDAP PropertyMapping Serializer - pub fn new(name: String, expression: String) -> LdapSourcePropertyMappingRequest { - LdapSourcePropertyMappingRequest { - managed: None, - name, - expression, - } - } -} diff --git a/packages/client-rust/src/models/ldap_source_request.rs b/packages/client-rust/src/models/ldap_source_request.rs deleted file mode 100644 index 07e0cf3b36..0000000000 --- a/packages/client-rust/src/models/ldap_source_request.rs +++ /dev/null @@ -1,220 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// LdapSourceRequest : LDAP Source Serializer -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct LdapSourceRequest { - /// Source's display Name. - #[serde(rename = "name")] - pub name: String, - /// Internal source name, used in URLs. - #[serde(rename = "slug")] - pub slug: String, - #[serde(rename = "enabled", skip_serializing_if = "Option::is_none")] - pub enabled: Option, - /// When enabled, this source will be displayed as a prominent button on the login page, - /// instead of a small icon. - #[serde(rename = "promoted", skip_serializing_if = "Option::is_none")] - pub promoted: Option, - /// Flow to use when authenticating existing users. - #[serde( - rename = "authentication_flow", - default, - with = "::serde_with::rust::double_option", - skip_serializing_if = "Option::is_none" - )] - pub authentication_flow: Option>, - /// Flow to use when enrolling new users. - #[serde( - rename = "enrollment_flow", - default, - with = "::serde_with::rust::double_option", - skip_serializing_if = "Option::is_none" - )] - pub enrollment_flow: Option>, - #[serde( - rename = "user_property_mappings", - skip_serializing_if = "Option::is_none" - )] - pub user_property_mappings: Option>, - #[serde( - rename = "group_property_mappings", - skip_serializing_if = "Option::is_none" - )] - pub group_property_mappings: Option>, - #[serde(rename = "policy_engine_mode", skip_serializing_if = "Option::is_none")] - pub policy_engine_mode: Option, - /// How the source determines if an existing user should be authenticated or a new user - /// enrolled. - #[serde(rename = "user_matching_mode", skip_serializing_if = "Option::is_none")] - pub user_matching_mode: Option, - #[serde(rename = "user_path_template", skip_serializing_if = "Option::is_none")] - pub user_path_template: Option, - #[serde(rename = "icon", skip_serializing_if = "Option::is_none")] - pub icon: Option, - #[serde(rename = "server_uri")] - pub server_uri: String, - /// Optionally verify the LDAP Server's Certificate against the CA Chain in this keypair. - #[serde( - rename = "peer_certificate", - default, - with = "::serde_with::rust::double_option", - skip_serializing_if = "Option::is_none" - )] - pub peer_certificate: Option>, - /// Client certificate to authenticate against the LDAP Server's Certificate. - #[serde( - rename = "client_certificate", - default, - with = "::serde_with::rust::double_option", - skip_serializing_if = "Option::is_none" - )] - pub client_certificate: Option>, - #[serde(rename = "bind_cn", skip_serializing_if = "Option::is_none")] - pub bind_cn: Option, - #[serde(rename = "bind_password", skip_serializing_if = "Option::is_none")] - pub bind_password: Option, - #[serde(rename = "start_tls", skip_serializing_if = "Option::is_none")] - pub start_tls: Option, - #[serde(rename = "sni", skip_serializing_if = "Option::is_none")] - pub sni: Option, - #[serde(rename = "base_dn")] - pub base_dn: String, - /// Prepended to Base DN for User-queries. - #[serde(rename = "additional_user_dn", skip_serializing_if = "Option::is_none")] - pub additional_user_dn: Option, - /// Prepended to Base DN for Group-queries. - #[serde( - rename = "additional_group_dn", - skip_serializing_if = "Option::is_none" - )] - pub additional_group_dn: Option, - /// Consider Objects matching this filter to be Users. - #[serde(rename = "user_object_filter", skip_serializing_if = "Option::is_none")] - pub user_object_filter: Option, - /// Consider Objects matching this filter to be Groups. - #[serde( - rename = "group_object_filter", - skip_serializing_if = "Option::is_none" - )] - pub group_object_filter: Option, - /// Field which contains members of a group. - #[serde( - rename = "group_membership_field", - skip_serializing_if = "Option::is_none" - )] - pub group_membership_field: Option, - /// Attribute which matches the value of `group_membership_field`. - #[serde( - rename = "user_membership_attribute", - skip_serializing_if = "Option::is_none" - )] - pub user_membership_attribute: Option, - /// Field which contains a unique Identifier. - #[serde( - rename = "object_uniqueness_field", - skip_serializing_if = "Option::is_none" - )] - pub object_uniqueness_field: Option, - /// Update internal authentik password when login succeeds with LDAP - #[serde( - rename = "password_login_update_internal_password", - skip_serializing_if = "Option::is_none" - )] - pub password_login_update_internal_password: Option, - #[serde(rename = "sync_users", skip_serializing_if = "Option::is_none")] - pub sync_users: Option, - /// When a user changes their password, sync it back to LDAP. This can only be enabled on a - /// single LDAP source. - #[serde( - rename = "sync_users_password", - skip_serializing_if = "Option::is_none" - )] - pub sync_users_password: Option, - #[serde(rename = "sync_groups", skip_serializing_if = "Option::is_none")] - pub sync_groups: Option, - #[serde( - rename = "sync_parent_group", - default, - with = "::serde_with::rust::double_option", - skip_serializing_if = "Option::is_none" - )] - pub sync_parent_group: Option>, - /// 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 - #[serde( - rename = "lookup_groups_from_user", - skip_serializing_if = "Option::is_none" - )] - pub lookup_groups_from_user: Option, - /// Delete authentik users and groups which were previously supplied by this source, but are - /// now missing from it. - #[serde( - rename = "delete_not_found_objects", - skip_serializing_if = "Option::is_none" - )] - pub delete_not_found_objects: Option, - /// When to trigger sync for outgoing providers - #[serde( - rename = "sync_outgoing_trigger_mode", - skip_serializing_if = "Option::is_none" - )] - pub sync_outgoing_trigger_mode: Option, -} - -impl LdapSourceRequest { - /// LDAP Source Serializer - pub fn new( - name: String, - slug: String, - server_uri: String, - base_dn: String, - ) -> LdapSourceRequest { - LdapSourceRequest { - name, - slug, - enabled: None, - promoted: None, - authentication_flow: None, - enrollment_flow: None, - user_property_mappings: None, - group_property_mappings: None, - policy_engine_mode: None, - user_matching_mode: None, - user_path_template: None, - icon: None, - server_uri, - peer_certificate: None, - client_certificate: None, - bind_cn: None, - bind_password: None, - start_tls: None, - sni: None, - base_dn, - additional_user_dn: None, - additional_group_dn: None, - user_object_filter: None, - group_object_filter: None, - group_membership_field: None, - user_membership_attribute: None, - object_uniqueness_field: None, - password_login_update_internal_password: None, - sync_users: None, - sync_users_password: None, - sync_groups: None, - sync_parent_group: None, - lookup_groups_from_user: None, - delete_not_found_objects: None, - sync_outgoing_trigger_mode: None, - } - } -} diff --git a/packages/client-rust/src/models/license.rs b/packages/client-rust/src/models/license.rs deleted file mode 100644 index 237b83c6bd..0000000000 --- a/packages/client-rust/src/models/license.rs +++ /dev/null @@ -1,49 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// License : License Serializer -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct License { - #[serde(rename = "license_uuid")] - pub license_uuid: uuid::Uuid, - #[serde(rename = "name")] - pub name: String, - #[serde(rename = "key")] - pub key: String, - #[serde(rename = "expiry")] - pub expiry: String, - #[serde(rename = "internal_users")] - pub internal_users: i32, - #[serde(rename = "external_users")] - pub external_users: i32, -} - -impl License { - /// License Serializer - pub fn new( - license_uuid: uuid::Uuid, - name: String, - key: String, - expiry: String, - internal_users: i32, - external_users: i32, - ) -> License { - License { - license_uuid, - name, - key, - expiry, - internal_users, - external_users, - } - } -} diff --git a/packages/client-rust/src/models/license_flags_enum.rs b/packages/client-rust/src/models/license_flags_enum.rs deleted file mode 100644 index 223f374531..0000000000 --- a/packages/client-rust/src/models/license_flags_enum.rs +++ /dev/null @@ -1,35 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// -#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] -pub enum LicenseFlagsEnum { - #[serde(rename = "trial")] - Trial, - #[serde(rename = "non_production")] - NonProduction, -} - -impl std::fmt::Display for LicenseFlagsEnum { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - match self { - Self::Trial => write!(f, "trial"), - Self::NonProduction => write!(f, "non_production"), - } - } -} - -impl Default for LicenseFlagsEnum { - fn default() -> LicenseFlagsEnum { - Self::Trial - } -} diff --git a/packages/client-rust/src/models/license_forecast.rs b/packages/client-rust/src/models/license_forecast.rs deleted file mode 100644 index 5ca4595042..0000000000 --- a/packages/client-rust/src/models/license_forecast.rs +++ /dev/null @@ -1,41 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// LicenseForecast : Serializer for license forecast -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct LicenseForecast { - #[serde(rename = "internal_users")] - pub internal_users: i32, - #[serde(rename = "external_users")] - pub external_users: i32, - #[serde(rename = "forecasted_internal_users")] - pub forecasted_internal_users: i32, - #[serde(rename = "forecasted_external_users")] - pub forecasted_external_users: i32, -} - -impl LicenseForecast { - /// Serializer for license forecast - pub fn new( - internal_users: i32, - external_users: i32, - forecasted_internal_users: i32, - forecasted_external_users: i32, - ) -> LicenseForecast { - LicenseForecast { - internal_users, - external_users, - forecasted_internal_users, - forecasted_external_users, - } - } -} diff --git a/packages/client-rust/src/models/license_request.rs b/packages/client-rust/src/models/license_request.rs deleted file mode 100644 index 6432b57d20..0000000000 --- a/packages/client-rust/src/models/license_request.rs +++ /dev/null @@ -1,25 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// LicenseRequest : License Serializer -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct LicenseRequest { - #[serde(rename = "key")] - pub key: String, -} - -impl LicenseRequest { - /// License Serializer - pub fn new(key: String) -> LicenseRequest { - LicenseRequest { key } - } -} diff --git a/packages/client-rust/src/models/license_status_enum.rs b/packages/client-rust/src/models/license_status_enum.rs deleted file mode 100644 index f447b0385a..0000000000 --- a/packages/client-rust/src/models/license_status_enum.rs +++ /dev/null @@ -1,50 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// -#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] -pub enum LicenseStatusEnum { - #[serde(rename = "unlicensed")] - Unlicensed, - #[serde(rename = "valid")] - Valid, - #[serde(rename = "expired")] - Expired, - #[serde(rename = "expiry_soon")] - ExpirySoon, - #[serde(rename = "limit_exceeded_admin")] - LimitExceededAdmin, - #[serde(rename = "limit_exceeded_user")] - LimitExceededUser, - #[serde(rename = "read_only")] - ReadOnly, -} - -impl std::fmt::Display for LicenseStatusEnum { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - match self { - Self::Unlicensed => write!(f, "unlicensed"), - Self::Valid => write!(f, "valid"), - Self::Expired => write!(f, "expired"), - Self::ExpirySoon => write!(f, "expiry_soon"), - Self::LimitExceededAdmin => write!(f, "limit_exceeded_admin"), - Self::LimitExceededUser => write!(f, "limit_exceeded_user"), - Self::ReadOnly => write!(f, "read_only"), - } - } -} - -impl Default for LicenseStatusEnum { - fn default() -> LicenseStatusEnum { - Self::Unlicensed - } -} diff --git a/packages/client-rust/src/models/license_summary.rs b/packages/client-rust/src/models/license_summary.rs deleted file mode 100644 index 94e0bc714b..0000000000 --- a/packages/client-rust/src/models/license_summary.rs +++ /dev/null @@ -1,45 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// LicenseSummary : Serializer for license status -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct LicenseSummary { - #[serde(rename = "internal_users")] - pub internal_users: i32, - #[serde(rename = "external_users")] - pub external_users: i32, - #[serde(rename = "status")] - pub status: models::LicenseSummaryStatusEnum, - #[serde(rename = "latest_valid")] - pub latest_valid: String, - #[serde(rename = "license_flags")] - pub license_flags: Vec, -} - -impl LicenseSummary { - /// Serializer for license status - pub fn new( - internal_users: i32, - external_users: i32, - status: models::LicenseSummaryStatusEnum, - latest_valid: String, - license_flags: Vec, - ) -> LicenseSummary { - LicenseSummary { - internal_users, - external_users, - status, - latest_valid, - license_flags, - } - } -} diff --git a/packages/client-rust/src/models/license_summary_status_enum.rs b/packages/client-rust/src/models/license_summary_status_enum.rs deleted file mode 100644 index ccf4eeefbf..0000000000 --- a/packages/client-rust/src/models/license_summary_status_enum.rs +++ /dev/null @@ -1,50 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// -#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] -pub enum LicenseSummaryStatusEnum { - #[serde(rename = "unlicensed")] - Unlicensed, - #[serde(rename = "valid")] - Valid, - #[serde(rename = "expired")] - Expired, - #[serde(rename = "expiry_soon")] - ExpirySoon, - #[serde(rename = "limit_exceeded_admin")] - LimitExceededAdmin, - #[serde(rename = "limit_exceeded_user")] - LimitExceededUser, - #[serde(rename = "read_only")] - ReadOnly, -} - -impl std::fmt::Display for LicenseSummaryStatusEnum { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - match self { - Self::Unlicensed => write!(f, "unlicensed"), - Self::Valid => write!(f, "valid"), - Self::Expired => write!(f, "expired"), - Self::ExpirySoon => write!(f, "expiry_soon"), - Self::LimitExceededAdmin => write!(f, "limit_exceeded_admin"), - Self::LimitExceededUser => write!(f, "limit_exceeded_user"), - Self::ReadOnly => write!(f, "read_only"), - } - } -} - -impl Default for LicenseSummaryStatusEnum { - fn default() -> LicenseSummaryStatusEnum { - Self::Unlicensed - } -} diff --git a/packages/client-rust/src/models/lifecycle_iteration.rs b/packages/client-rust/src/models/lifecycle_iteration.rs deleted file mode 100644 index 52b8a49550..0000000000 --- a/packages/client-rust/src/models/lifecycle_iteration.rs +++ /dev/null @@ -1,82 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// LifecycleIteration : Mixin to validate that a valid enterprise license exists before allowing to -/// save the object -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct LifecycleIteration { - #[serde(rename = "id")] - pub id: uuid::Uuid, - #[serde(rename = "content_type")] - pub content_type: models::ContentTypeEnum, - #[serde(rename = "object_id")] - pub object_id: String, - #[serde(rename = "object_verbose")] - pub object_verbose: String, - #[serde(rename = "object_admin_url")] - pub object_admin_url: String, - #[serde(rename = "state")] - pub state: models::LifecycleIterationStateEnum, - #[serde(rename = "opened_on")] - pub opened_on: String, - #[serde(rename = "grace_period_end")] - pub grace_period_end: String, - #[serde(rename = "next_review_date")] - pub next_review_date: String, - #[serde(rename = "reviews")] - pub reviews: Vec, - #[serde(rename = "user_can_review")] - pub user_can_review: bool, - #[serde(rename = "reviewer_groups")] - pub reviewer_groups: Vec, - #[serde(rename = "min_reviewers")] - pub min_reviewers: i32, - #[serde(rename = "reviewers")] - pub reviewers: Vec, -} - -impl LifecycleIteration { - /// Mixin to validate that a valid enterprise license exists before allowing to save the object - pub fn new( - id: uuid::Uuid, - content_type: models::ContentTypeEnum, - object_id: String, - object_verbose: String, - object_admin_url: String, - state: models::LifecycleIterationStateEnum, - opened_on: String, - grace_period_end: String, - next_review_date: String, - reviews: Vec, - user_can_review: bool, - reviewer_groups: Vec, - min_reviewers: i32, - reviewers: Vec, - ) -> LifecycleIteration { - LifecycleIteration { - 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, - } - } -} diff --git a/packages/client-rust/src/models/lifecycle_iteration_request.rs b/packages/client-rust/src/models/lifecycle_iteration_request.rs deleted file mode 100644 index 82534e754b..0000000000 --- a/packages/client-rust/src/models/lifecycle_iteration_request.rs +++ /dev/null @@ -1,26 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// LifecycleIterationRequest : Mixin to validate that a valid enterprise license exists before -/// allowing to save the object -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct LifecycleIterationRequest { - #[serde(rename = "content_type")] - pub content_type: models::ContentTypeEnum, -} - -impl LifecycleIterationRequest { - /// Mixin to validate that a valid enterprise license exists before allowing to save the object - pub fn new(content_type: models::ContentTypeEnum) -> LifecycleIterationRequest { - LifecycleIterationRequest { content_type } - } -} diff --git a/packages/client-rust/src/models/lifecycle_iteration_state_enum.rs b/packages/client-rust/src/models/lifecycle_iteration_state_enum.rs deleted file mode 100644 index c3148e3da7..0000000000 --- a/packages/client-rust/src/models/lifecycle_iteration_state_enum.rs +++ /dev/null @@ -1,41 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// -#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] -pub enum LifecycleIterationStateEnum { - #[serde(rename = "REVIEWED")] - Reviewed, - #[serde(rename = "PENDING")] - Pending, - #[serde(rename = "OVERDUE")] - Overdue, - #[serde(rename = "CANCELED")] - Canceled, -} - -impl std::fmt::Display for LifecycleIterationStateEnum { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - match self { - Self::Reviewed => write!(f, "REVIEWED"), - Self::Pending => write!(f, "PENDING"), - Self::Overdue => write!(f, "OVERDUE"), - Self::Canceled => write!(f, "CANCELED"), - } - } -} - -impl Default for LifecycleIterationStateEnum { - fn default() -> LifecycleIterationStateEnum { - Self::Reviewed - } -} diff --git a/packages/client-rust/src/models/lifecycle_rule.rs b/packages/client-rust/src/models/lifecycle_rule.rs deleted file mode 100644 index 0680006d78..0000000000 --- a/packages/client-rust/src/models/lifecycle_rule.rs +++ /dev/null @@ -1,88 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// LifecycleRule : Mixin to validate that a valid enterprise license exists before allowing to save -/// the object -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct LifecycleRule { - #[serde(rename = "id")] - pub id: uuid::Uuid, - #[serde(rename = "name")] - pub name: String, - #[serde(rename = "content_type")] - pub content_type: models::ContentTypeEnum, - #[serde( - rename = "object_id", - default, - with = "::serde_with::rust::double_option", - skip_serializing_if = "Option::is_none" - )] - pub object_id: Option>, - #[serde(rename = "interval", skip_serializing_if = "Option::is_none")] - pub interval: Option, - #[serde(rename = "grace_period", skip_serializing_if = "Option::is_none")] - pub grace_period: Option, - #[serde(rename = "reviewer_groups", skip_serializing_if = "Option::is_none")] - pub reviewer_groups: Option>, - #[serde(rename = "reviewer_groups_obj")] - pub reviewer_groups_obj: Vec, - #[serde(rename = "min_reviewers", skip_serializing_if = "Option::is_none")] - pub min_reviewers: Option, - #[serde( - rename = "min_reviewers_is_per_group", - skip_serializing_if = "Option::is_none" - )] - pub min_reviewers_is_per_group: Option, - #[serde(rename = "reviewers")] - pub reviewers: Vec, - #[serde(rename = "reviewers_obj")] - pub reviewers_obj: Vec, - /// Select which transports should be used to notify the reviewers. If none are selected, the - /// notification will only be shown in the authentik UI. - #[serde( - rename = "notification_transports", - skip_serializing_if = "Option::is_none" - )] - pub notification_transports: Option>, - #[serde(rename = "target_verbose")] - pub target_verbose: String, -} - -impl LifecycleRule { - /// Mixin to validate that a valid enterprise license exists before allowing to save the object - pub fn new( - id: uuid::Uuid, - name: String, - content_type: models::ContentTypeEnum, - reviewer_groups_obj: Vec, - reviewers: Vec, - reviewers_obj: Vec, - target_verbose: String, - ) -> LifecycleRule { - LifecycleRule { - id, - name, - content_type, - object_id: None, - interval: None, - grace_period: None, - reviewer_groups: None, - reviewer_groups_obj, - min_reviewers: None, - min_reviewers_is_per_group: None, - reviewers, - reviewers_obj, - notification_transports: None, - target_verbose, - } - } -} diff --git a/packages/client-rust/src/models/lifecycle_rule_request.rs b/packages/client-rust/src/models/lifecycle_rule_request.rs deleted file mode 100644 index b83768ccb3..0000000000 --- a/packages/client-rust/src/models/lifecycle_rule_request.rs +++ /dev/null @@ -1,72 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// LifecycleRuleRequest : Mixin to validate that a valid enterprise license exists before allowing -/// to save the object -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct LifecycleRuleRequest { - #[serde(rename = "name")] - pub name: String, - #[serde(rename = "content_type")] - pub content_type: models::ContentTypeEnum, - #[serde( - rename = "object_id", - default, - with = "::serde_with::rust::double_option", - skip_serializing_if = "Option::is_none" - )] - pub object_id: Option>, - #[serde(rename = "interval", skip_serializing_if = "Option::is_none")] - pub interval: Option, - #[serde(rename = "grace_period", skip_serializing_if = "Option::is_none")] - pub grace_period: Option, - #[serde(rename = "reviewer_groups", skip_serializing_if = "Option::is_none")] - pub reviewer_groups: Option>, - #[serde(rename = "min_reviewers", skip_serializing_if = "Option::is_none")] - pub min_reviewers: Option, - #[serde( - rename = "min_reviewers_is_per_group", - skip_serializing_if = "Option::is_none" - )] - pub min_reviewers_is_per_group: Option, - #[serde(rename = "reviewers")] - pub reviewers: Vec, - /// Select which transports should be used to notify the reviewers. If none are selected, the - /// notification will only be shown in the authentik UI. - #[serde( - rename = "notification_transports", - skip_serializing_if = "Option::is_none" - )] - pub notification_transports: Option>, -} - -impl LifecycleRuleRequest { - /// Mixin to validate that a valid enterprise license exists before allowing to save the object - pub fn new( - name: String, - content_type: models::ContentTypeEnum, - reviewers: Vec, - ) -> LifecycleRuleRequest { - LifecycleRuleRequest { - name, - content_type, - object_id: None, - interval: None, - grace_period: None, - reviewer_groups: None, - min_reviewers: None, - min_reviewers_is_per_group: None, - reviewers, - notification_transports: None, - } - } -} diff --git a/packages/client-rust/src/models/link.rs b/packages/client-rust/src/models/link.rs deleted file mode 100644 index 5de8799a7b..0000000000 --- a/packages/client-rust/src/models/link.rs +++ /dev/null @@ -1,25 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// Link : Returns a single link -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct Link { - #[serde(rename = "link")] - pub link: String, -} - -impl Link { - /// Returns a single link - pub fn new(link: String) -> Link { - Link { link } - } -} diff --git a/packages/client-rust/src/models/matching_mode_enum.rs b/packages/client-rust/src/models/matching_mode_enum.rs deleted file mode 100644 index f129062605..0000000000 --- a/packages/client-rust/src/models/matching_mode_enum.rs +++ /dev/null @@ -1,35 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// -#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] -pub enum MatchingModeEnum { - #[serde(rename = "strict")] - Strict, - #[serde(rename = "regex")] - Regex, -} - -impl std::fmt::Display for MatchingModeEnum { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - match self { - Self::Strict => write!(f, "strict"), - Self::Regex => write!(f, "regex"), - } - } -} - -impl Default for MatchingModeEnum { - fn default() -> MatchingModeEnum { - Self::Strict - } -} diff --git a/packages/client-rust/src/models/mdm_config_request.rs b/packages/client-rust/src/models/mdm_config_request.rs deleted file mode 100644 index 842a5e2972..0000000000 --- a/packages/client-rust/src/models/mdm_config_request.rs +++ /dev/null @@ -1,33 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// MdmConfigRequest : Base serializer class which doesn't implement create/update methods -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct MdmConfigRequest { - #[serde(rename = "platform")] - pub platform: models::DeviceFactsOsFamily, - #[serde(rename = "enrollment_token")] - pub enrollment_token: uuid::Uuid, -} - -impl MdmConfigRequest { - /// Base serializer class which doesn't implement create/update methods - pub fn new( - platform: models::DeviceFactsOsFamily, - enrollment_token: uuid::Uuid, - ) -> MdmConfigRequest { - MdmConfigRequest { - platform, - enrollment_token, - } - } -} diff --git a/packages/client-rust/src/models/mdm_config_response.rs b/packages/client-rust/src/models/mdm_config_response.rs deleted file mode 100644 index 3d982b9cca..0000000000 --- a/packages/client-rust/src/models/mdm_config_response.rs +++ /dev/null @@ -1,33 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// MdmConfigResponse : Base serializer class which doesn't implement create/update methods -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct MdmConfigResponse { - #[serde(rename = "config")] - pub config: String, - #[serde(rename = "mime_type")] - pub mime_type: String, - #[serde(rename = "filename")] - pub filename: String, -} - -impl MdmConfigResponse { - /// Base serializer class which doesn't implement create/update methods - pub fn new(config: String, mime_type: String, filename: String) -> MdmConfigResponse { - MdmConfigResponse { - config, - mime_type, - filename, - } - } -} diff --git a/packages/client-rust/src/models/metadata.rs b/packages/client-rust/src/models/metadata.rs deleted file mode 100644 index 019545a240..0000000000 --- a/packages/client-rust/src/models/metadata.rs +++ /dev/null @@ -1,30 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// Metadata : Serializer for blueprint metadata -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct Metadata { - #[serde(rename = "name")] - pub name: String, - #[serde(rename = "labels")] - pub labels: std::collections::HashMap, -} - -impl Metadata { - /// Serializer for blueprint metadata - pub fn new( - name: String, - labels: std::collections::HashMap, - ) -> Metadata { - Metadata { name, labels } - } -} diff --git a/packages/client-rust/src/models/microsoft_entra_provider.rs b/packages/client-rust/src/models/microsoft_entra_provider.rs deleted file mode 100644 index 84c8f0ff87..0000000000 --- a/packages/client-rust/src/models/microsoft_entra_provider.rs +++ /dev/null @@ -1,126 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// MicrosoftEntraProvider : MicrosoftEntraProvider Serializer -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct MicrosoftEntraProvider { - #[serde(rename = "pk")] - pub pk: i32, - #[serde(rename = "name")] - pub name: String, - #[serde(rename = "property_mappings", skip_serializing_if = "Option::is_none")] - pub property_mappings: Option>, - /// Property mappings used for group creation/updating. - #[serde( - rename = "property_mappings_group", - skip_serializing_if = "Option::is_none" - )] - pub property_mappings_group: Option>, - /// Get object component so that we know how to edit the object - #[serde(rename = "component")] - pub component: String, - /// Internal application name, used in URLs. - #[serde( - rename = "assigned_backchannel_application_slug", - deserialize_with = "Option::deserialize" - )] - pub assigned_backchannel_application_slug: Option, - /// Application's display Name. - #[serde( - rename = "assigned_backchannel_application_name", - deserialize_with = "Option::deserialize" - )] - pub assigned_backchannel_application_name: Option, - /// Return object's verbose_name - #[serde(rename = "verbose_name")] - pub verbose_name: String, - /// Return object's plural verbose_name - #[serde(rename = "verbose_name_plural")] - pub verbose_name_plural: String, - /// Return internal model name - #[serde(rename = "meta_model_name")] - pub meta_model_name: String, - #[serde(rename = "client_id")] - pub client_id: String, - #[serde(rename = "client_secret")] - pub client_secret: String, - #[serde(rename = "tenant_id")] - pub tenant_id: String, - #[serde( - rename = "exclude_users_service_account", - skip_serializing_if = "Option::is_none" - )] - pub exclude_users_service_account: Option, - #[serde( - rename = "filter_group", - default, - with = "::serde_with::rust::double_option", - skip_serializing_if = "Option::is_none" - )] - pub filter_group: Option>, - #[serde(rename = "user_delete_action", skip_serializing_if = "Option::is_none")] - pub user_delete_action: Option, - #[serde( - rename = "group_delete_action", - skip_serializing_if = "Option::is_none" - )] - pub group_delete_action: Option, - /// Controls the number of objects synced in a single task - #[serde(rename = "sync_page_size", skip_serializing_if = "Option::is_none")] - pub sync_page_size: Option, - /// Timeout for synchronization of a single page - #[serde(rename = "sync_page_timeout", skip_serializing_if = "Option::is_none")] - pub sync_page_timeout: Option, - /// When enabled, provider will not modify or create objects in the remote system. - #[serde(rename = "dry_run", skip_serializing_if = "Option::is_none")] - pub dry_run: Option, -} - -impl MicrosoftEntraProvider { - /// MicrosoftEntraProvider Serializer - pub fn new( - pk: i32, - name: String, - component: String, - assigned_backchannel_application_slug: Option, - assigned_backchannel_application_name: Option, - verbose_name: String, - verbose_name_plural: String, - meta_model_name: String, - client_id: String, - client_secret: String, - tenant_id: String, - ) -> MicrosoftEntraProvider { - MicrosoftEntraProvider { - pk, - name, - property_mappings: None, - property_mappings_group: None, - component, - assigned_backchannel_application_slug, - assigned_backchannel_application_name, - verbose_name, - verbose_name_plural, - meta_model_name, - client_id, - client_secret, - tenant_id, - exclude_users_service_account: None, - filter_group: None, - user_delete_action: None, - group_delete_action: None, - sync_page_size: None, - sync_page_timeout: None, - dry_run: None, - } - } -} diff --git a/packages/client-rust/src/models/microsoft_entra_provider_group.rs b/packages/client-rust/src/models/microsoft_entra_provider_group.rs deleted file mode 100644 index d2c165c422..0000000000 --- a/packages/client-rust/src/models/microsoft_entra_provider_group.rs +++ /dev/null @@ -1,49 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// MicrosoftEntraProviderGroup : MicrosoftEntraProviderGroup Serializer -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct MicrosoftEntraProviderGroup { - #[serde(rename = "id")] - pub id: uuid::Uuid, - #[serde(rename = "microsoft_id")] - pub microsoft_id: String, - #[serde(rename = "group")] - pub group: uuid::Uuid, - #[serde(rename = "group_obj")] - pub group_obj: models::PartialGroup, - #[serde(rename = "provider")] - pub provider: i32, - #[serde(rename = "attributes")] - pub attributes: std::collections::HashMap, -} - -impl MicrosoftEntraProviderGroup { - /// MicrosoftEntraProviderGroup Serializer - pub fn new( - id: uuid::Uuid, - microsoft_id: String, - group: uuid::Uuid, - group_obj: models::PartialGroup, - provider: i32, - attributes: std::collections::HashMap, - ) -> MicrosoftEntraProviderGroup { - MicrosoftEntraProviderGroup { - id, - microsoft_id, - group, - group_obj, - provider, - attributes, - } - } -} diff --git a/packages/client-rust/src/models/microsoft_entra_provider_group_request.rs b/packages/client-rust/src/models/microsoft_entra_provider_group_request.rs deleted file mode 100644 index e84b62292a..0000000000 --- a/packages/client-rust/src/models/microsoft_entra_provider_group_request.rs +++ /dev/null @@ -1,37 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// MicrosoftEntraProviderGroupRequest : MicrosoftEntraProviderGroup Serializer -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct MicrosoftEntraProviderGroupRequest { - #[serde(rename = "microsoft_id")] - pub microsoft_id: String, - #[serde(rename = "group")] - pub group: uuid::Uuid, - #[serde(rename = "provider")] - pub provider: i32, -} - -impl MicrosoftEntraProviderGroupRequest { - /// MicrosoftEntraProviderGroup Serializer - pub fn new( - microsoft_id: String, - group: uuid::Uuid, - provider: i32, - ) -> MicrosoftEntraProviderGroupRequest { - MicrosoftEntraProviderGroupRequest { - microsoft_id, - group, - provider, - } - } -} diff --git a/packages/client-rust/src/models/microsoft_entra_provider_mapping.rs b/packages/client-rust/src/models/microsoft_entra_provider_mapping.rs deleted file mode 100644 index 6bd7b61ac7..0000000000 --- a/packages/client-rust/src/models/microsoft_entra_provider_mapping.rs +++ /dev/null @@ -1,68 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// MicrosoftEntraProviderMapping : MicrosoftEntraProviderMapping Serializer -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct MicrosoftEntraProviderMapping { - #[serde(rename = "pk")] - pub pk: uuid::Uuid, - /// 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. - #[serde( - rename = "managed", - default, - with = "::serde_with::rust::double_option", - skip_serializing_if = "Option::is_none" - )] - pub managed: Option>, - #[serde(rename = "name")] - pub name: String, - #[serde(rename = "expression")] - pub expression: String, - /// Get object's component so that we know how to edit the object - #[serde(rename = "component")] - pub component: String, - /// Return object's verbose_name - #[serde(rename = "verbose_name")] - pub verbose_name: String, - /// Return object's plural verbose_name - #[serde(rename = "verbose_name_plural")] - pub verbose_name_plural: String, - /// Return internal model name - #[serde(rename = "meta_model_name")] - pub meta_model_name: String, -} - -impl MicrosoftEntraProviderMapping { - /// MicrosoftEntraProviderMapping Serializer - pub fn new( - pk: uuid::Uuid, - name: String, - expression: String, - component: String, - verbose_name: String, - verbose_name_plural: String, - meta_model_name: String, - ) -> MicrosoftEntraProviderMapping { - MicrosoftEntraProviderMapping { - pk, - managed: None, - name, - expression, - component, - verbose_name, - verbose_name_plural, - meta_model_name, - } - } -} diff --git a/packages/client-rust/src/models/microsoft_entra_provider_mapping_request.rs b/packages/client-rust/src/models/microsoft_entra_provider_mapping_request.rs deleted file mode 100644 index ab95ade8fb..0000000000 --- a/packages/client-rust/src/models/microsoft_entra_provider_mapping_request.rs +++ /dev/null @@ -1,41 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// MicrosoftEntraProviderMappingRequest : MicrosoftEntraProviderMapping Serializer -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct MicrosoftEntraProviderMappingRequest { - /// 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. - #[serde( - rename = "managed", - default, - with = "::serde_with::rust::double_option", - skip_serializing_if = "Option::is_none" - )] - pub managed: Option>, - #[serde(rename = "name")] - pub name: String, - #[serde(rename = "expression")] - pub expression: String, -} - -impl MicrosoftEntraProviderMappingRequest { - /// MicrosoftEntraProviderMapping Serializer - pub fn new(name: String, expression: String) -> MicrosoftEntraProviderMappingRequest { - MicrosoftEntraProviderMappingRequest { - managed: None, - name, - expression, - } - } -} diff --git a/packages/client-rust/src/models/microsoft_entra_provider_request.rs b/packages/client-rust/src/models/microsoft_entra_provider_request.rs deleted file mode 100644 index 6c3b8007bc..0000000000 --- a/packages/client-rust/src/models/microsoft_entra_provider_request.rs +++ /dev/null @@ -1,86 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// MicrosoftEntraProviderRequest : MicrosoftEntraProvider Serializer -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct MicrosoftEntraProviderRequest { - #[serde(rename = "name")] - pub name: String, - #[serde(rename = "property_mappings", skip_serializing_if = "Option::is_none")] - pub property_mappings: Option>, - /// Property mappings used for group creation/updating. - #[serde( - rename = "property_mappings_group", - skip_serializing_if = "Option::is_none" - )] - pub property_mappings_group: Option>, - #[serde(rename = "client_id")] - pub client_id: String, - #[serde(rename = "client_secret")] - pub client_secret: String, - #[serde(rename = "tenant_id")] - pub tenant_id: String, - #[serde( - rename = "exclude_users_service_account", - skip_serializing_if = "Option::is_none" - )] - pub exclude_users_service_account: Option, - #[serde( - rename = "filter_group", - default, - with = "::serde_with::rust::double_option", - skip_serializing_if = "Option::is_none" - )] - pub filter_group: Option>, - #[serde(rename = "user_delete_action", skip_serializing_if = "Option::is_none")] - pub user_delete_action: Option, - #[serde( - rename = "group_delete_action", - skip_serializing_if = "Option::is_none" - )] - pub group_delete_action: Option, - /// Controls the number of objects synced in a single task - #[serde(rename = "sync_page_size", skip_serializing_if = "Option::is_none")] - pub sync_page_size: Option, - /// Timeout for synchronization of a single page - #[serde(rename = "sync_page_timeout", skip_serializing_if = "Option::is_none")] - pub sync_page_timeout: Option, - /// When enabled, provider will not modify or create objects in the remote system. - #[serde(rename = "dry_run", skip_serializing_if = "Option::is_none")] - pub dry_run: Option, -} - -impl MicrosoftEntraProviderRequest { - /// MicrosoftEntraProvider Serializer - pub fn new( - name: String, - client_id: String, - client_secret: String, - tenant_id: String, - ) -> MicrosoftEntraProviderRequest { - MicrosoftEntraProviderRequest { - name, - property_mappings: None, - property_mappings_group: None, - client_id, - client_secret, - tenant_id, - exclude_users_service_account: None, - filter_group: None, - user_delete_action: None, - group_delete_action: None, - sync_page_size: None, - sync_page_timeout: None, - dry_run: None, - } - } -} diff --git a/packages/client-rust/src/models/microsoft_entra_provider_user.rs b/packages/client-rust/src/models/microsoft_entra_provider_user.rs deleted file mode 100644 index 64fc42f5e8..0000000000 --- a/packages/client-rust/src/models/microsoft_entra_provider_user.rs +++ /dev/null @@ -1,49 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// MicrosoftEntraProviderUser : MicrosoftEntraProviderUser Serializer -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct MicrosoftEntraProviderUser { - #[serde(rename = "id")] - pub id: uuid::Uuid, - #[serde(rename = "microsoft_id")] - pub microsoft_id: String, - #[serde(rename = "user")] - pub user: i32, - #[serde(rename = "user_obj")] - pub user_obj: models::PartialUser, - #[serde(rename = "provider")] - pub provider: i32, - #[serde(rename = "attributes")] - pub attributes: std::collections::HashMap, -} - -impl MicrosoftEntraProviderUser { - /// MicrosoftEntraProviderUser Serializer - pub fn new( - id: uuid::Uuid, - microsoft_id: String, - user: i32, - user_obj: models::PartialUser, - provider: i32, - attributes: std::collections::HashMap, - ) -> MicrosoftEntraProviderUser { - MicrosoftEntraProviderUser { - id, - microsoft_id, - user, - user_obj, - provider, - attributes, - } - } -} diff --git a/packages/client-rust/src/models/microsoft_entra_provider_user_request.rs b/packages/client-rust/src/models/microsoft_entra_provider_user_request.rs deleted file mode 100644 index 2d7583643a..0000000000 --- a/packages/client-rust/src/models/microsoft_entra_provider_user_request.rs +++ /dev/null @@ -1,37 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// MicrosoftEntraProviderUserRequest : MicrosoftEntraProviderUser Serializer -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct MicrosoftEntraProviderUserRequest { - #[serde(rename = "microsoft_id")] - pub microsoft_id: String, - #[serde(rename = "user")] - pub user: i32, - #[serde(rename = "provider")] - pub provider: i32, -} - -impl MicrosoftEntraProviderUserRequest { - /// MicrosoftEntraProviderUser Serializer - pub fn new( - microsoft_id: String, - user: i32, - provider: i32, - ) -> MicrosoftEntraProviderUserRequest { - MicrosoftEntraProviderUserRequest { - microsoft_id, - user, - provider, - } - } -} diff --git a/packages/client-rust/src/models/mod.rs b/packages/client-rust/src/models/mod.rs index f916734817..04c024b7d4 100644 --- a/packages/client-rust/src/models/mod.rs +++ b/packages/client-rust/src/models/mod.rs @@ -1,111 +1,29 @@ pub mod access_denied_challenge; pub use self::access_denied_challenge::AccessDeniedChallenge; -pub mod agent_authentication_response; -pub use self::agent_authentication_response::AgentAuthenticationResponse; -pub mod agent_config; -pub use self::agent_config::AgentConfig; -pub mod agent_connector; -pub use self::agent_connector::AgentConnector; -pub mod agent_connector_request; -pub use self::agent_connector_request::AgentConnectorRequest; -pub mod agent_psso_device_registration_request; -pub use self::agent_psso_device_registration_request::AgentPssoDeviceRegistrationRequest; -pub mod agent_psso_device_registration_response; -pub use self::agent_psso_device_registration_response::AgentPssoDeviceRegistrationResponse; -pub mod agent_psso_user_registration_request; -pub use self::agent_psso_user_registration_request::AgentPssoUserRegistrationRequest; -pub mod agent_token_response; -pub use self::agent_token_response::AgentTokenResponse; -pub mod alg_enum; -pub use self::alg_enum::AlgEnum; -pub mod app; -pub use self::app::App; -pub mod app_enum; -pub use self::app_enum::AppEnum; pub mod apple_challenge_response_request; pub use self::apple_challenge_response_request::AppleChallengeResponseRequest; pub mod apple_login_challenge; pub use self::apple_login_challenge::AppleLoginChallenge; -pub mod application; -pub use self::application::Application; -pub mod application_entitlement; -pub use self::application_entitlement::ApplicationEntitlement; -pub mod application_entitlement_request; -pub use self::application_entitlement_request::ApplicationEntitlementRequest; -pub mod application_request; -pub use self::application_request::ApplicationRequest; -pub mod auth_type_enum; -pub use self::auth_type_enum::AuthTypeEnum; -pub mod authenticated_session; -pub use self::authenticated_session::AuthenticatedSession; -pub mod authenticated_session_asn; -pub use self::authenticated_session_asn::AuthenticatedSessionAsn; -pub mod authenticated_session_geo_ip; -pub use self::authenticated_session_geo_ip::AuthenticatedSessionGeoIp; -pub mod authenticated_session_user_agent; -pub use self::authenticated_session_user_agent::AuthenticatedSessionUserAgent; -pub mod authenticated_session_user_agent_device; -pub use self::authenticated_session_user_agent_device::AuthenticatedSessionUserAgentDevice; -pub mod authenticated_session_user_agent_os; -pub use self::authenticated_session_user_agent_os::AuthenticatedSessionUserAgentOs; -pub mod authenticated_session_user_agent_user_agent; -pub use self::authenticated_session_user_agent_user_agent::AuthenticatedSessionUserAgentUserAgent; -pub mod authentication_enum; -pub use self::authentication_enum::AuthenticationEnum; -pub mod authenticator_attachment_enum; -pub use self::authenticator_attachment_enum::AuthenticatorAttachmentEnum; pub mod authenticator_duo_challenge; pub use self::authenticator_duo_challenge::AuthenticatorDuoChallenge; pub mod authenticator_duo_challenge_response_request; pub use self::authenticator_duo_challenge_response_request::AuthenticatorDuoChallengeResponseRequest; -pub mod authenticator_duo_stage; -pub use self::authenticator_duo_stage::AuthenticatorDuoStage; -pub mod authenticator_duo_stage_device_import_response; -pub use self::authenticator_duo_stage_device_import_response::AuthenticatorDuoStageDeviceImportResponse; -pub mod authenticator_duo_stage_manual_device_import_request; -pub use self::authenticator_duo_stage_manual_device_import_request::AuthenticatorDuoStageManualDeviceImportRequest; -pub mod authenticator_duo_stage_request; -pub use self::authenticator_duo_stage_request::AuthenticatorDuoStageRequest; pub mod authenticator_email_challenge; pub use self::authenticator_email_challenge::AuthenticatorEmailChallenge; pub mod authenticator_email_challenge_response_request; pub use self::authenticator_email_challenge_response_request::AuthenticatorEmailChallengeResponseRequest; -pub mod authenticator_email_stage; -pub use self::authenticator_email_stage::AuthenticatorEmailStage; -pub mod authenticator_email_stage_request; -pub use self::authenticator_email_stage_request::AuthenticatorEmailStageRequest; -pub mod authenticator_endpoint_gdtc_stage; -pub use self::authenticator_endpoint_gdtc_stage::AuthenticatorEndpointGdtcStage; -pub mod authenticator_endpoint_gdtc_stage_request; -pub use self::authenticator_endpoint_gdtc_stage_request::AuthenticatorEndpointGdtcStageRequest; pub mod authenticator_sms_challenge; pub use self::authenticator_sms_challenge::AuthenticatorSmsChallenge; pub mod authenticator_sms_challenge_response_request; pub use self::authenticator_sms_challenge_response_request::AuthenticatorSmsChallengeResponseRequest; -pub mod authenticator_sms_stage; -pub use self::authenticator_sms_stage::AuthenticatorSmsStage; -pub mod authenticator_sms_stage_request; -pub use self::authenticator_sms_stage_request::AuthenticatorSmsStageRequest; pub mod authenticator_static_challenge; pub use self::authenticator_static_challenge::AuthenticatorStaticChallenge; pub mod authenticator_static_challenge_response_request; pub use self::authenticator_static_challenge_response_request::AuthenticatorStaticChallengeResponseRequest; -pub mod authenticator_static_stage; -pub use self::authenticator_static_stage::AuthenticatorStaticStage; -pub mod authenticator_static_stage_request; -pub use self::authenticator_static_stage_request::AuthenticatorStaticStageRequest; pub mod authenticator_totp_challenge; pub use self::authenticator_totp_challenge::AuthenticatorTotpChallenge; pub mod authenticator_totp_challenge_response_request; pub use self::authenticator_totp_challenge_response_request::AuthenticatorTotpChallengeResponseRequest; -pub mod authenticator_totp_stage; -pub use self::authenticator_totp_stage::AuthenticatorTotpStage; -pub mod authenticator_totp_stage_request; -pub use self::authenticator_totp_stage_request::AuthenticatorTotpStageRequest; -pub mod authenticator_validate_stage; -pub use self::authenticator_validate_stage::AuthenticatorValidateStage; -pub mod authenticator_validate_stage_request; -pub use self::authenticator_validate_stage_request::AuthenticatorValidateStageRequest; pub mod authenticator_validation_challenge; pub use self::authenticator_validation_challenge::AuthenticatorValidationChallenge; pub mod authenticator_validation_challenge_response_request; @@ -114,222 +32,56 @@ pub mod authenticator_web_authn_challenge; pub use self::authenticator_web_authn_challenge::AuthenticatorWebAuthnChallenge; pub mod authenticator_web_authn_challenge_response_request; pub use self::authenticator_web_authn_challenge_response_request::AuthenticatorWebAuthnChallengeResponseRequest; -pub mod authenticator_web_authn_stage; -pub use self::authenticator_web_authn_stage::AuthenticatorWebAuthnStage; -pub mod authenticator_web_authn_stage_request; -pub use self::authenticator_web_authn_stage_request::AuthenticatorWebAuthnStageRequest; -pub mod authorization_code_auth_method_enum; -pub use self::authorization_code_auth_method_enum::AuthorizationCodeAuthMethodEnum; pub mod auto_submit_challenge_response_request; pub use self::auto_submit_challenge_response_request::AutoSubmitChallengeResponseRequest; pub mod autosubmit_challenge; pub use self::autosubmit_challenge::AutosubmitChallenge; -pub mod backends_enum; -pub use self::backends_enum::BackendsEnum; -pub mod binding_type_enum; -pub use self::binding_type_enum::BindingTypeEnum; -pub mod blueprint_file; -pub use self::blueprint_file::BlueprintFile; -pub mod blueprint_import_result; -pub use self::blueprint_import_result::BlueprintImportResult; -pub mod blueprint_instance; -pub use self::blueprint_instance::BlueprintInstance; -pub mod blueprint_instance_request; -pub use self::blueprint_instance_request::BlueprintInstanceRequest; -pub mod blueprint_instance_status_enum; -pub use self::blueprint_instance_status_enum::BlueprintInstanceStatusEnum; pub mod brand; pub use self::brand::Brand; -pub mod brand_request; -pub use self::brand_request::BrandRequest; -pub mod bulk_delete_session_response; -pub use self::bulk_delete_session_response::BulkDeleteSessionResponse; -pub mod cache; -pub use self::cache::Cache; pub mod capabilities_enum; pub use self::capabilities_enum::CapabilitiesEnum; pub mod captcha_challenge; pub use self::captcha_challenge::CaptchaChallenge; pub mod captcha_challenge_response_request; pub use self::captcha_challenge_response_request::CaptchaChallengeResponseRequest; -pub mod captcha_stage; -pub use self::captcha_stage::CaptchaStage; -pub mod captcha_stage_request; -pub use self::captcha_stage_request::CaptchaStageRequest; -pub mod cert_attribute_enum; -pub use self::cert_attribute_enum::CertAttributeEnum; pub mod certificate_data; pub use self::certificate_data::CertificateData; -pub mod certificate_generation_request; -pub use self::certificate_generation_request::CertificateGenerationRequest; pub mod certificate_key_pair; pub use self::certificate_key_pair::CertificateKeyPair; pub mod certificate_key_pair_key_type_enum; pub use self::certificate_key_pair_key_type_enum::CertificateKeyPairKeyTypeEnum; -pub mod certificate_key_pair_request; -pub use self::certificate_key_pair_request::CertificateKeyPairRequest; pub mod challenge_types; pub use self::challenge_types::ChallengeTypes; -pub mod client_type_enum; -pub use self::client_type_enum::ClientTypeEnum; -pub mod compatibility_mode_enum; -pub use self::compatibility_mode_enum::CompatibilityModeEnum; pub mod config; pub use self::config::Config; -pub mod connection_token; -pub use self::connection_token::ConnectionToken; -pub mod connection_token_request; -pub use self::connection_token_request::ConnectionTokenRequest; -pub mod connector; -pub use self::connector::Connector; pub mod consent_challenge; pub use self::consent_challenge::ConsentChallenge; pub mod consent_challenge_response_request; pub use self::consent_challenge_response_request::ConsentChallengeResponseRequest; -pub mod consent_mode_enum; -pub use self::consent_mode_enum::ConsentModeEnum; pub mod consent_permission; pub use self::consent_permission::ConsentPermission; -pub mod consent_stage; -pub use self::consent_stage::ConsentStage; -pub mod consent_stage_request; -pub use self::consent_stage_request::ConsentStageRequest; -pub mod content_type; -pub use self::content_type::ContentType; -pub mod content_type_enum; -pub use self::content_type_enum::ContentTypeEnum; pub mod contextual_flow_info; pub use self::contextual_flow_info::ContextualFlowInfo; pub mod contextual_flow_info_layout_enum; pub use self::contextual_flow_info_layout_enum::ContextualFlowInfoLayoutEnum; -pub mod country_code_enum; -pub use self::country_code_enum::CountryCodeEnum; -pub mod current_brand; -pub use self::current_brand::CurrentBrand; -pub mod current_brand_flags; -pub use self::current_brand_flags::CurrentBrandFlags; -pub mod data_export; -pub use self::data_export::DataExport; -pub mod delivery_method_enum; -pub use self::delivery_method_enum::DeliveryMethodEnum; -pub mod denied_action_enum; -pub use self::denied_action_enum::DeniedActionEnum; -pub mod deny_stage; -pub use self::deny_stage::DenyStage; -pub mod deny_stage_request; -pub use self::deny_stage_request::DenyStageRequest; -pub mod detailed_country; -pub use self::detailed_country::DetailedCountry; -pub mod device; -pub use self::device::Device; -pub mod device_access_group; -pub use self::device_access_group::DeviceAccessGroup; -pub mod device_access_group_request; -pub use self::device_access_group_request::DeviceAccessGroupRequest; pub mod device_challenge; pub use self::device_challenge::DeviceChallenge; pub mod device_challenge_request; pub use self::device_challenge_request::DeviceChallengeRequest; pub mod device_classes_enum; pub use self::device_classes_enum::DeviceClassesEnum; -pub mod device_connection; -pub use self::device_connection::DeviceConnection; -pub mod device_fact_snapshot; -pub use self::device_fact_snapshot::DeviceFactSnapshot; -pub mod device_facts; -pub use self::device_facts::DeviceFacts; -pub mod device_facts_os_family; -pub use self::device_facts_os_family::DeviceFactsOsFamily; -pub mod device_facts_request; -pub use self::device_facts_request::DeviceFactsRequest; -pub mod device_group; -pub use self::device_group::DeviceGroup; -pub mod device_group_request; -pub use self::device_group_request::DeviceGroupRequest; -pub mod device_summary; -pub use self::device_summary::DeviceSummary; -pub mod device_user; -pub use self::device_user::DeviceUser; -pub mod device_user_binding; -pub use self::device_user_binding::DeviceUserBinding; -pub mod device_user_binding_request; -pub use self::device_user_binding_request::DeviceUserBindingRequest; -pub mod device_user_request; -pub use self::device_user_request::DeviceUserRequest; -pub mod digest_algorithm_enum; -pub use self::digest_algorithm_enum::DigestAlgorithmEnum; -pub mod digits_enum; -pub use self::digits_enum::DigitsEnum; -pub mod disk; -pub use self::disk::Disk; -pub mod disk_request; -pub use self::disk_request::DiskRequest; -pub mod docker_service_connection; -pub use self::docker_service_connection::DockerServiceConnection; -pub mod docker_service_connection_request; -pub use self::docker_service_connection_request::DockerServiceConnectionRequest; -pub mod domain; -pub use self::domain::Domain; -pub mod domain_request; -pub use self::domain_request::DomainRequest; pub mod dummy_challenge; pub use self::dummy_challenge::DummyChallenge; pub mod dummy_challenge_response_request; pub use self::dummy_challenge_response_request::DummyChallengeResponseRequest; -pub mod dummy_policy; -pub use self::dummy_policy::DummyPolicy; -pub mod dummy_policy_request; -pub use self::dummy_policy_request::DummyPolicyRequest; -pub mod dummy_stage; -pub use self::dummy_stage::DummyStage; -pub mod dummy_stage_request; -pub use self::dummy_stage_request::DummyStageRequest; -pub mod duo_device; -pub use self::duo_device::DuoDevice; -pub mod duo_device_enrollment_status; -pub use self::duo_device_enrollment_status::DuoDeviceEnrollmentStatus; -pub mod duo_device_request; -pub use self::duo_device_request::DuoDeviceRequest; -pub mod duo_response_enum; -pub use self::duo_response_enum::DuoResponseEnum; pub mod email_challenge; pub use self::email_challenge::EmailChallenge; pub mod email_challenge_response_request; pub use self::email_challenge_response_request::EmailChallengeResponseRequest; -pub mod email_device; -pub use self::email_device::EmailDevice; -pub mod email_device_request; -pub use self::email_device_request::EmailDeviceRequest; -pub mod email_stage; -pub use self::email_stage::EmailStage; -pub mod email_stage_request; -pub use self::email_stage_request::EmailStageRequest; -pub mod endpoint; -pub use self::endpoint::Endpoint; pub mod endpoint_agent_challenge; pub use self::endpoint_agent_challenge::EndpointAgentChallenge; pub mod endpoint_agent_challenge_response_request; pub use self::endpoint_agent_challenge_response_request::EndpointAgentChallengeResponseRequest; -pub mod endpoint_auth_mode_enum; -pub use self::endpoint_auth_mode_enum::EndpointAuthModeEnum; -pub mod endpoint_device; -pub use self::endpoint_device::EndpointDevice; -pub mod endpoint_device_details; -pub use self::endpoint_device_details::EndpointDeviceDetails; -pub mod endpoint_device_request; -pub use self::endpoint_device_request::EndpointDeviceRequest; -pub mod endpoint_request; -pub use self::endpoint_request::EndpointRequest; -pub mod endpoint_stage; -pub use self::endpoint_stage::EndpointStage; -pub mod endpoint_stage_request; -pub use self::endpoint_stage_request::EndpointStageRequest; -pub mod enroll_request; -pub use self::enroll_request::EnrollRequest; -pub mod enrollment_token; -pub use self::enrollment_token::EnrollmentToken; -pub mod enrollment_token_request; -pub use self::enrollment_token_request::EnrollmentTokenRequest; pub mod error_detail; pub use self::error_detail::ErrorDetail; pub mod error_reporting_config; @@ -338,244 +90,36 @@ pub mod event; pub use self::event::Event; pub mod event_actions; pub use self::event_actions::EventActions; -pub mod event_matcher_policy; -pub use self::event_matcher_policy::EventMatcherPolicy; -pub mod event_matcher_policy_request; -pub use self::event_matcher_policy_request::EventMatcherPolicyRequest; pub mod event_request; pub use self::event_request::EventRequest; -pub mod event_stats; -pub use self::event_stats::EventStats; -pub mod event_top_per_user; -pub use self::event_top_per_user::EventTopPerUser; -pub mod event_volume; -pub use self::event_volume::EventVolume; -pub mod events_requested_enum; -pub use self::events_requested_enum::EventsRequestedEnum; -pub mod expiring_base_grant_model; -pub use self::expiring_base_grant_model::ExpiringBaseGrantModel; -pub mod expression_policy; -pub use self::expression_policy::ExpressionPolicy; -pub mod expression_policy_request; -pub use self::expression_policy_request::ExpressionPolicyRequest; -pub mod extra_role_object_permission; -pub use self::extra_role_object_permission::ExtraRoleObjectPermission; -pub mod file_list; -pub use self::file_list::FileList; -pub mod fleet_connector; -pub use self::fleet_connector::FleetConnector; -pub mod fleet_connector_request; -pub use self::fleet_connector_request::FleetConnectorRequest; -pub mod flow; -pub use self::flow::Flow; pub mod flow_challenge_response_request; pub use self::flow_challenge_response_request::FlowChallengeResponseRequest; pub mod flow_designation_enum; pub use self::flow_designation_enum::FlowDesignationEnum; -pub mod flow_diagram; -pub use self::flow_diagram::FlowDiagram; pub mod flow_error_challenge; pub use self::flow_error_challenge::FlowErrorChallenge; -pub mod flow_inspection; -pub use self::flow_inspection::FlowInspection; -pub mod flow_inspector_plan; -pub use self::flow_inspector_plan::FlowInspectorPlan; -pub mod flow_layout_enum; -pub use self::flow_layout_enum::FlowLayoutEnum; -pub mod flow_request; -pub use self::flow_request::FlowRequest; -pub mod flow_set; -pub use self::flow_set::FlowSet; -pub mod flow_stage_binding; -pub use self::flow_stage_binding::FlowStageBinding; -pub mod flow_stage_binding_request; -pub use self::flow_stage_binding_request::FlowStageBindingRequest; -pub mod footer_link; -pub use self::footer_link::FooterLink; -pub mod force_binding_enum; -pub use self::force_binding_enum::ForceBindingEnum; -pub mod format_enum; -pub use self::format_enum::FormatEnum; pub mod frame_challenge; pub use self::frame_challenge::FrameChallenge; pub mod frame_challenge_response_request; pub use self::frame_challenge_response_request::FrameChallengeResponseRequest; pub mod generic_error; pub use self::generic_error::GenericError; -pub mod geo_ip_policy; -pub use self::geo_ip_policy::GeoIpPolicy; -pub mod geo_ip_policy_countries_obj_inner; -pub use self::geo_ip_policy_countries_obj_inner::GeoIpPolicyCountriesObjInner; -pub mod geo_ip_policy_request; -pub use self::geo_ip_policy_request::GeoIpPolicyRequest; -pub mod geoip_binding_enum; -pub use self::geoip_binding_enum::GeoipBindingEnum; -pub mod global_task_status; -pub use self::global_task_status::GlobalTaskStatus; -pub mod google_chrome_connector; -pub use self::google_chrome_connector::GoogleChromeConnector; -pub mod google_chrome_connector_request; -pub use self::google_chrome_connector_request::GoogleChromeConnectorRequest; -pub mod google_endpoint_device; -pub use self::google_endpoint_device::GoogleEndpointDevice; -pub mod google_endpoint_device_request; -pub use self::google_endpoint_device_request::GoogleEndpointDeviceRequest; -pub mod google_workspace_provider; -pub use self::google_workspace_provider::GoogleWorkspaceProvider; -pub mod google_workspace_provider_group; -pub use self::google_workspace_provider_group::GoogleWorkspaceProviderGroup; -pub mod google_workspace_provider_group_request; -pub use self::google_workspace_provider_group_request::GoogleWorkspaceProviderGroupRequest; -pub mod google_workspace_provider_mapping; -pub use self::google_workspace_provider_mapping::GoogleWorkspaceProviderMapping; -pub mod google_workspace_provider_mapping_request; -pub use self::google_workspace_provider_mapping_request::GoogleWorkspaceProviderMappingRequest; -pub mod google_workspace_provider_request; -pub use self::google_workspace_provider_request::GoogleWorkspaceProviderRequest; -pub mod google_workspace_provider_user; -pub use self::google_workspace_provider_user::GoogleWorkspaceProviderUser; -pub mod google_workspace_provider_user_request; -pub use self::google_workspace_provider_user_request::GoogleWorkspaceProviderUserRequest; pub mod group; pub use self::group::Group; -pub mod group_kerberos_source_connection; -pub use self::group_kerberos_source_connection::GroupKerberosSourceConnection; -pub mod group_kerberos_source_connection_request; -pub use self::group_kerberos_source_connection_request::GroupKerberosSourceConnectionRequest; -pub mod group_ldap_source_connection; -pub use self::group_ldap_source_connection::GroupLdapSourceConnection; -pub mod group_ldap_source_connection_request; -pub use self::group_ldap_source_connection_request::GroupLdapSourceConnectionRequest; -pub mod group_matching_mode_enum; -pub use self::group_matching_mode_enum::GroupMatchingModeEnum; -pub mod group_o_auth_source_connection; -pub use self::group_o_auth_source_connection::GroupOAuthSourceConnection; -pub mod group_o_auth_source_connection_request; -pub use self::group_o_auth_source_connection_request::GroupOAuthSourceConnectionRequest; -pub mod group_plex_source_connection; -pub use self::group_plex_source_connection::GroupPlexSourceConnection; -pub mod group_plex_source_connection_request; -pub use self::group_plex_source_connection_request::GroupPlexSourceConnectionRequest; -pub mod group_request; -pub use self::group_request::GroupRequest; -pub mod group_saml_source_connection; -pub use self::group_saml_source_connection::GroupSamlSourceConnection; -pub mod group_saml_source_connection_request; -pub use self::group_saml_source_connection_request::GroupSamlSourceConnectionRequest; -pub mod group_source_connection; -pub use self::group_source_connection::GroupSourceConnection; -pub mod group_source_connection_request; -pub use self::group_source_connection_request::GroupSourceConnectionRequest; -pub mod group_telegram_source_connection; -pub use self::group_telegram_source_connection::GroupTelegramSourceConnection; -pub mod group_telegram_source_connection_request; -pub use self::group_telegram_source_connection_request::GroupTelegramSourceConnectionRequest; -pub mod hardware; -pub use self::hardware::Hardware; -pub mod hardware_request; -pub use self::hardware_request::HardwareRequest; pub mod identification_challenge; pub use self::identification_challenge::IdentificationChallenge; pub mod identification_challenge_response_request; pub use self::identification_challenge_response_request::IdentificationChallengeResponseRequest; -pub mod identification_stage; -pub use self::identification_stage::IdentificationStage; -pub mod identification_stage_request; -pub use self::identification_stage_request::IdentificationStageRequest; pub mod iframe_logout_challenge; pub use self::iframe_logout_challenge::IframeLogoutChallenge; pub mod iframe_logout_challenge_response_request; pub use self::iframe_logout_challenge_response_request::IframeLogoutChallengeResponseRequest; -pub mod impersonation_request; -pub use self::impersonation_request::ImpersonationRequest; -pub mod initial_permissions; -pub use self::initial_permissions::InitialPermissions; -pub mod initial_permissions_request; -pub use self::initial_permissions_request::InitialPermissionsRequest; -pub mod install_id; -pub use self::install_id::InstallId; -pub mod intent_enum; -pub use self::intent_enum::IntentEnum; -pub mod invalid_response_action_enum; -pub use self::invalid_response_action_enum::InvalidResponseActionEnum; -pub mod invitation; -pub use self::invitation::Invitation; -pub mod invitation_request; -pub use self::invitation_request::InvitationRequest; -pub mod invitation_send_email_request; -pub use self::invitation_send_email_request::InvitationSendEmailRequest; -pub mod invitation_stage; -pub use self::invitation_stage::InvitationStage; -pub mod invitation_stage_request; -pub use self::invitation_stage_request::InvitationStageRequest; -pub mod issuer_mode_enum; -pub use self::issuer_mode_enum::IssuerModeEnum; -pub mod kadmin_type_enum; -pub use self::kadmin_type_enum::KadminTypeEnum; -pub mod kerberos_source; -pub use self::kerberos_source::KerberosSource; -pub mod kerberos_source_property_mapping; -pub use self::kerberos_source_property_mapping::KerberosSourcePropertyMapping; -pub mod kerberos_source_property_mapping_request; -pub use self::kerberos_source_property_mapping_request::KerberosSourcePropertyMappingRequest; -pub mod kerberos_source_request; -pub use self::kerberos_source_request::KerberosSourceRequest; -pub mod key_type_enum; -pub use self::key_type_enum::KeyTypeEnum; -pub mod kubernetes_service_connection; -pub use self::kubernetes_service_connection::KubernetesServiceConnection; -pub mod kubernetes_service_connection_request; -pub use self::kubernetes_service_connection_request::KubernetesServiceConnectionRequest; -pub mod lang_enum; -pub use self::lang_enum::LangEnum; -pub mod last_task_status_enum; -pub use self::last_task_status_enum::LastTaskStatusEnum; pub mod ldap_check_access; pub use self::ldap_check_access::LdapCheckAccess; -pub mod ldap_debug; -pub use self::ldap_debug::LdapDebug; pub mod ldap_outpost_config; pub use self::ldap_outpost_config::LdapOutpostConfig; -pub mod ldap_provider; -pub use self::ldap_provider::LdapProvider; -pub mod ldap_provider_request; -pub use self::ldap_provider_request::LdapProviderRequest; -pub mod ldap_source; -pub use self::ldap_source::LdapSource; -pub mod ldap_source_property_mapping; -pub use self::ldap_source_property_mapping::LdapSourcePropertyMapping; -pub mod ldap_source_property_mapping_request; -pub use self::ldap_source_property_mapping_request::LdapSourcePropertyMappingRequest; -pub mod ldap_source_request; -pub use self::ldap_source_request::LdapSourceRequest; pub mod ldapapi_access_mode; pub use self::ldapapi_access_mode::LdapapiAccessMode; -pub mod license; -pub use self::license::License; -pub mod license_flags_enum; -pub use self::license_flags_enum::LicenseFlagsEnum; -pub mod license_forecast; -pub use self::license_forecast::LicenseForecast; -pub mod license_request; -pub use self::license_request::LicenseRequest; -pub mod license_status_enum; -pub use self::license_status_enum::LicenseStatusEnum; -pub mod license_summary; -pub use self::license_summary::LicenseSummary; -pub mod license_summary_status_enum; -pub use self::license_summary_status_enum::LicenseSummaryStatusEnum; -pub mod lifecycle_iteration; -pub use self::lifecycle_iteration::LifecycleIteration; -pub mod lifecycle_iteration_request; -pub use self::lifecycle_iteration_request::LifecycleIterationRequest; -pub mod lifecycle_iteration_state_enum; -pub use self::lifecycle_iteration_state_enum::LifecycleIterationStateEnum; -pub mod lifecycle_rule; -pub use self::lifecycle_rule::LifecycleRule; -pub mod lifecycle_rule_request; -pub use self::lifecycle_rule_request::LifecycleRuleRequest; -pub mod link; -pub use self::link::Link; pub mod log_event; pub use self::log_event::LogEvent; pub mod log_level_enum; @@ -586,80 +130,10 @@ pub mod login_source; pub use self::login_source::LoginSource; pub mod logout_url; pub use self::logout_url::LogoutUrl; -pub mod matching_mode_enum; -pub use self::matching_mode_enum::MatchingModeEnum; -pub mod mdm_config_request; -pub use self::mdm_config_request::MdmConfigRequest; -pub mod mdm_config_response; -pub use self::mdm_config_response::MdmConfigResponse; -pub mod metadata; -pub use self::metadata::Metadata; -pub mod microsoft_entra_provider; -pub use self::microsoft_entra_provider::MicrosoftEntraProvider; -pub mod microsoft_entra_provider_group; -pub use self::microsoft_entra_provider_group::MicrosoftEntraProviderGroup; -pub mod microsoft_entra_provider_group_request; -pub use self::microsoft_entra_provider_group_request::MicrosoftEntraProviderGroupRequest; -pub mod microsoft_entra_provider_mapping; -pub use self::microsoft_entra_provider_mapping::MicrosoftEntraProviderMapping; -pub mod microsoft_entra_provider_mapping_request; -pub use self::microsoft_entra_provider_mapping_request::MicrosoftEntraProviderMappingRequest; -pub mod microsoft_entra_provider_request; -pub use self::microsoft_entra_provider_request::MicrosoftEntraProviderRequest; -pub mod microsoft_entra_provider_user; -pub use self::microsoft_entra_provider_user::MicrosoftEntraProviderUser; -pub mod microsoft_entra_provider_user_request; -pub use self::microsoft_entra_provider_user_request::MicrosoftEntraProviderUserRequest; -pub mod model_enum; -pub use self::model_enum::ModelEnum; -pub mod model_request; -pub use self::model_request::ModelRequest; -pub mod mutual_tls_stage; -pub use self::mutual_tls_stage::MutualTlsStage; -pub mod mutual_tls_stage_request; -pub use self::mutual_tls_stage_request::MutualTlsStageRequest; pub mod native_logout_challenge; pub use self::native_logout_challenge::NativeLogoutChallenge; pub mod native_logout_challenge_response_request; pub use self::native_logout_challenge_response_request::NativeLogoutChallengeResponseRequest; -pub mod network; -pub use self::network::Network; -pub mod network_binding_enum; -pub use self::network_binding_enum::NetworkBindingEnum; -pub mod network_interface; -pub use self::network_interface::NetworkInterface; -pub mod network_interface_request; -pub use self::network_interface_request::NetworkInterfaceRequest; -pub mod network_request; -pub use self::network_request::NetworkRequest; -pub mod not_configured_action_enum; -pub use self::not_configured_action_enum::NotConfiguredActionEnum; -pub mod notification; -pub use self::notification::Notification; -pub mod notification_request; -pub use self::notification_request::NotificationRequest; -pub mod notification_rule; -pub use self::notification_rule::NotificationRule; -pub mod notification_rule_request; -pub use self::notification_rule_request::NotificationRuleRequest; -pub mod notification_transport; -pub use self::notification_transport::NotificationTransport; -pub mod notification_transport_request; -pub use self::notification_transport_request::NotificationTransportRequest; -pub mod notification_transport_test; -pub use self::notification_transport_test::NotificationTransportTest; -pub mod notification_webhook_mapping; -pub use self::notification_webhook_mapping::NotificationWebhookMapping; -pub mod notification_webhook_mapping_request; -pub use self::notification_webhook_mapping_request::NotificationWebhookMappingRequest; -pub mod o_auth2_provider; -pub use self::o_auth2_provider::OAuth2Provider; -pub mod o_auth2_provider_logout_method_enum; -pub use self::o_auth2_provider_logout_method_enum::OAuth2ProviderLogoutMethodEnum; -pub mod o_auth2_provider_request; -pub use self::o_auth2_provider_request::OAuth2ProviderRequest; -pub mod o_auth2_provider_setup_urls; -pub use self::o_auth2_provider_setup_urls::OAuth2ProviderSetupUrls; pub mod o_auth_device_code_challenge; pub use self::o_auth_device_code_challenge::OAuthDeviceCodeChallenge; pub mod o_auth_device_code_challenge_response_request; @@ -668,340 +142,26 @@ pub mod o_auth_device_code_finish_challenge; pub use self::o_auth_device_code_finish_challenge::OAuthDeviceCodeFinishChallenge; pub mod o_auth_device_code_finish_challenge_response_request; pub use self::o_auth_device_code_finish_challenge_response_request::OAuthDeviceCodeFinishChallengeResponseRequest; -pub mod o_auth_source; -pub use self::o_auth_source::OAuthSource; -pub mod o_auth_source_property_mapping; -pub use self::o_auth_source_property_mapping::OAuthSourcePropertyMapping; -pub mod o_auth_source_property_mapping_request; -pub use self::o_auth_source_property_mapping_request::OAuthSourcePropertyMappingRequest; -pub mod o_auth_source_request; -pub use self::o_auth_source_request::OAuthSourceRequest; pub mod open_id_connect_configuration; pub use self::open_id_connect_configuration::OpenIdConnectConfiguration; -pub mod operating_system; -pub use self::operating_system::OperatingSystem; -pub mod operating_system_request; -pub use self::operating_system_request::OperatingSystemRequest; -pub mod outgoing_sync_delete_action; -pub use self::outgoing_sync_delete_action::OutgoingSyncDeleteAction; pub mod outpost; pub use self::outpost::Outpost; -pub mod outpost_default_config; -pub use self::outpost_default_config::OutpostDefaultConfig; -pub mod outpost_health; -pub use self::outpost_health::OutpostHealth; -pub mod outpost_request; -pub use self::outpost_request::OutpostRequest; pub mod outpost_type_enum; pub use self::outpost_type_enum::OutpostTypeEnum; -pub mod paginated_agent_connector_list; -pub use self::paginated_agent_connector_list::PaginatedAgentConnectorList; -pub mod paginated_application_entitlement_list; -pub use self::paginated_application_entitlement_list::PaginatedApplicationEntitlementList; -pub mod paginated_application_list; -pub use self::paginated_application_list::PaginatedApplicationList; -pub mod paginated_authenticated_session_list; -pub use self::paginated_authenticated_session_list::PaginatedAuthenticatedSessionList; -pub mod paginated_authenticator_duo_stage_list; -pub use self::paginated_authenticator_duo_stage_list::PaginatedAuthenticatorDuoStageList; -pub mod paginated_authenticator_email_stage_list; -pub use self::paginated_authenticator_email_stage_list::PaginatedAuthenticatorEmailStageList; -pub mod paginated_authenticator_endpoint_gdtc_stage_list; -pub use self::paginated_authenticator_endpoint_gdtc_stage_list::PaginatedAuthenticatorEndpointGdtcStageList; -pub mod paginated_authenticator_sms_stage_list; -pub use self::paginated_authenticator_sms_stage_list::PaginatedAuthenticatorSmsStageList; -pub mod paginated_authenticator_static_stage_list; -pub use self::paginated_authenticator_static_stage_list::PaginatedAuthenticatorStaticStageList; -pub mod paginated_authenticator_totp_stage_list; -pub use self::paginated_authenticator_totp_stage_list::PaginatedAuthenticatorTotpStageList; -pub mod paginated_authenticator_validate_stage_list; -pub use self::paginated_authenticator_validate_stage_list::PaginatedAuthenticatorValidateStageList; -pub mod paginated_authenticator_web_authn_stage_list; -pub use self::paginated_authenticator_web_authn_stage_list::PaginatedAuthenticatorWebAuthnStageList; -pub mod paginated_blueprint_instance_list; -pub use self::paginated_blueprint_instance_list::PaginatedBlueprintInstanceList; pub mod paginated_brand_list; pub use self::paginated_brand_list::PaginatedBrandList; -pub mod paginated_captcha_stage_list; -pub use self::paginated_captcha_stage_list::PaginatedCaptchaStageList; -pub mod paginated_certificate_key_pair_list; -pub use self::paginated_certificate_key_pair_list::PaginatedCertificateKeyPairList; -pub mod paginated_connection_token_list; -pub use self::paginated_connection_token_list::PaginatedConnectionTokenList; -pub mod paginated_connector_list; -pub use self::paginated_connector_list::PaginatedConnectorList; -pub mod paginated_consent_stage_list; -pub use self::paginated_consent_stage_list::PaginatedConsentStageList; -pub mod paginated_data_export_list; -pub use self::paginated_data_export_list::PaginatedDataExportList; -pub mod paginated_deny_stage_list; -pub use self::paginated_deny_stage_list::PaginatedDenyStageList; -pub mod paginated_device_access_group_list; -pub use self::paginated_device_access_group_list::PaginatedDeviceAccessGroupList; -pub mod paginated_device_user_binding_list; -pub use self::paginated_device_user_binding_list::PaginatedDeviceUserBindingList; -pub mod paginated_docker_service_connection_list; -pub use self::paginated_docker_service_connection_list::PaginatedDockerServiceConnectionList; -pub mod paginated_domain_list; -pub use self::paginated_domain_list::PaginatedDomainList; -pub mod paginated_dummy_policy_list; -pub use self::paginated_dummy_policy_list::PaginatedDummyPolicyList; -pub mod paginated_dummy_stage_list; -pub use self::paginated_dummy_stage_list::PaginatedDummyStageList; -pub mod paginated_duo_device_list; -pub use self::paginated_duo_device_list::PaginatedDuoDeviceList; -pub mod paginated_email_device_list; -pub use self::paginated_email_device_list::PaginatedEmailDeviceList; -pub mod paginated_email_stage_list; -pub use self::paginated_email_stage_list::PaginatedEmailStageList; -pub mod paginated_endpoint_device_list; -pub use self::paginated_endpoint_device_list::PaginatedEndpointDeviceList; -pub mod paginated_endpoint_list; -pub use self::paginated_endpoint_list::PaginatedEndpointList; -pub mod paginated_endpoint_stage_list; -pub use self::paginated_endpoint_stage_list::PaginatedEndpointStageList; -pub mod paginated_enrollment_token_list; -pub use self::paginated_enrollment_token_list::PaginatedEnrollmentTokenList; -pub mod paginated_event_list; -pub use self::paginated_event_list::PaginatedEventList; -pub mod paginated_event_matcher_policy_list; -pub use self::paginated_event_matcher_policy_list::PaginatedEventMatcherPolicyList; -pub mod paginated_expiring_base_grant_model_list; -pub use self::paginated_expiring_base_grant_model_list::PaginatedExpiringBaseGrantModelList; -pub mod paginated_expression_policy_list; -pub use self::paginated_expression_policy_list::PaginatedExpressionPolicyList; -pub mod paginated_extra_role_object_permission_list; -pub use self::paginated_extra_role_object_permission_list::PaginatedExtraRoleObjectPermissionList; -pub mod paginated_fleet_connector_list; -pub use self::paginated_fleet_connector_list::PaginatedFleetConnectorList; -pub mod paginated_flow_list; -pub use self::paginated_flow_list::PaginatedFlowList; -pub mod paginated_flow_stage_binding_list; -pub use self::paginated_flow_stage_binding_list::PaginatedFlowStageBindingList; -pub mod paginated_geo_ip_policy_list; -pub use self::paginated_geo_ip_policy_list::PaginatedGeoIpPolicyList; -pub mod paginated_google_chrome_connector_list; -pub use self::paginated_google_chrome_connector_list::PaginatedGoogleChromeConnectorList; -pub mod paginated_google_endpoint_device_list; -pub use self::paginated_google_endpoint_device_list::PaginatedGoogleEndpointDeviceList; -pub mod paginated_google_workspace_provider_group_list; -pub use self::paginated_google_workspace_provider_group_list::PaginatedGoogleWorkspaceProviderGroupList; -pub mod paginated_google_workspace_provider_list; -pub use self::paginated_google_workspace_provider_list::PaginatedGoogleWorkspaceProviderList; -pub mod paginated_google_workspace_provider_mapping_list; -pub use self::paginated_google_workspace_provider_mapping_list::PaginatedGoogleWorkspaceProviderMappingList; -pub mod paginated_google_workspace_provider_user_list; -pub use self::paginated_google_workspace_provider_user_list::PaginatedGoogleWorkspaceProviderUserList; -pub mod paginated_group_kerberos_source_connection_list; -pub use self::paginated_group_kerberos_source_connection_list::PaginatedGroupKerberosSourceConnectionList; -pub mod paginated_group_ldap_source_connection_list; -pub use self::paginated_group_ldap_source_connection_list::PaginatedGroupLdapSourceConnectionList; pub mod paginated_group_list; pub use self::paginated_group_list::PaginatedGroupList; -pub mod paginated_group_o_auth_source_connection_list; -pub use self::paginated_group_o_auth_source_connection_list::PaginatedGroupOAuthSourceConnectionList; -pub mod paginated_group_plex_source_connection_list; -pub use self::paginated_group_plex_source_connection_list::PaginatedGroupPlexSourceConnectionList; -pub mod paginated_group_saml_source_connection_list; -pub use self::paginated_group_saml_source_connection_list::PaginatedGroupSamlSourceConnectionList; -pub mod paginated_group_source_connection_list; -pub use self::paginated_group_source_connection_list::PaginatedGroupSourceConnectionList; -pub mod paginated_group_telegram_source_connection_list; -pub use self::paginated_group_telegram_source_connection_list::PaginatedGroupTelegramSourceConnectionList; -pub mod paginated_identification_stage_list; -pub use self::paginated_identification_stage_list::PaginatedIdentificationStageList; -pub mod paginated_initial_permissions_list; -pub use self::paginated_initial_permissions_list::PaginatedInitialPermissionsList; -pub mod paginated_invitation_list; -pub use self::paginated_invitation_list::PaginatedInvitationList; -pub mod paginated_invitation_stage_list; -pub use self::paginated_invitation_stage_list::PaginatedInvitationStageList; -pub mod paginated_kerberos_source_list; -pub use self::paginated_kerberos_source_list::PaginatedKerberosSourceList; -pub mod paginated_kerberos_source_property_mapping_list; -pub use self::paginated_kerberos_source_property_mapping_list::PaginatedKerberosSourcePropertyMappingList; -pub mod paginated_kubernetes_service_connection_list; -pub use self::paginated_kubernetes_service_connection_list::PaginatedKubernetesServiceConnectionList; pub mod paginated_ldap_outpost_config_list; pub use self::paginated_ldap_outpost_config_list::PaginatedLdapOutpostConfigList; -pub mod paginated_ldap_provider_list; -pub use self::paginated_ldap_provider_list::PaginatedLdapProviderList; -pub mod paginated_ldap_source_list; -pub use self::paginated_ldap_source_list::PaginatedLdapSourceList; -pub mod paginated_ldap_source_property_mapping_list; -pub use self::paginated_ldap_source_property_mapping_list::PaginatedLdapSourcePropertyMappingList; -pub mod paginated_license_list; -pub use self::paginated_license_list::PaginatedLicenseList; -pub mod paginated_lifecycle_iteration_list; -pub use self::paginated_lifecycle_iteration_list::PaginatedLifecycleIterationList; -pub mod paginated_lifecycle_rule_list; -pub use self::paginated_lifecycle_rule_list::PaginatedLifecycleRuleList; -pub mod paginated_microsoft_entra_provider_group_list; -pub use self::paginated_microsoft_entra_provider_group_list::PaginatedMicrosoftEntraProviderGroupList; -pub mod paginated_microsoft_entra_provider_list; -pub use self::paginated_microsoft_entra_provider_list::PaginatedMicrosoftEntraProviderList; -pub mod paginated_microsoft_entra_provider_mapping_list; -pub use self::paginated_microsoft_entra_provider_mapping_list::PaginatedMicrosoftEntraProviderMappingList; -pub mod paginated_microsoft_entra_provider_user_list; -pub use self::paginated_microsoft_entra_provider_user_list::PaginatedMicrosoftEntraProviderUserList; -pub mod paginated_mutual_tls_stage_list; -pub use self::paginated_mutual_tls_stage_list::PaginatedMutualTlsStageList; -pub mod paginated_notification_list; -pub use self::paginated_notification_list::PaginatedNotificationList; -pub mod paginated_notification_rule_list; -pub use self::paginated_notification_rule_list::PaginatedNotificationRuleList; -pub mod paginated_notification_transport_list; -pub use self::paginated_notification_transport_list::PaginatedNotificationTransportList; -pub mod paginated_notification_webhook_mapping_list; -pub use self::paginated_notification_webhook_mapping_list::PaginatedNotificationWebhookMappingList; -pub mod paginated_o_auth2_provider_list; -pub use self::paginated_o_auth2_provider_list::PaginatedOAuth2ProviderList; -pub mod paginated_o_auth_source_list; -pub use self::paginated_o_auth_source_list::PaginatedOAuthSourceList; -pub mod paginated_o_auth_source_property_mapping_list; -pub use self::paginated_o_auth_source_property_mapping_list::PaginatedOAuthSourcePropertyMappingList; pub mod paginated_outpost_list; pub use self::paginated_outpost_list::PaginatedOutpostList; -pub mod paginated_password_expiry_policy_list; -pub use self::paginated_password_expiry_policy_list::PaginatedPasswordExpiryPolicyList; -pub mod paginated_password_policy_list; -pub use self::paginated_password_policy_list::PaginatedPasswordPolicyList; -pub mod paginated_password_stage_list; -pub use self::paginated_password_stage_list::PaginatedPasswordStageList; -pub mod paginated_permission_list; -pub use self::paginated_permission_list::PaginatedPermissionList; -pub mod paginated_plex_source_list; -pub use self::paginated_plex_source_list::PaginatedPlexSourceList; -pub mod paginated_plex_source_property_mapping_list; -pub use self::paginated_plex_source_property_mapping_list::PaginatedPlexSourcePropertyMappingList; -pub mod paginated_policy_binding_list; -pub use self::paginated_policy_binding_list::PaginatedPolicyBindingList; -pub mod paginated_policy_list; -pub use self::paginated_policy_list::PaginatedPolicyList; -pub mod paginated_prompt_list; -pub use self::paginated_prompt_list::PaginatedPromptList; -pub mod paginated_prompt_stage_list; -pub use self::paginated_prompt_stage_list::PaginatedPromptStageList; -pub mod paginated_property_mapping_list; -pub use self::paginated_property_mapping_list::PaginatedPropertyMappingList; -pub mod paginated_provider_list; -pub use self::paginated_provider_list::PaginatedProviderList; pub mod paginated_proxy_outpost_config_list; pub use self::paginated_proxy_outpost_config_list::PaginatedProxyOutpostConfigList; -pub mod paginated_proxy_provider_list; -pub use self::paginated_proxy_provider_list::PaginatedProxyProviderList; -pub mod paginated_rac_property_mapping_list; -pub use self::paginated_rac_property_mapping_list::PaginatedRacPropertyMappingList; -pub mod paginated_rac_provider_list; -pub use self::paginated_rac_provider_list::PaginatedRacProviderList; pub mod paginated_radius_outpost_config_list; pub use self::paginated_radius_outpost_config_list::PaginatedRadiusOutpostConfigList; -pub mod paginated_radius_provider_list; -pub use self::paginated_radius_provider_list::PaginatedRadiusProviderList; -pub mod paginated_radius_provider_property_mapping_list; -pub use self::paginated_radius_provider_property_mapping_list::PaginatedRadiusProviderPropertyMappingList; -pub mod paginated_redirect_stage_list; -pub use self::paginated_redirect_stage_list::PaginatedRedirectStageList; -pub mod paginated_reputation_list; -pub use self::paginated_reputation_list::PaginatedReputationList; -pub mod paginated_reputation_policy_list; -pub use self::paginated_reputation_policy_list::PaginatedReputationPolicyList; -pub mod paginated_role_assigned_object_permission_list; -pub use self::paginated_role_assigned_object_permission_list::PaginatedRoleAssignedObjectPermissionList; -pub mod paginated_role_list; -pub use self::paginated_role_list::PaginatedRoleList; -pub mod paginated_saml_property_mapping_list; -pub use self::paginated_saml_property_mapping_list::PaginatedSamlPropertyMappingList; -pub mod paginated_saml_provider_list; -pub use self::paginated_saml_provider_list::PaginatedSamlProviderList; -pub mod paginated_saml_source_list; -pub use self::paginated_saml_source_list::PaginatedSamlSourceList; -pub mod paginated_saml_source_property_mapping_list; -pub use self::paginated_saml_source_property_mapping_list::PaginatedSamlSourcePropertyMappingList; -pub mod paginated_schedule_list; -pub use self::paginated_schedule_list::PaginatedScheduleList; -pub mod paginated_scim_mapping_list; -pub use self::paginated_scim_mapping_list::PaginatedScimMappingList; -pub mod paginated_scim_provider_group_list; -pub use self::paginated_scim_provider_group_list::PaginatedScimProviderGroupList; -pub mod paginated_scim_provider_list; -pub use self::paginated_scim_provider_list::PaginatedScimProviderList; -pub mod paginated_scim_provider_user_list; -pub use self::paginated_scim_provider_user_list::PaginatedScimProviderUserList; -pub mod paginated_scim_source_group_list; -pub use self::paginated_scim_source_group_list::PaginatedScimSourceGroupList; -pub mod paginated_scim_source_list; -pub use self::paginated_scim_source_list::PaginatedScimSourceList; -pub mod paginated_scim_source_property_mapping_list; -pub use self::paginated_scim_source_property_mapping_list::PaginatedScimSourcePropertyMappingList; -pub mod paginated_scim_source_user_list; -pub use self::paginated_scim_source_user_list::PaginatedScimSourceUserList; -pub mod paginated_scope_mapping_list; -pub use self::paginated_scope_mapping_list::PaginatedScopeMappingList; -pub mod paginated_service_connection_list; -pub use self::paginated_service_connection_list::PaginatedServiceConnectionList; -pub mod paginated_sms_device_list; -pub use self::paginated_sms_device_list::PaginatedSmsDeviceList; -pub mod paginated_source_list; -pub use self::paginated_source_list::PaginatedSourceList; -pub mod paginated_source_stage_list; -pub use self::paginated_source_stage_list::PaginatedSourceStageList; -pub mod paginated_ssf_provider_list; -pub use self::paginated_ssf_provider_list::PaginatedSsfProviderList; -pub mod paginated_ssf_stream_list; -pub use self::paginated_ssf_stream_list::PaginatedSsfStreamList; -pub mod paginated_stage_list; -pub use self::paginated_stage_list::PaginatedStageList; -pub mod paginated_static_device_list; -pub use self::paginated_static_device_list::PaginatedStaticDeviceList; -pub mod paginated_task_list; -pub use self::paginated_task_list::PaginatedTaskList; -pub mod paginated_telegram_source_list; -pub use self::paginated_telegram_source_list::PaginatedTelegramSourceList; -pub mod paginated_telegram_source_property_mapping_list; -pub use self::paginated_telegram_source_property_mapping_list::PaginatedTelegramSourcePropertyMappingList; -pub mod paginated_tenant_list; -pub use self::paginated_tenant_list::PaginatedTenantList; -pub mod paginated_token_list; -pub use self::paginated_token_list::PaginatedTokenList; -pub mod paginated_token_model_list; -pub use self::paginated_token_model_list::PaginatedTokenModelList; -pub mod paginated_totp_device_list; -pub use self::paginated_totp_device_list::PaginatedTotpDeviceList; -pub mod paginated_unique_password_policy_list; -pub use self::paginated_unique_password_policy_list::PaginatedUniquePasswordPolicyList; -pub mod paginated_user_consent_list; -pub use self::paginated_user_consent_list::PaginatedUserConsentList; -pub mod paginated_user_delete_stage_list; -pub use self::paginated_user_delete_stage_list::PaginatedUserDeleteStageList; -pub mod paginated_user_kerberos_source_connection_list; -pub use self::paginated_user_kerberos_source_connection_list::PaginatedUserKerberosSourceConnectionList; -pub mod paginated_user_ldap_source_connection_list; -pub use self::paginated_user_ldap_source_connection_list::PaginatedUserLdapSourceConnectionList; pub mod paginated_user_list; pub use self::paginated_user_list::PaginatedUserList; -pub mod paginated_user_login_stage_list; -pub use self::paginated_user_login_stage_list::PaginatedUserLoginStageList; -pub mod paginated_user_logout_stage_list; -pub use self::paginated_user_logout_stage_list::PaginatedUserLogoutStageList; -pub mod paginated_user_o_auth_source_connection_list; -pub use self::paginated_user_o_auth_source_connection_list::PaginatedUserOAuthSourceConnectionList; -pub mod paginated_user_plex_source_connection_list; -pub use self::paginated_user_plex_source_connection_list::PaginatedUserPlexSourceConnectionList; -pub mod paginated_user_saml_source_connection_list; -pub use self::paginated_user_saml_source_connection_list::PaginatedUserSamlSourceConnectionList; -pub mod paginated_user_source_connection_list; -pub use self::paginated_user_source_connection_list::PaginatedUserSourceConnectionList; -pub mod paginated_user_telegram_source_connection_list; -pub use self::paginated_user_telegram_source_connection_list::PaginatedUserTelegramSourceConnectionList; -pub mod paginated_user_write_stage_list; -pub use self::paginated_user_write_stage_list::PaginatedUserWriteStageList; -pub mod paginated_web_authn_device_list; -pub use self::paginated_web_authn_device_list::PaginatedWebAuthnDeviceList; -pub mod paginated_web_authn_device_type_list; -pub use self::paginated_web_authn_device_type_list::PaginatedWebAuthnDeviceTypeList; -pub mod paginated_ws_federation_provider_list; -pub use self::paginated_ws_federation_provider_list::PaginatedWsFederationProviderList; pub mod pagination; pub use self::pagination::Pagination; pub mod partial_group; @@ -1012,731 +172,71 @@ pub mod password_challenge; pub use self::password_challenge::PasswordChallenge; pub mod password_challenge_response_request; pub use self::password_challenge_response_request::PasswordChallengeResponseRequest; -pub mod password_expiry_policy; -pub use self::password_expiry_policy::PasswordExpiryPolicy; -pub mod password_expiry_policy_request; -pub use self::password_expiry_policy_request::PasswordExpiryPolicyRequest; -pub mod password_policy; -pub use self::password_policy::PasswordPolicy; -pub mod password_policy_request; -pub use self::password_policy_request::PasswordPolicyRequest; -pub mod password_stage; -pub use self::password_stage::PasswordStage; -pub mod password_stage_request; -pub use self::password_stage_request::PasswordStageRequest; -pub mod patched_agent_connector_request; -pub use self::patched_agent_connector_request::PatchedAgentConnectorRequest; -pub mod patched_application_entitlement_request; -pub use self::patched_application_entitlement_request::PatchedApplicationEntitlementRequest; -pub mod patched_application_request; -pub use self::patched_application_request::PatchedApplicationRequest; -pub mod patched_authenticator_duo_stage_request; -pub use self::patched_authenticator_duo_stage_request::PatchedAuthenticatorDuoStageRequest; -pub mod patched_authenticator_email_stage_request; -pub use self::patched_authenticator_email_stage_request::PatchedAuthenticatorEmailStageRequest; -pub mod patched_authenticator_endpoint_gdtc_stage_request; -pub use self::patched_authenticator_endpoint_gdtc_stage_request::PatchedAuthenticatorEndpointGdtcStageRequest; -pub mod patched_authenticator_sms_stage_request; -pub use self::patched_authenticator_sms_stage_request::PatchedAuthenticatorSmsStageRequest; -pub mod patched_authenticator_static_stage_request; -pub use self::patched_authenticator_static_stage_request::PatchedAuthenticatorStaticStageRequest; -pub mod patched_authenticator_totp_stage_request; -pub use self::patched_authenticator_totp_stage_request::PatchedAuthenticatorTotpStageRequest; -pub mod patched_authenticator_validate_stage_request; -pub use self::patched_authenticator_validate_stage_request::PatchedAuthenticatorValidateStageRequest; -pub mod patched_authenticator_web_authn_stage_request; -pub use self::patched_authenticator_web_authn_stage_request::PatchedAuthenticatorWebAuthnStageRequest; -pub mod patched_blueprint_instance_request; -pub use self::patched_blueprint_instance_request::PatchedBlueprintInstanceRequest; -pub mod patched_brand_request; -pub use self::patched_brand_request::PatchedBrandRequest; -pub mod patched_captcha_stage_request; -pub use self::patched_captcha_stage_request::PatchedCaptchaStageRequest; -pub mod patched_certificate_key_pair_request; -pub use self::patched_certificate_key_pair_request::PatchedCertificateKeyPairRequest; -pub mod patched_connection_token_request; -pub use self::patched_connection_token_request::PatchedConnectionTokenRequest; -pub mod patched_consent_stage_request; -pub use self::patched_consent_stage_request::PatchedConsentStageRequest; -pub mod patched_deny_stage_request; -pub use self::patched_deny_stage_request::PatchedDenyStageRequest; -pub mod patched_device_access_group_request; -pub use self::patched_device_access_group_request::PatchedDeviceAccessGroupRequest; -pub mod patched_device_user_binding_request; -pub use self::patched_device_user_binding_request::PatchedDeviceUserBindingRequest; -pub mod patched_docker_service_connection_request; -pub use self::patched_docker_service_connection_request::PatchedDockerServiceConnectionRequest; -pub mod patched_domain_request; -pub use self::patched_domain_request::PatchedDomainRequest; -pub mod patched_dummy_policy_request; -pub use self::patched_dummy_policy_request::PatchedDummyPolicyRequest; -pub mod patched_dummy_stage_request; -pub use self::patched_dummy_stage_request::PatchedDummyStageRequest; -pub mod patched_duo_device_request; -pub use self::patched_duo_device_request::PatchedDuoDeviceRequest; -pub mod patched_email_device_request; -pub use self::patched_email_device_request::PatchedEmailDeviceRequest; -pub mod patched_email_stage_request; -pub use self::patched_email_stage_request::PatchedEmailStageRequest; -pub mod patched_endpoint_device_request; -pub use self::patched_endpoint_device_request::PatchedEndpointDeviceRequest; -pub mod patched_endpoint_request; -pub use self::patched_endpoint_request::PatchedEndpointRequest; -pub mod patched_endpoint_stage_request; -pub use self::patched_endpoint_stage_request::PatchedEndpointStageRequest; -pub mod patched_enrollment_token_request; -pub use self::patched_enrollment_token_request::PatchedEnrollmentTokenRequest; -pub mod patched_event_matcher_policy_request; -pub use self::patched_event_matcher_policy_request::PatchedEventMatcherPolicyRequest; -pub mod patched_event_request; -pub use self::patched_event_request::PatchedEventRequest; -pub mod patched_expression_policy_request; -pub use self::patched_expression_policy_request::PatchedExpressionPolicyRequest; -pub mod patched_fleet_connector_request; -pub use self::patched_fleet_connector_request::PatchedFleetConnectorRequest; -pub mod patched_flow_request; -pub use self::patched_flow_request::PatchedFlowRequest; -pub mod patched_flow_stage_binding_request; -pub use self::patched_flow_stage_binding_request::PatchedFlowStageBindingRequest; -pub mod patched_geo_ip_policy_request; -pub use self::patched_geo_ip_policy_request::PatchedGeoIpPolicyRequest; -pub mod patched_google_chrome_connector_request; -pub use self::patched_google_chrome_connector_request::PatchedGoogleChromeConnectorRequest; -pub mod patched_google_endpoint_device_request; -pub use self::patched_google_endpoint_device_request::PatchedGoogleEndpointDeviceRequest; -pub mod patched_google_workspace_provider_mapping_request; -pub use self::patched_google_workspace_provider_mapping_request::PatchedGoogleWorkspaceProviderMappingRequest; -pub mod patched_google_workspace_provider_request; -pub use self::patched_google_workspace_provider_request::PatchedGoogleWorkspaceProviderRequest; -pub mod patched_group_kerberos_source_connection_request; -pub use self::patched_group_kerberos_source_connection_request::PatchedGroupKerberosSourceConnectionRequest; -pub mod patched_group_ldap_source_connection_request; -pub use self::patched_group_ldap_source_connection_request::PatchedGroupLdapSourceConnectionRequest; -pub mod patched_group_o_auth_source_connection_request; -pub use self::patched_group_o_auth_source_connection_request::PatchedGroupOAuthSourceConnectionRequest; -pub mod patched_group_plex_source_connection_request; -pub use self::patched_group_plex_source_connection_request::PatchedGroupPlexSourceConnectionRequest; -pub mod patched_group_request; -pub use self::patched_group_request::PatchedGroupRequest; -pub mod patched_group_saml_source_connection_request; -pub use self::patched_group_saml_source_connection_request::PatchedGroupSamlSourceConnectionRequest; -pub mod patched_group_source_connection_request; -pub use self::patched_group_source_connection_request::PatchedGroupSourceConnectionRequest; -pub mod patched_group_telegram_source_connection_request; -pub use self::patched_group_telegram_source_connection_request::PatchedGroupTelegramSourceConnectionRequest; -pub mod patched_identification_stage_request; -pub use self::patched_identification_stage_request::PatchedIdentificationStageRequest; -pub mod patched_initial_permissions_request; -pub use self::patched_initial_permissions_request::PatchedInitialPermissionsRequest; -pub mod patched_invitation_request; -pub use self::patched_invitation_request::PatchedInvitationRequest; -pub mod patched_invitation_stage_request; -pub use self::patched_invitation_stage_request::PatchedInvitationStageRequest; -pub mod patched_kerberos_source_property_mapping_request; -pub use self::patched_kerberos_source_property_mapping_request::PatchedKerberosSourcePropertyMappingRequest; -pub mod patched_kerberos_source_request; -pub use self::patched_kerberos_source_request::PatchedKerberosSourceRequest; -pub mod patched_kubernetes_service_connection_request; -pub use self::patched_kubernetes_service_connection_request::PatchedKubernetesServiceConnectionRequest; -pub mod patched_ldap_provider_request; -pub use self::patched_ldap_provider_request::PatchedLdapProviderRequest; -pub mod patched_ldap_source_property_mapping_request; -pub use self::patched_ldap_source_property_mapping_request::PatchedLdapSourcePropertyMappingRequest; -pub mod patched_ldap_source_request; -pub use self::patched_ldap_source_request::PatchedLdapSourceRequest; -pub mod patched_license_request; -pub use self::patched_license_request::PatchedLicenseRequest; -pub mod patched_lifecycle_rule_request; -pub use self::patched_lifecycle_rule_request::PatchedLifecycleRuleRequest; -pub mod patched_microsoft_entra_provider_mapping_request; -pub use self::patched_microsoft_entra_provider_mapping_request::PatchedMicrosoftEntraProviderMappingRequest; -pub mod patched_microsoft_entra_provider_request; -pub use self::patched_microsoft_entra_provider_request::PatchedMicrosoftEntraProviderRequest; -pub mod patched_mutual_tls_stage_request; -pub use self::patched_mutual_tls_stage_request::PatchedMutualTlsStageRequest; -pub mod patched_notification_request; -pub use self::patched_notification_request::PatchedNotificationRequest; -pub mod patched_notification_rule_request; -pub use self::patched_notification_rule_request::PatchedNotificationRuleRequest; -pub mod patched_notification_transport_request; -pub use self::patched_notification_transport_request::PatchedNotificationTransportRequest; -pub mod patched_notification_webhook_mapping_request; -pub use self::patched_notification_webhook_mapping_request::PatchedNotificationWebhookMappingRequest; -pub mod patched_o_auth2_provider_request; -pub use self::patched_o_auth2_provider_request::PatchedOAuth2ProviderRequest; -pub mod patched_o_auth_source_property_mapping_request; -pub use self::patched_o_auth_source_property_mapping_request::PatchedOAuthSourcePropertyMappingRequest; -pub mod patched_o_auth_source_request; -pub use self::patched_o_auth_source_request::PatchedOAuthSourceRequest; -pub mod patched_outpost_request; -pub use self::patched_outpost_request::PatchedOutpostRequest; -pub mod patched_password_expiry_policy_request; -pub use self::patched_password_expiry_policy_request::PatchedPasswordExpiryPolicyRequest; -pub mod patched_password_policy_request; -pub use self::patched_password_policy_request::PatchedPasswordPolicyRequest; -pub mod patched_password_stage_request; -pub use self::patched_password_stage_request::PatchedPasswordStageRequest; -pub mod patched_permission_assign_request; -pub use self::patched_permission_assign_request::PatchedPermissionAssignRequest; -pub mod patched_plex_source_property_mapping_request; -pub use self::patched_plex_source_property_mapping_request::PatchedPlexSourcePropertyMappingRequest; -pub mod patched_plex_source_request; -pub use self::patched_plex_source_request::PatchedPlexSourceRequest; -pub mod patched_policy_binding_request; -pub use self::patched_policy_binding_request::PatchedPolicyBindingRequest; -pub mod patched_prompt_request; -pub use self::patched_prompt_request::PatchedPromptRequest; -pub mod patched_prompt_stage_request; -pub use self::patched_prompt_stage_request::PatchedPromptStageRequest; -pub mod patched_proxy_provider_request; -pub use self::patched_proxy_provider_request::PatchedProxyProviderRequest; -pub mod patched_rac_property_mapping_request; -pub use self::patched_rac_property_mapping_request::PatchedRacPropertyMappingRequest; -pub mod patched_rac_provider_request; -pub use self::patched_rac_provider_request::PatchedRacProviderRequest; -pub mod patched_radius_provider_property_mapping_request; -pub use self::patched_radius_provider_property_mapping_request::PatchedRadiusProviderPropertyMappingRequest; -pub mod patched_radius_provider_request; -pub use self::patched_radius_provider_request::PatchedRadiusProviderRequest; -pub mod patched_redirect_stage_request; -pub use self::patched_redirect_stage_request::PatchedRedirectStageRequest; -pub mod patched_reputation_policy_request; -pub use self::patched_reputation_policy_request::PatchedReputationPolicyRequest; -pub mod patched_role_request; -pub use self::patched_role_request::PatchedRoleRequest; -pub mod patched_saml_property_mapping_request; -pub use self::patched_saml_property_mapping_request::PatchedSamlPropertyMappingRequest; -pub mod patched_saml_provider_request; -pub use self::patched_saml_provider_request::PatchedSamlProviderRequest; -pub mod patched_saml_source_property_mapping_request; -pub use self::patched_saml_source_property_mapping_request::PatchedSamlSourcePropertyMappingRequest; -pub mod patched_saml_source_request; -pub use self::patched_saml_source_request::PatchedSamlSourceRequest; -pub mod patched_schedule_request; -pub use self::patched_schedule_request::PatchedScheduleRequest; -pub mod patched_scim_mapping_request; -pub use self::patched_scim_mapping_request::PatchedScimMappingRequest; -pub mod patched_scim_provider_request; -pub use self::patched_scim_provider_request::PatchedScimProviderRequest; -pub mod patched_scim_source_group_request; -pub use self::patched_scim_source_group_request::PatchedScimSourceGroupRequest; -pub mod patched_scim_source_property_mapping_request; -pub use self::patched_scim_source_property_mapping_request::PatchedScimSourcePropertyMappingRequest; -pub mod patched_scim_source_request; -pub use self::patched_scim_source_request::PatchedScimSourceRequest; -pub mod patched_scim_source_user_request; -pub use self::patched_scim_source_user_request::PatchedScimSourceUserRequest; -pub mod patched_scope_mapping_request; -pub use self::patched_scope_mapping_request::PatchedScopeMappingRequest; -pub mod patched_settings_request; -pub use self::patched_settings_request::PatchedSettingsRequest; -pub mod patched_settings_request_flags; -pub use self::patched_settings_request_flags::PatchedSettingsRequestFlags; -pub mod patched_sms_device_request; -pub use self::patched_sms_device_request::PatchedSmsDeviceRequest; -pub mod patched_source_stage_request; -pub use self::patched_source_stage_request::PatchedSourceStageRequest; -pub mod patched_ssf_provider_request; -pub use self::patched_ssf_provider_request::PatchedSsfProviderRequest; -pub mod patched_static_device_request; -pub use self::patched_static_device_request::PatchedStaticDeviceRequest; -pub mod patched_telegram_source_property_mapping_request; -pub use self::patched_telegram_source_property_mapping_request::PatchedTelegramSourcePropertyMappingRequest; -pub mod patched_telegram_source_request; -pub use self::patched_telegram_source_request::PatchedTelegramSourceRequest; -pub mod patched_tenant_request; -pub use self::patched_tenant_request::PatchedTenantRequest; -pub mod patched_token_request; -pub use self::patched_token_request::PatchedTokenRequest; -pub mod patched_totp_device_request; -pub use self::patched_totp_device_request::PatchedTotpDeviceRequest; -pub mod patched_unique_password_policy_request; -pub use self::patched_unique_password_policy_request::PatchedUniquePasswordPolicyRequest; -pub mod patched_user_delete_stage_request; -pub use self::patched_user_delete_stage_request::PatchedUserDeleteStageRequest; -pub mod patched_user_kerberos_source_connection_request; -pub use self::patched_user_kerberos_source_connection_request::PatchedUserKerberosSourceConnectionRequest; -pub mod patched_user_ldap_source_connection_request; -pub use self::patched_user_ldap_source_connection_request::PatchedUserLdapSourceConnectionRequest; -pub mod patched_user_login_stage_request; -pub use self::patched_user_login_stage_request::PatchedUserLoginStageRequest; -pub mod patched_user_logout_stage_request; -pub use self::patched_user_logout_stage_request::PatchedUserLogoutStageRequest; -pub mod patched_user_o_auth_source_connection_request; -pub use self::patched_user_o_auth_source_connection_request::PatchedUserOAuthSourceConnectionRequest; -pub mod patched_user_plex_source_connection_request; -pub use self::patched_user_plex_source_connection_request::PatchedUserPlexSourceConnectionRequest; -pub mod patched_user_request; -pub use self::patched_user_request::PatchedUserRequest; -pub mod patched_user_saml_source_connection_request; -pub use self::patched_user_saml_source_connection_request::PatchedUserSamlSourceConnectionRequest; -pub mod patched_user_source_connection_request; -pub use self::patched_user_source_connection_request::PatchedUserSourceConnectionRequest; -pub mod patched_user_telegram_source_connection_request; -pub use self::patched_user_telegram_source_connection_request::PatchedUserTelegramSourceConnectionRequest; -pub mod patched_user_write_stage_request; -pub use self::patched_user_write_stage_request::PatchedUserWriteStageRequest; -pub mod patched_web_authn_device_request; -pub use self::patched_web_authn_device_request::PatchedWebAuthnDeviceRequest; -pub mod patched_ws_federation_provider_request; -pub use self::patched_ws_federation_provider_request::PatchedWsFederationProviderRequest; -pub mod permission; -pub use self::permission::Permission; -pub mod permission_assign_request; -pub use self::permission_assign_request::PermissionAssignRequest; -pub mod permission_assign_result; -pub use self::permission_assign_result::PermissionAssignResult; -pub mod pkce_method_enum; -pub use self::pkce_method_enum::PkceMethodEnum; pub mod plex_authentication_challenge; pub use self::plex_authentication_challenge::PlexAuthenticationChallenge; pub mod plex_authentication_challenge_response_request; pub use self::plex_authentication_challenge_response_request::PlexAuthenticationChallengeResponseRequest; -pub mod plex_source; -pub use self::plex_source::PlexSource; -pub mod plex_source_property_mapping; -pub use self::plex_source_property_mapping::PlexSourcePropertyMapping; -pub mod plex_source_property_mapping_request; -pub use self::plex_source_property_mapping_request::PlexSourcePropertyMappingRequest; -pub mod plex_source_request; -pub use self::plex_source_request::PlexSourceRequest; -pub mod plex_token_redeem_request; -pub use self::plex_token_redeem_request::PlexTokenRedeemRequest; -pub mod policy; -pub use self::policy::Policy; -pub mod policy_binding; -pub use self::policy_binding::PolicyBinding; -pub mod policy_binding_request; -pub use self::policy_binding_request::PolicyBindingRequest; -pub mod policy_engine_mode; -pub use self::policy_engine_mode::PolicyEngineMode; -pub mod policy_test_request; -pub use self::policy_test_request::PolicyTestRequest; pub mod policy_test_result; pub use self::policy_test_result::PolicyTestResult; -pub mod process; -pub use self::process::Process; -pub mod process_request; -pub use self::process_request::ProcessRequest; -pub mod prompt; -pub use self::prompt::Prompt; pub mod prompt_challenge; pub use self::prompt_challenge::PromptChallenge; pub mod prompt_challenge_response_request; pub use self::prompt_challenge_response_request::PromptChallengeResponseRequest; pub mod prompt_choice; pub use self::prompt_choice::PromptChoice; -pub mod prompt_request; -pub use self::prompt_request::PromptRequest; -pub mod prompt_stage; -pub use self::prompt_stage::PromptStage; -pub mod prompt_stage_request; -pub use self::prompt_stage_request::PromptStageRequest; pub mod prompt_type_enum; pub use self::prompt_type_enum::PromptTypeEnum; -pub mod property_mapping; -pub use self::property_mapping::PropertyMapping; -pub mod property_mapping_preview; -pub use self::property_mapping_preview::PropertyMappingPreview; -pub mod property_mapping_test_request; -pub use self::property_mapping_test_request::PropertyMappingTestRequest; -pub mod property_mapping_test_result; -pub use self::property_mapping_test_result::PropertyMappingTestResult; -pub mod protocol_enum; -pub use self::protocol_enum::ProtocolEnum; pub mod provider; pub use self::provider::Provider; -pub mod provider_enum; -pub use self::provider_enum::ProviderEnum; -pub mod provider_model_enum; -pub use self::provider_model_enum::ProviderModelEnum; -pub mod provider_type_enum; -pub use self::provider_type_enum::ProviderTypeEnum; pub mod proxy_mode; pub use self::proxy_mode::ProxyMode; pub mod proxy_outpost_config; pub use self::proxy_outpost_config::ProxyOutpostConfig; -pub mod proxy_provider; -pub use self::proxy_provider::ProxyProvider; -pub mod proxy_provider_request; -pub use self::proxy_provider_request::ProxyProviderRequest; -pub mod rac_property_mapping; -pub use self::rac_property_mapping::RacPropertyMapping; -pub mod rac_property_mapping_request; -pub use self::rac_property_mapping_request::RacPropertyMappingRequest; -pub mod rac_provider; -pub use self::rac_provider::RacProvider; -pub mod rac_provider_request; -pub use self::rac_provider_request::RacProviderRequest; pub mod radius_check_access; pub use self::radius_check_access::RadiusCheckAccess; pub mod radius_outpost_config; pub use self::radius_outpost_config::RadiusOutpostConfig; -pub mod radius_provider; -pub use self::radius_provider::RadiusProvider; -pub mod radius_provider_property_mapping; -pub use self::radius_provider_property_mapping::RadiusProviderPropertyMapping; -pub mod radius_provider_property_mapping_request; -pub use self::radius_provider_property_mapping_request::RadiusProviderPropertyMappingRequest; -pub mod radius_provider_request; -pub use self::radius_provider_request::RadiusProviderRequest; pub mod redirect_challenge; pub use self::redirect_challenge::RedirectChallenge; pub mod redirect_challenge_response_request; pub use self::redirect_challenge_response_request::RedirectChallengeResponseRequest; -pub mod redirect_stage; -pub use self::redirect_stage::RedirectStage; -pub mod redirect_stage_mode_enum; -pub use self::redirect_stage_mode_enum::RedirectStageModeEnum; -pub mod redirect_stage_request; -pub use self::redirect_stage_request::RedirectStageRequest; -pub mod redirect_uri; -pub use self::redirect_uri::RedirectUri; -pub mod redirect_uri_request; -pub use self::redirect_uri_request::RedirectUriRequest; -pub mod redirect_uri_type_enum; -pub use self::redirect_uri_type_enum::RedirectUriTypeEnum; pub mod related_group; pub use self::related_group::RelatedGroup; -pub mod reputation; -pub use self::reputation::Reputation; -pub mod reputation_policy; -pub use self::reputation_policy::ReputationPolicy; -pub mod reputation_policy_request; -pub use self::reputation_policy_request::ReputationPolicyRequest; -pub mod review; -pub use self::review::Review; -pub mod review_request; -pub use self::review_request::ReviewRequest; -pub mod reviewer_group; -pub use self::reviewer_group::ReviewerGroup; -pub mod reviewer_user; -pub use self::reviewer_user::ReviewerUser; pub mod role; pub use self::role::Role; -pub mod role_assigned_object_permission; -pub use self::role_assigned_object_permission::RoleAssignedObjectPermission; -pub mod role_model_permission; -pub use self::role_model_permission::RoleModelPermission; -pub mod role_object_permission; -pub use self::role_object_permission::RoleObjectPermission; -pub mod role_request; -pub use self::role_request::RoleRequest; pub mod saml_bindings_enum; pub use self::saml_bindings_enum::SamlBindingsEnum; -pub mod saml_logout_methods; -pub use self::saml_logout_methods::SamlLogoutMethods; -pub mod saml_metadata; -pub use self::saml_metadata::SamlMetadata; -pub mod saml_name_id_policy_enum; -pub use self::saml_name_id_policy_enum::SamlNameIdPolicyEnum; -pub mod saml_property_mapping; -pub use self::saml_property_mapping::SamlPropertyMapping; -pub mod saml_property_mapping_request; -pub use self::saml_property_mapping_request::SamlPropertyMappingRequest; -pub mod saml_provider; -pub use self::saml_provider::SamlProvider; -pub mod saml_provider_request; -pub use self::saml_provider_request::SamlProviderRequest; -pub mod saml_source; -pub use self::saml_source::SamlSource; -pub mod saml_source_property_mapping; -pub use self::saml_source_property_mapping::SamlSourcePropertyMapping; -pub mod saml_source_property_mapping_request; -pub use self::saml_source_property_mapping_request::SamlSourcePropertyMappingRequest; -pub mod saml_source_request; -pub use self::saml_source_request::SamlSourceRequest; -pub mod schedule; -pub use self::schedule::Schedule; -pub mod schedule_request; -pub use self::schedule_request::ScheduleRequest; -pub mod scim_authentication_mode_enum; -pub use self::scim_authentication_mode_enum::ScimAuthenticationModeEnum; -pub mod scim_mapping; -pub use self::scim_mapping::ScimMapping; -pub mod scim_mapping_request; -pub use self::scim_mapping_request::ScimMappingRequest; -pub mod scim_provider; -pub use self::scim_provider::ScimProvider; -pub mod scim_provider_group; -pub use self::scim_provider_group::ScimProviderGroup; -pub mod scim_provider_group_request; -pub use self::scim_provider_group_request::ScimProviderGroupRequest; -pub mod scim_provider_request; -pub use self::scim_provider_request::ScimProviderRequest; -pub mod scim_provider_user; -pub use self::scim_provider_user::ScimProviderUser; -pub mod scim_provider_user_request; -pub use self::scim_provider_user_request::ScimProviderUserRequest; -pub mod scim_source; -pub use self::scim_source::ScimSource; -pub mod scim_source_group; -pub use self::scim_source_group::ScimSourceGroup; -pub mod scim_source_group_request; -pub use self::scim_source_group_request::ScimSourceGroupRequest; -pub mod scim_source_property_mapping; -pub use self::scim_source_property_mapping::ScimSourcePropertyMapping; -pub mod scim_source_property_mapping_request; -pub use self::scim_source_property_mapping_request::ScimSourcePropertyMappingRequest; -pub mod scim_source_request; -pub use self::scim_source_request::ScimSourceRequest; -pub mod scim_source_user; -pub use self::scim_source_user::ScimSourceUser; -pub mod scim_source_user_request; -pub use self::scim_source_user_request::ScimSourceUserRequest; -pub mod scope_mapping; -pub use self::scope_mapping::ScopeMapping; -pub mod scope_mapping_request; -pub use self::scope_mapping_request::ScopeMappingRequest; pub mod selectable_stage; pub use self::selectable_stage::SelectableStage; pub mod service_connection; pub use self::service_connection::ServiceConnection; -pub mod service_connection_state; -pub use self::service_connection_state::ServiceConnectionState; pub mod session_end_challenge; pub use self::session_end_challenge::SessionEndChallenge; pub mod session_user; pub use self::session_user::SessionUser; -pub mod settings; -pub use self::settings::Settings; -pub mod settings_request; -pub use self::settings_request::SettingsRequest; -pub mod severity_enum; -pub use self::severity_enum::SeverityEnum; pub mod shell_challenge; pub use self::shell_challenge::ShellChallenge; -pub mod signature_algorithm_enum; -pub use self::signature_algorithm_enum::SignatureAlgorithmEnum; -pub mod sms_device; -pub use self::sms_device::SmsDevice; -pub mod sms_device_request; -pub use self::sms_device_request::SmsDeviceRequest; -pub mod software; -pub use self::software::Software; -pub mod software_request; -pub use self::software_request::SoftwareRequest; -pub mod source; -pub use self::source::Source; -pub mod source_stage; -pub use self::source_stage::SourceStage; -pub mod source_stage_request; -pub use self::source_stage_request::SourceStageRequest; -pub mod source_type; -pub use self::source_type::SourceType; -pub mod ssf_provider; -pub use self::ssf_provider::SsfProvider; -pub mod ssf_provider_request; -pub use self::ssf_provider_request::SsfProviderRequest; -pub mod ssf_stream; -pub use self::ssf_stream::SsfStream; -pub mod ssf_stream_status_enum; -pub use self::ssf_stream_status_enum::SsfStreamStatusEnum; -pub mod stage; -pub use self::stage::Stage; -pub mod stage_mode_enum; -pub use self::stage_mode_enum::StageModeEnum; pub mod stage_prompt; pub use self::stage_prompt::StagePrompt; -pub mod static_device; -pub use self::static_device::StaticDevice; -pub mod static_device_request; -pub use self::static_device_request::StaticDeviceRequest; -pub mod static_device_token; -pub use self::static_device_token::StaticDeviceToken; -pub mod sub_mode_enum; -pub use self::sub_mode_enum::SubModeEnum; -pub mod sync_object_model_enum; -pub use self::sync_object_model_enum::SyncObjectModelEnum; -pub mod sync_object_request; -pub use self::sync_object_request::SyncObjectRequest; -pub mod sync_object_result; -pub use self::sync_object_result::SyncObjectResult; -pub mod sync_outgoing_trigger_mode_enum; -pub use self::sync_outgoing_trigger_mode_enum::SyncOutgoingTriggerModeEnum; -pub mod sync_status; -pub use self::sync_status::SyncStatus; -pub mod system_info; -pub use self::system_info::SystemInfo; -pub mod system_info_runtime; -pub use self::system_info_runtime::SystemInfoRuntime; -pub mod task; -pub use self::task::Task; -pub mod task_aggregated_status_enum; -pub use self::task_aggregated_status_enum::TaskAggregatedStatusEnum; -pub mod task_status_enum; -pub use self::task_status_enum::TaskStatusEnum; -pub mod telegram_auth_request; -pub use self::telegram_auth_request::TelegramAuthRequest; pub mod telegram_challenge_response_request; pub use self::telegram_challenge_response_request::TelegramChallengeResponseRequest; pub mod telegram_login_challenge; pub use self::telegram_login_challenge::TelegramLoginChallenge; -pub mod telegram_source; -pub use self::telegram_source::TelegramSource; -pub mod telegram_source_property_mapping; -pub use self::telegram_source_property_mapping::TelegramSourcePropertyMapping; -pub mod telegram_source_property_mapping_request; -pub use self::telegram_source_property_mapping_request::TelegramSourcePropertyMappingRequest; -pub mod telegram_source_request; -pub use self::telegram_source_request::TelegramSourceRequest; -pub mod tenant; -pub use self::tenant::Tenant; -pub mod tenant_admin_group_request_request; -pub use self::tenant_admin_group_request_request::TenantAdminGroupRequestRequest; -pub mod tenant_recovery_key_request_request; -pub use self::tenant_recovery_key_request_request::TenantRecoveryKeyRequestRequest; -pub mod tenant_recovery_key_response; -pub use self::tenant_recovery_key_response::TenantRecoveryKeyResponse; -pub mod tenant_request; -pub use self::tenant_request::TenantRequest; pub mod themed_urls; pub use self::themed_urls::ThemedUrls; -pub mod token; -pub use self::token::Token; -pub mod token_model; -pub use self::token_model::TokenModel; -pub mod token_request; -pub use self::token_request::TokenRequest; -pub mod token_set_key_request; -pub use self::token_set_key_request::TokenSetKeyRequest; -pub mod token_view; -pub use self::token_view::TokenView; -pub mod totp_device; -pub use self::totp_device::TotpDevice; -pub mod totp_device_request; -pub use self::totp_device_request::TotpDeviceRequest; -pub mod transaction_application_request; -pub use self::transaction_application_request::TransactionApplicationRequest; -pub mod transaction_application_response; -pub use self::transaction_application_response::TransactionApplicationResponse; -pub mod transaction_policy_binding_request; -pub use self::transaction_policy_binding_request::TransactionPolicyBindingRequest; -pub mod transport_mode_enum; -pub use self::transport_mode_enum::TransportModeEnum; -pub mod type_create; -pub use self::type_create::TypeCreate; -pub mod ui_theme_enum; -pub use self::ui_theme_enum::UiThemeEnum; -pub mod unique_password_policy; -pub use self::unique_password_policy::UniquePasswordPolicy; -pub mod unique_password_policy_request; -pub use self::unique_password_policy_request::UniquePasswordPolicyRequest; -pub mod usage_enum; -pub use self::usage_enum::UsageEnum; -pub mod used_by; -pub use self::used_by::UsedBy; -pub mod used_by_action_enum; -pub use self::used_by_action_enum::UsedByActionEnum; pub mod user; pub use self::user::User; -pub mod user_account_request; -pub use self::user_account_request::UserAccountRequest; -pub mod user_account_serializer_for_role_request; -pub use self::user_account_serializer_for_role_request::UserAccountSerializerForRoleRequest; -pub mod user_attribute_enum; -pub use self::user_attribute_enum::UserAttributeEnum; -pub mod user_consent; -pub use self::user_consent::UserConsent; -pub mod user_creation_mode_enum; -pub use self::user_creation_mode_enum::UserCreationModeEnum; -pub mod user_delete_stage; -pub use self::user_delete_stage::UserDeleteStage; -pub mod user_delete_stage_request; -pub use self::user_delete_stage_request::UserDeleteStageRequest; -pub mod user_fields_enum; -pub use self::user_fields_enum::UserFieldsEnum; -pub mod user_kerberos_source_connection; -pub use self::user_kerberos_source_connection::UserKerberosSourceConnection; -pub mod user_kerberos_source_connection_request; -pub use self::user_kerberos_source_connection_request::UserKerberosSourceConnectionRequest; -pub mod user_ldap_source_connection; -pub use self::user_ldap_source_connection::UserLdapSourceConnection; -pub mod user_ldap_source_connection_request; -pub use self::user_ldap_source_connection_request::UserLdapSourceConnectionRequest; pub mod user_login_challenge; pub use self::user_login_challenge::UserLoginChallenge; pub mod user_login_challenge_response_request; pub use self::user_login_challenge_response_request::UserLoginChallengeResponseRequest; -pub mod user_login_stage; -pub use self::user_login_stage::UserLoginStage; -pub mod user_login_stage_request; -pub use self::user_login_stage_request::UserLoginStageRequest; -pub mod user_logout_stage; -pub use self::user_logout_stage::UserLogoutStage; -pub mod user_logout_stage_request; -pub use self::user_logout_stage_request::UserLogoutStageRequest; -pub mod user_matching_mode_enum; -pub use self::user_matching_mode_enum::UserMatchingModeEnum; -pub mod user_o_auth_source_connection; -pub use self::user_o_auth_source_connection::UserOAuthSourceConnection; -pub mod user_o_auth_source_connection_request; -pub use self::user_o_auth_source_connection_request::UserOAuthSourceConnectionRequest; -pub mod user_password_set_request; -pub use self::user_password_set_request::UserPasswordSetRequest; -pub mod user_path; -pub use self::user_path::UserPath; -pub mod user_plex_source_connection; -pub use self::user_plex_source_connection::UserPlexSourceConnection; -pub mod user_plex_source_connection_request; -pub use self::user_plex_source_connection_request::UserPlexSourceConnectionRequest; -pub mod user_recovery_email_request; -pub use self::user_recovery_email_request::UserRecoveryEmailRequest; -pub mod user_recovery_link_request; -pub use self::user_recovery_link_request::UserRecoveryLinkRequest; -pub mod user_request; -pub use self::user_request::UserRequest; -pub mod user_saml_source_connection; -pub use self::user_saml_source_connection::UserSamlSourceConnection; -pub mod user_saml_source_connection_request; -pub use self::user_saml_source_connection_request::UserSamlSourceConnectionRequest; pub mod user_self; pub use self::user_self::UserSelf; pub mod user_self_groups; pub use self::user_self_groups::UserSelfGroups; pub mod user_self_roles; pub use self::user_self_roles::UserSelfRoles; -pub mod user_service_account_request; -pub use self::user_service_account_request::UserServiceAccountRequest; -pub mod user_service_account_response; -pub use self::user_service_account_response::UserServiceAccountResponse; -pub mod user_setting; -pub use self::user_setting::UserSetting; -pub mod user_source_connection; -pub use self::user_source_connection::UserSourceConnection; -pub mod user_source_connection_request; -pub use self::user_source_connection_request::UserSourceConnectionRequest; -pub mod user_telegram_source_connection; -pub use self::user_telegram_source_connection::UserTelegramSourceConnection; -pub mod user_telegram_source_connection_request; -pub use self::user_telegram_source_connection_request::UserTelegramSourceConnectionRequest; pub mod user_type_enum; pub use self::user_type_enum::UserTypeEnum; -pub mod user_verification_enum; -pub use self::user_verification_enum::UserVerificationEnum; -pub mod user_write_stage; -pub use self::user_write_stage::UserWriteStage; -pub mod user_write_stage_request; -pub use self::user_write_stage_request::UserWriteStageRequest; pub mod validation_error; pub use self::validation_error::ValidationError; -pub mod vendor_enum; -pub use self::vendor_enum::VendorEnum; -pub mod version; -pub use self::version::Version; -pub mod version_history; -pub use self::version_history::VersionHistory; -pub mod web_authn_device; -pub use self::web_authn_device::WebAuthnDevice; -pub mod web_authn_device_request; -pub use self::web_authn_device_request::WebAuthnDeviceRequest; -pub mod web_authn_device_type; -pub use self::web_authn_device_type::WebAuthnDeviceType; -pub mod web_authn_hint_enum; -pub use self::web_authn_hint_enum::WebAuthnHintEnum; -pub mod worker; -pub use self::worker::Worker; -pub mod ws_federation_provider; -pub use self::ws_federation_provider::WsFederationProvider; -pub mod ws_federation_provider_request; -pub use self::ws_federation_provider_request::WsFederationProviderRequest; diff --git a/packages/client-rust/src/models/model_enum.rs b/packages/client-rust/src/models/model_enum.rs deleted file mode 100644 index ed2a7e2f08..0000000000 --- a/packages/client-rust/src/models/model_enum.rs +++ /dev/null @@ -1,595 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// -#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] -pub enum ModelEnum { - #[serde(rename = "authentik_tenants.domain")] - AuthentikTenantsDomain, - #[serde(rename = "authentik_core.group")] - AuthentikCoreGroup, - #[serde(rename = "authentik_core.user")] - AuthentikCoreUser, - #[serde(rename = "authentik_core.application")] - AuthentikCoreApplication, - #[serde(rename = "authentik_core.applicationentitlement")] - AuthentikCoreApplicationentitlement, - #[serde(rename = "authentik_core.token")] - AuthentikCoreToken, - #[serde(rename = "authentik_crypto.certificatekeypair")] - AuthentikCryptoCertificatekeypair, - #[serde(rename = "authentik_endpoints.deviceuserbinding")] - AuthentikEndpointsDeviceuserbinding, - #[serde(rename = "authentik_endpoints.deviceaccessgroup")] - AuthentikEndpointsDeviceaccessgroup, - #[serde(rename = "authentik_endpoints.endpointstage")] - AuthentikEndpointsEndpointstage, - #[serde(rename = "authentik_endpoints_connectors_agent.agentconnector")] - AuthentikEndpointsConnectorsAgentAgentconnector, - #[serde(rename = "authentik_endpoints_connectors_agent.agentdeviceuserbinding")] - AuthentikEndpointsConnectorsAgentAgentdeviceuserbinding, - #[serde(rename = "authentik_endpoints_connectors_agent.enrollmenttoken")] - AuthentikEndpointsConnectorsAgentEnrollmenttoken, - #[serde(rename = "authentik_enterprise.license")] - AuthentikEnterpriseLicense, - #[serde(rename = "authentik_events.event")] - AuthentikEventsEvent, - #[serde(rename = "authentik_events.notificationtransport")] - AuthentikEventsNotificationtransport, - #[serde(rename = "authentik_events.notification")] - AuthentikEventsNotification, - #[serde(rename = "authentik_events.notificationrule")] - AuthentikEventsNotificationrule, - #[serde(rename = "authentik_events.notificationwebhookmapping")] - AuthentikEventsNotificationwebhookmapping, - #[serde(rename = "authentik_flows.flow")] - AuthentikFlowsFlow, - #[serde(rename = "authentik_flows.flowstagebinding")] - AuthentikFlowsFlowstagebinding, - #[serde(rename = "authentik_outposts.dockerserviceconnection")] - AuthentikOutpostsDockerserviceconnection, - #[serde(rename = "authentik_outposts.kubernetesserviceconnection")] - AuthentikOutpostsKubernetesserviceconnection, - #[serde(rename = "authentik_outposts.outpost")] - AuthentikOutpostsOutpost, - #[serde(rename = "authentik_policies_dummy.dummypolicy")] - AuthentikPoliciesDummyDummypolicy, - #[serde(rename = "authentik_policies_event_matcher.eventmatcherpolicy")] - AuthentikPoliciesEventMatcherEventmatcherpolicy, - #[serde(rename = "authentik_policies_expiry.passwordexpirypolicy")] - AuthentikPoliciesExpiryPasswordexpirypolicy, - #[serde(rename = "authentik_policies_expression.expressionpolicy")] - AuthentikPoliciesExpressionExpressionpolicy, - #[serde(rename = "authentik_policies_geoip.geoippolicy")] - AuthentikPoliciesGeoipGeoippolicy, - #[serde(rename = "authentik_policies_password.passwordpolicy")] - AuthentikPoliciesPasswordPasswordpolicy, - #[serde(rename = "authentik_policies_reputation.reputationpolicy")] - AuthentikPoliciesReputationReputationpolicy, - #[serde(rename = "authentik_policies.policybinding")] - AuthentikPoliciesPolicybinding, - #[serde(rename = "authentik_providers_ldap.ldapprovider")] - AuthentikProvidersLdapLdapprovider, - #[serde(rename = "authentik_providers_oauth2.scopemapping")] - AuthentikProvidersOauth2Scopemapping, - #[serde(rename = "authentik_providers_oauth2.oauth2provider")] - AuthentikProvidersOauth2Oauth2provider, - #[serde(rename = "authentik_providers_proxy.proxyprovider")] - AuthentikProvidersProxyProxyprovider, - #[serde(rename = "authentik_providers_rac.racprovider")] - AuthentikProvidersRacRacprovider, - #[serde(rename = "authentik_providers_rac.endpoint")] - AuthentikProvidersRacEndpoint, - #[serde(rename = "authentik_providers_rac.racpropertymapping")] - AuthentikProvidersRacRacpropertymapping, - #[serde(rename = "authentik_providers_radius.radiusprovider")] - AuthentikProvidersRadiusRadiusprovider, - #[serde(rename = "authentik_providers_radius.radiusproviderpropertymapping")] - AuthentikProvidersRadiusRadiusproviderpropertymapping, - #[serde(rename = "authentik_providers_saml.samlprovider")] - AuthentikProvidersSamlSamlprovider, - #[serde(rename = "authentik_providers_saml.samlpropertymapping")] - AuthentikProvidersSamlSamlpropertymapping, - #[serde(rename = "authentik_providers_scim.scimprovider")] - AuthentikProvidersScimScimprovider, - #[serde(rename = "authentik_providers_scim.scimmapping")] - AuthentikProvidersScimScimmapping, - #[serde(rename = "authentik_rbac.role")] - AuthentikRbacRole, - #[serde(rename = "authentik_rbac.initialpermissions")] - AuthentikRbacInitialpermissions, - #[serde(rename = "authentik_sources_kerberos.kerberossource")] - AuthentikSourcesKerberosKerberossource, - #[serde(rename = "authentik_sources_kerberos.kerberossourcepropertymapping")] - AuthentikSourcesKerberosKerberossourcepropertymapping, - #[serde(rename = "authentik_sources_kerberos.userkerberossourceconnection")] - AuthentikSourcesKerberosUserkerberossourceconnection, - #[serde(rename = "authentik_sources_kerberos.groupkerberossourceconnection")] - AuthentikSourcesKerberosGroupkerberossourceconnection, - #[serde(rename = "authentik_sources_ldap.ldapsource")] - AuthentikSourcesLdapLdapsource, - #[serde(rename = "authentik_sources_ldap.ldapsourcepropertymapping")] - AuthentikSourcesLdapLdapsourcepropertymapping, - #[serde(rename = "authentik_sources_ldap.userldapsourceconnection")] - AuthentikSourcesLdapUserldapsourceconnection, - #[serde(rename = "authentik_sources_ldap.groupldapsourceconnection")] - AuthentikSourcesLdapGroupldapsourceconnection, - #[serde(rename = "authentik_sources_oauth.oauthsource")] - AuthentikSourcesOauthOauthsource, - #[serde(rename = "authentik_sources_oauth.oauthsourcepropertymapping")] - AuthentikSourcesOauthOauthsourcepropertymapping, - #[serde(rename = "authentik_sources_oauth.useroauthsourceconnection")] - AuthentikSourcesOauthUseroauthsourceconnection, - #[serde(rename = "authentik_sources_oauth.groupoauthsourceconnection")] - AuthentikSourcesOauthGroupoauthsourceconnection, - #[serde(rename = "authentik_sources_plex.plexsource")] - AuthentikSourcesPlexPlexsource, - #[serde(rename = "authentik_sources_plex.plexsourcepropertymapping")] - AuthentikSourcesPlexPlexsourcepropertymapping, - #[serde(rename = "authentik_sources_plex.userplexsourceconnection")] - AuthentikSourcesPlexUserplexsourceconnection, - #[serde(rename = "authentik_sources_plex.groupplexsourceconnection")] - AuthentikSourcesPlexGroupplexsourceconnection, - #[serde(rename = "authentik_sources_saml.samlsource")] - AuthentikSourcesSamlSamlsource, - #[serde(rename = "authentik_sources_saml.samlsourcepropertymapping")] - AuthentikSourcesSamlSamlsourcepropertymapping, - #[serde(rename = "authentik_sources_saml.usersamlsourceconnection")] - AuthentikSourcesSamlUsersamlsourceconnection, - #[serde(rename = "authentik_sources_saml.groupsamlsourceconnection")] - AuthentikSourcesSamlGroupsamlsourceconnection, - #[serde(rename = "authentik_sources_scim.scimsource")] - AuthentikSourcesScimScimsource, - #[serde(rename = "authentik_sources_scim.scimsourcepropertymapping")] - AuthentikSourcesScimScimsourcepropertymapping, - #[serde(rename = "authentik_sources_telegram.telegramsource")] - AuthentikSourcesTelegramTelegramsource, - #[serde(rename = "authentik_sources_telegram.telegramsourcepropertymapping")] - AuthentikSourcesTelegramTelegramsourcepropertymapping, - #[serde(rename = "authentik_sources_telegram.usertelegramsourceconnection")] - AuthentikSourcesTelegramUsertelegramsourceconnection, - #[serde(rename = "authentik_sources_telegram.grouptelegramsourceconnection")] - AuthentikSourcesTelegramGrouptelegramsourceconnection, - #[serde(rename = "authentik_stages_authenticator_duo.authenticatorduostage")] - AuthentikStagesAuthenticatorDuoAuthenticatorduostage, - #[serde(rename = "authentik_stages_authenticator_duo.duodevice")] - AuthentikStagesAuthenticatorDuoDuodevice, - #[serde(rename = "authentik_stages_authenticator_email.authenticatoremailstage")] - AuthentikStagesAuthenticatorEmailAuthenticatoremailstage, - #[serde(rename = "authentik_stages_authenticator_email.emaildevice")] - AuthentikStagesAuthenticatorEmailEmaildevice, - #[serde(rename = "authentik_stages_authenticator_sms.authenticatorsmsstage")] - AuthentikStagesAuthenticatorSmsAuthenticatorsmsstage, - #[serde(rename = "authentik_stages_authenticator_sms.smsdevice")] - AuthentikStagesAuthenticatorSmsSmsdevice, - #[serde(rename = "authentik_stages_authenticator_static.authenticatorstaticstage")] - AuthentikStagesAuthenticatorStaticAuthenticatorstaticstage, - #[serde(rename = "authentik_stages_authenticator_static.staticdevice")] - AuthentikStagesAuthenticatorStaticStaticdevice, - #[serde(rename = "authentik_stages_authenticator_totp.authenticatortotpstage")] - AuthentikStagesAuthenticatorTotpAuthenticatortotpstage, - #[serde(rename = "authentik_stages_authenticator_totp.totpdevice")] - AuthentikStagesAuthenticatorTotpTotpdevice, - #[serde(rename = "authentik_stages_authenticator_validate.authenticatorvalidatestage")] - AuthentikStagesAuthenticatorValidateAuthenticatorvalidatestage, - #[serde(rename = "authentik_stages_authenticator_webauthn.authenticatorwebauthnstage")] - AuthentikStagesAuthenticatorWebauthnAuthenticatorwebauthnstage, - #[serde(rename = "authentik_stages_authenticator_webauthn.webauthndevice")] - AuthentikStagesAuthenticatorWebauthnWebauthndevice, - #[serde(rename = "authentik_stages_captcha.captchastage")] - AuthentikStagesCaptchaCaptchastage, - #[serde(rename = "authentik_stages_consent.consentstage")] - AuthentikStagesConsentConsentstage, - #[serde(rename = "authentik_stages_deny.denystage")] - AuthentikStagesDenyDenystage, - #[serde(rename = "authentik_stages_dummy.dummystage")] - AuthentikStagesDummyDummystage, - #[serde(rename = "authentik_stages_email.emailstage")] - AuthentikStagesEmailEmailstage, - #[serde(rename = "authentik_stages_identification.identificationstage")] - AuthentikStagesIdentificationIdentificationstage, - #[serde(rename = "authentik_stages_invitation.invitationstage")] - AuthentikStagesInvitationInvitationstage, - #[serde(rename = "authentik_stages_invitation.invitation")] - AuthentikStagesInvitationInvitation, - #[serde(rename = "authentik_stages_password.passwordstage")] - AuthentikStagesPasswordPasswordstage, - #[serde(rename = "authentik_stages_prompt.prompt")] - AuthentikStagesPromptPrompt, - #[serde(rename = "authentik_stages_prompt.promptstage")] - AuthentikStagesPromptPromptstage, - #[serde(rename = "authentik_stages_redirect.redirectstage")] - AuthentikStagesRedirectRedirectstage, - #[serde(rename = "authentik_stages_user_delete.userdeletestage")] - AuthentikStagesUserDeleteUserdeletestage, - #[serde(rename = "authentik_stages_user_login.userloginstage")] - AuthentikStagesUserLoginUserloginstage, - #[serde(rename = "authentik_stages_user_logout.userlogoutstage")] - AuthentikStagesUserLogoutUserlogoutstage, - #[serde(rename = "authentik_stages_user_write.userwritestage")] - AuthentikStagesUserWriteUserwritestage, - #[serde(rename = "authentik_tasks_schedules.schedule")] - AuthentikTasksSchedulesSchedule, - #[serde(rename = "authentik_brands.brand")] - AuthentikBrandsBrand, - #[serde(rename = "authentik_blueprints.blueprintinstance")] - AuthentikBlueprintsBlueprintinstance, - #[serde(rename = "authentik_endpoints_connectors_fleet.fleetconnector")] - AuthentikEndpointsConnectorsFleetFleetconnector, - #[serde(rename = "authentik_endpoints_connectors_google_chrome.googlechromeconnector")] - AuthentikEndpointsConnectorsGoogleChromeGooglechromeconnector, - #[serde(rename = "authentik_lifecycle.lifecyclerule")] - AuthentikLifecycleLifecyclerule, - #[serde(rename = "authentik_lifecycle.lifecycleiteration")] - AuthentikLifecycleLifecycleiteration, - #[serde(rename = "authentik_lifecycle.review")] - AuthentikLifecycleReview, - #[serde(rename = "authentik_policies_unique_password.uniquepasswordpolicy")] - AuthentikPoliciesUniquePasswordUniquepasswordpolicy, - #[serde(rename = "authentik_providers_google_workspace.googleworkspaceprovider")] - AuthentikProvidersGoogleWorkspaceGoogleworkspaceprovider, - #[serde(rename = "authentik_providers_google_workspace.googleworkspaceprovidermapping")] - AuthentikProvidersGoogleWorkspaceGoogleworkspaceprovidermapping, - #[serde(rename = "authentik_providers_microsoft_entra.microsoftentraprovider")] - AuthentikProvidersMicrosoftEntraMicrosoftentraprovider, - #[serde(rename = "authentik_providers_microsoft_entra.microsoftentraprovidermapping")] - AuthentikProvidersMicrosoftEntraMicrosoftentraprovidermapping, - #[serde(rename = "authentik_providers_ssf.ssfprovider")] - AuthentikProvidersSsfSsfprovider, - #[serde(rename = "authentik_providers_ws_federation.wsfederationprovider")] - AuthentikProvidersWsFederationWsfederationprovider, - #[serde(rename = "authentik_reports.dataexport")] - AuthentikReportsDataexport, - #[serde(rename = "authentik_stages_authenticator_endpoint_gdtc.authenticatorendpointgdtcstage")] - AuthentikStagesAuthenticatorEndpointGdtcAuthenticatorendpointgdtcstage, - #[serde(rename = "authentik_stages_mtls.mutualtlsstage")] - AuthentikStagesMtlsMutualtlsstage, - #[serde(rename = "authentik_stages_source.sourcestage")] - AuthentikStagesSourceSourcestage, -} - -impl std::fmt::Display for ModelEnum { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - match self { - Self::AuthentikTenantsDomain => write!(f, "authentik_tenants.domain"), - Self::AuthentikCoreGroup => write!(f, "authentik_core.group"), - Self::AuthentikCoreUser => write!(f, "authentik_core.user"), - Self::AuthentikCoreApplication => write!(f, "authentik_core.application"), - Self::AuthentikCoreApplicationentitlement => { - write!(f, "authentik_core.applicationentitlement") - } - Self::AuthentikCoreToken => write!(f, "authentik_core.token"), - Self::AuthentikCryptoCertificatekeypair => { - write!(f, "authentik_crypto.certificatekeypair") - } - Self::AuthentikEndpointsDeviceuserbinding => { - write!(f, "authentik_endpoints.deviceuserbinding") - } - Self::AuthentikEndpointsDeviceaccessgroup => { - write!(f, "authentik_endpoints.deviceaccessgroup") - } - Self::AuthentikEndpointsEndpointstage => write!(f, "authentik_endpoints.endpointstage"), - Self::AuthentikEndpointsConnectorsAgentAgentconnector => { - write!(f, "authentik_endpoints_connectors_agent.agentconnector") - } - Self::AuthentikEndpointsConnectorsAgentAgentdeviceuserbinding => write!( - f, - "authentik_endpoints_connectors_agent.agentdeviceuserbinding" - ), - Self::AuthentikEndpointsConnectorsAgentEnrollmenttoken => { - write!(f, "authentik_endpoints_connectors_agent.enrollmenttoken") - } - Self::AuthentikEnterpriseLicense => write!(f, "authentik_enterprise.license"), - Self::AuthentikEventsEvent => write!(f, "authentik_events.event"), - Self::AuthentikEventsNotificationtransport => { - write!(f, "authentik_events.notificationtransport") - } - Self::AuthentikEventsNotification => write!(f, "authentik_events.notification"), - Self::AuthentikEventsNotificationrule => write!(f, "authentik_events.notificationrule"), - Self::AuthentikEventsNotificationwebhookmapping => { - write!(f, "authentik_events.notificationwebhookmapping") - } - Self::AuthentikFlowsFlow => write!(f, "authentik_flows.flow"), - Self::AuthentikFlowsFlowstagebinding => write!(f, "authentik_flows.flowstagebinding"), - Self::AuthentikOutpostsDockerserviceconnection => { - write!(f, "authentik_outposts.dockerserviceconnection") - } - Self::AuthentikOutpostsKubernetesserviceconnection => { - write!(f, "authentik_outposts.kubernetesserviceconnection") - } - Self::AuthentikOutpostsOutpost => write!(f, "authentik_outposts.outpost"), - Self::AuthentikPoliciesDummyDummypolicy => { - write!(f, "authentik_policies_dummy.dummypolicy") - } - Self::AuthentikPoliciesEventMatcherEventmatcherpolicy => { - write!(f, "authentik_policies_event_matcher.eventmatcherpolicy") - } - Self::AuthentikPoliciesExpiryPasswordexpirypolicy => { - write!(f, "authentik_policies_expiry.passwordexpirypolicy") - } - Self::AuthentikPoliciesExpressionExpressionpolicy => { - write!(f, "authentik_policies_expression.expressionpolicy") - } - Self::AuthentikPoliciesGeoipGeoippolicy => { - write!(f, "authentik_policies_geoip.geoippolicy") - } - Self::AuthentikPoliciesPasswordPasswordpolicy => { - write!(f, "authentik_policies_password.passwordpolicy") - } - Self::AuthentikPoliciesReputationReputationpolicy => { - write!(f, "authentik_policies_reputation.reputationpolicy") - } - Self::AuthentikPoliciesPolicybinding => write!(f, "authentik_policies.policybinding"), - Self::AuthentikProvidersLdapLdapprovider => { - write!(f, "authentik_providers_ldap.ldapprovider") - } - Self::AuthentikProvidersOauth2Scopemapping => { - write!(f, "authentik_providers_oauth2.scopemapping") - } - Self::AuthentikProvidersOauth2Oauth2provider => { - write!(f, "authentik_providers_oauth2.oauth2provider") - } - Self::AuthentikProvidersProxyProxyprovider => { - write!(f, "authentik_providers_proxy.proxyprovider") - } - Self::AuthentikProvidersRacRacprovider => { - write!(f, "authentik_providers_rac.racprovider") - } - Self::AuthentikProvidersRacEndpoint => write!(f, "authentik_providers_rac.endpoint"), - Self::AuthentikProvidersRacRacpropertymapping => { - write!(f, "authentik_providers_rac.racpropertymapping") - } - Self::AuthentikProvidersRadiusRadiusprovider => { - write!(f, "authentik_providers_radius.radiusprovider") - } - Self::AuthentikProvidersRadiusRadiusproviderpropertymapping => write!( - f, - "authentik_providers_radius.radiusproviderpropertymapping" - ), - Self::AuthentikProvidersSamlSamlprovider => { - write!(f, "authentik_providers_saml.samlprovider") - } - Self::AuthentikProvidersSamlSamlpropertymapping => { - write!(f, "authentik_providers_saml.samlpropertymapping") - } - Self::AuthentikProvidersScimScimprovider => { - write!(f, "authentik_providers_scim.scimprovider") - } - Self::AuthentikProvidersScimScimmapping => { - write!(f, "authentik_providers_scim.scimmapping") - } - Self::AuthentikRbacRole => write!(f, "authentik_rbac.role"), - Self::AuthentikRbacInitialpermissions => write!(f, "authentik_rbac.initialpermissions"), - Self::AuthentikSourcesKerberosKerberossource => { - write!(f, "authentik_sources_kerberos.kerberossource") - } - Self::AuthentikSourcesKerberosKerberossourcepropertymapping => write!( - f, - "authentik_sources_kerberos.kerberossourcepropertymapping" - ), - Self::AuthentikSourcesKerberosUserkerberossourceconnection => { - write!(f, "authentik_sources_kerberos.userkerberossourceconnection") - } - Self::AuthentikSourcesKerberosGroupkerberossourceconnection => write!( - f, - "authentik_sources_kerberos.groupkerberossourceconnection" - ), - Self::AuthentikSourcesLdapLdapsource => write!(f, "authentik_sources_ldap.ldapsource"), - Self::AuthentikSourcesLdapLdapsourcepropertymapping => { - write!(f, "authentik_sources_ldap.ldapsourcepropertymapping") - } - Self::AuthentikSourcesLdapUserldapsourceconnection => { - write!(f, "authentik_sources_ldap.userldapsourceconnection") - } - Self::AuthentikSourcesLdapGroupldapsourceconnection => { - write!(f, "authentik_sources_ldap.groupldapsourceconnection") - } - Self::AuthentikSourcesOauthOauthsource => { - write!(f, "authentik_sources_oauth.oauthsource") - } - Self::AuthentikSourcesOauthOauthsourcepropertymapping => { - write!(f, "authentik_sources_oauth.oauthsourcepropertymapping") - } - Self::AuthentikSourcesOauthUseroauthsourceconnection => { - write!(f, "authentik_sources_oauth.useroauthsourceconnection") - } - Self::AuthentikSourcesOauthGroupoauthsourceconnection => { - write!(f, "authentik_sources_oauth.groupoauthsourceconnection") - } - Self::AuthentikSourcesPlexPlexsource => write!(f, "authentik_sources_plex.plexsource"), - Self::AuthentikSourcesPlexPlexsourcepropertymapping => { - write!(f, "authentik_sources_plex.plexsourcepropertymapping") - } - Self::AuthentikSourcesPlexUserplexsourceconnection => { - write!(f, "authentik_sources_plex.userplexsourceconnection") - } - Self::AuthentikSourcesPlexGroupplexsourceconnection => { - write!(f, "authentik_sources_plex.groupplexsourceconnection") - } - Self::AuthentikSourcesSamlSamlsource => write!(f, "authentik_sources_saml.samlsource"), - Self::AuthentikSourcesSamlSamlsourcepropertymapping => { - write!(f, "authentik_sources_saml.samlsourcepropertymapping") - } - Self::AuthentikSourcesSamlUsersamlsourceconnection => { - write!(f, "authentik_sources_saml.usersamlsourceconnection") - } - Self::AuthentikSourcesSamlGroupsamlsourceconnection => { - write!(f, "authentik_sources_saml.groupsamlsourceconnection") - } - Self::AuthentikSourcesScimScimsource => write!(f, "authentik_sources_scim.scimsource"), - Self::AuthentikSourcesScimScimsourcepropertymapping => { - write!(f, "authentik_sources_scim.scimsourcepropertymapping") - } - Self::AuthentikSourcesTelegramTelegramsource => { - write!(f, "authentik_sources_telegram.telegramsource") - } - Self::AuthentikSourcesTelegramTelegramsourcepropertymapping => write!( - f, - "authentik_sources_telegram.telegramsourcepropertymapping" - ), - Self::AuthentikSourcesTelegramUsertelegramsourceconnection => { - write!(f, "authentik_sources_telegram.usertelegramsourceconnection") - } - Self::AuthentikSourcesTelegramGrouptelegramsourceconnection => write!( - f, - "authentik_sources_telegram.grouptelegramsourceconnection" - ), - Self::AuthentikStagesAuthenticatorDuoAuthenticatorduostage => write!( - f, - "authentik_stages_authenticator_duo.authenticatorduostage" - ), - Self::AuthentikStagesAuthenticatorDuoDuodevice => { - write!(f, "authentik_stages_authenticator_duo.duodevice") - } - Self::AuthentikStagesAuthenticatorEmailAuthenticatoremailstage => write!( - f, - "authentik_stages_authenticator_email.authenticatoremailstage" - ), - Self::AuthentikStagesAuthenticatorEmailEmaildevice => { - write!(f, "authentik_stages_authenticator_email.emaildevice") - } - Self::AuthentikStagesAuthenticatorSmsAuthenticatorsmsstage => write!( - f, - "authentik_stages_authenticator_sms.authenticatorsmsstage" - ), - Self::AuthentikStagesAuthenticatorSmsSmsdevice => { - write!(f, "authentik_stages_authenticator_sms.smsdevice") - } - Self::AuthentikStagesAuthenticatorStaticAuthenticatorstaticstage => write!( - f, - "authentik_stages_authenticator_static.authenticatorstaticstage" - ), - Self::AuthentikStagesAuthenticatorStaticStaticdevice => { - write!(f, "authentik_stages_authenticator_static.staticdevice") - } - Self::AuthentikStagesAuthenticatorTotpAuthenticatortotpstage => write!( - f, - "authentik_stages_authenticator_totp.authenticatortotpstage" - ), - Self::AuthentikStagesAuthenticatorTotpTotpdevice => { - write!(f, "authentik_stages_authenticator_totp.totpdevice") - } - Self::AuthentikStagesAuthenticatorValidateAuthenticatorvalidatestage => write!( - f, - "authentik_stages_authenticator_validate.authenticatorvalidatestage" - ), - Self::AuthentikStagesAuthenticatorWebauthnAuthenticatorwebauthnstage => write!( - f, - "authentik_stages_authenticator_webauthn.authenticatorwebauthnstage" - ), - Self::AuthentikStagesAuthenticatorWebauthnWebauthndevice => { - write!(f, "authentik_stages_authenticator_webauthn.webauthndevice") - } - Self::AuthentikStagesCaptchaCaptchastage => { - write!(f, "authentik_stages_captcha.captchastage") - } - Self::AuthentikStagesConsentConsentstage => { - write!(f, "authentik_stages_consent.consentstage") - } - Self::AuthentikStagesDenyDenystage => write!(f, "authentik_stages_deny.denystage"), - Self::AuthentikStagesDummyDummystage => write!(f, "authentik_stages_dummy.dummystage"), - Self::AuthentikStagesEmailEmailstage => write!(f, "authentik_stages_email.emailstage"), - Self::AuthentikStagesIdentificationIdentificationstage => { - write!(f, "authentik_stages_identification.identificationstage") - } - Self::AuthentikStagesInvitationInvitationstage => { - write!(f, "authentik_stages_invitation.invitationstage") - } - Self::AuthentikStagesInvitationInvitation => { - write!(f, "authentik_stages_invitation.invitation") - } - Self::AuthentikStagesPasswordPasswordstage => { - write!(f, "authentik_stages_password.passwordstage") - } - Self::AuthentikStagesPromptPrompt => write!(f, "authentik_stages_prompt.prompt"), - Self::AuthentikStagesPromptPromptstage => { - write!(f, "authentik_stages_prompt.promptstage") - } - Self::AuthentikStagesRedirectRedirectstage => { - write!(f, "authentik_stages_redirect.redirectstage") - } - Self::AuthentikStagesUserDeleteUserdeletestage => { - write!(f, "authentik_stages_user_delete.userdeletestage") - } - Self::AuthentikStagesUserLoginUserloginstage => { - write!(f, "authentik_stages_user_login.userloginstage") - } - Self::AuthentikStagesUserLogoutUserlogoutstage => { - write!(f, "authentik_stages_user_logout.userlogoutstage") - } - Self::AuthentikStagesUserWriteUserwritestage => { - write!(f, "authentik_stages_user_write.userwritestage") - } - Self::AuthentikTasksSchedulesSchedule => { - write!(f, "authentik_tasks_schedules.schedule") - } - Self::AuthentikBrandsBrand => write!(f, "authentik_brands.brand"), - Self::AuthentikBlueprintsBlueprintinstance => { - write!(f, "authentik_blueprints.blueprintinstance") - } - Self::AuthentikEndpointsConnectorsFleetFleetconnector => { - write!(f, "authentik_endpoints_connectors_fleet.fleetconnector") - } - Self::AuthentikEndpointsConnectorsGoogleChromeGooglechromeconnector => write!( - f, - "authentik_endpoints_connectors_google_chrome.googlechromeconnector" - ), - Self::AuthentikLifecycleLifecyclerule => write!(f, "authentik_lifecycle.lifecyclerule"), - Self::AuthentikLifecycleLifecycleiteration => { - write!(f, "authentik_lifecycle.lifecycleiteration") - } - Self::AuthentikLifecycleReview => write!(f, "authentik_lifecycle.review"), - Self::AuthentikPoliciesUniquePasswordUniquepasswordpolicy => { - write!(f, "authentik_policies_unique_password.uniquepasswordpolicy") - } - Self::AuthentikProvidersGoogleWorkspaceGoogleworkspaceprovider => write!( - f, - "authentik_providers_google_workspace.googleworkspaceprovider" - ), - Self::AuthentikProvidersGoogleWorkspaceGoogleworkspaceprovidermapping => write!( - f, - "authentik_providers_google_workspace.googleworkspaceprovidermapping" - ), - Self::AuthentikProvidersMicrosoftEntraMicrosoftentraprovider => write!( - f, - "authentik_providers_microsoft_entra.microsoftentraprovider" - ), - Self::AuthentikProvidersMicrosoftEntraMicrosoftentraprovidermapping => write!( - f, - "authentik_providers_microsoft_entra.microsoftentraprovidermapping" - ), - Self::AuthentikProvidersSsfSsfprovider => { - write!(f, "authentik_providers_ssf.ssfprovider") - } - Self::AuthentikProvidersWsFederationWsfederationprovider => { - write!(f, "authentik_providers_ws_federation.wsfederationprovider") - } - Self::AuthentikReportsDataexport => write!(f, "authentik_reports.dataexport"), - Self::AuthentikStagesAuthenticatorEndpointGdtcAuthenticatorendpointgdtcstage => write!( - f, - "authentik_stages_authenticator_endpoint_gdtc.authenticatorendpointgdtcstage" - ), - Self::AuthentikStagesMtlsMutualtlsstage => { - write!(f, "authentik_stages_mtls.mutualtlsstage") - } - Self::AuthentikStagesSourceSourcestage => { - write!(f, "authentik_stages_source.sourcestage") - } - } - } -} - -impl Default for ModelEnum { - fn default() -> ModelEnum { - Self::AuthentikTenantsDomain - } -} diff --git a/packages/client-rust/src/models/model_request.rs b/packages/client-rust/src/models/model_request.rs deleted file mode 100644 index d1a004cd9f..0000000000 --- a/packages/client-rust/src/models/model_request.rs +++ /dev/null @@ -1,46 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -#[serde(tag = "provider_model")] -pub enum ModelRequest { - #[serde(rename = "authentik_providers_google_workspace.googleworkspaceprovider")] - AuthentikProvidersGoogleWorkspaceGoogleworkspaceprovider( - models::GoogleWorkspaceProviderRequest, - ), - #[serde(rename = "authentik_providers_ldap.ldapprovider")] - AuthentikProvidersLdapLdapprovider(models::LdapProviderRequest), - #[serde(rename = "authentik_providers_microsoft_entra.microsoftentraprovider")] - AuthentikProvidersMicrosoftEntraMicrosoftentraprovider(models::MicrosoftEntraProviderRequest), - #[serde(rename = "authentik_providers_oauth2.oauth2provider")] - AuthentikProvidersOauth2Oauth2provider(models::OAuth2ProviderRequest), - #[serde(rename = "authentik_providers_proxy.proxyprovider")] - AuthentikProvidersProxyProxyprovider(models::ProxyProviderRequest), - #[serde(rename = "authentik_providers_rac.racprovider")] - AuthentikProvidersRacRacprovider(models::RacProviderRequest), - #[serde(rename = "authentik_providers_radius.radiusprovider")] - AuthentikProvidersRadiusRadiusprovider(models::RadiusProviderRequest), - #[serde(rename = "authentik_providers_saml.samlprovider")] - AuthentikProvidersSamlSamlprovider(models::SamlProviderRequest), - #[serde(rename = "authentik_providers_scim.scimprovider")] - AuthentikProvidersScimScimprovider(models::ScimProviderRequest), - #[serde(rename = "authentik_providers_ssf.ssfprovider")] - AuthentikProvidersSsfSsfprovider(models::SsfProviderRequest), - #[serde(rename = "authentik_providers_ws_federation.wsfederationprovider")] - AuthentikProvidersWsFederationWsfederationprovider(models::WsFederationProviderRequest), -} - -impl Default for ModelRequest { - fn default() -> Self { - Self::AuthentikProvidersGoogleWorkspaceGoogleworkspaceprovider(Default::default()) - } -} diff --git a/packages/client-rust/src/models/mutual_tls_stage.rs b/packages/client-rust/src/models/mutual_tls_stage.rs deleted file mode 100644 index f291f6ec12..0000000000 --- a/packages/client-rust/src/models/mutual_tls_stage.rs +++ /dev/null @@ -1,77 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// MutualTlsStage : MutualTLSStage Serializer -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct MutualTlsStage { - #[serde(rename = "pk")] - pub pk: uuid::Uuid, - #[serde(rename = "name")] - pub name: String, - /// Get object type so that we know how to edit the object - #[serde(rename = "component")] - pub component: String, - /// Return object's verbose_name - #[serde(rename = "verbose_name")] - pub verbose_name: String, - /// Return object's plural verbose_name - #[serde(rename = "verbose_name_plural")] - pub verbose_name_plural: String, - /// Return internal model name - #[serde(rename = "meta_model_name")] - pub meta_model_name: String, - #[serde(rename = "flow_set")] - pub flow_set: Vec, - #[serde(rename = "mode")] - pub mode: models::StageModeEnum, - /// Configure certificate authorities to validate the certificate against. This option has a - /// higher priority than the `client_certificate` option on `Brand`. - #[serde( - rename = "certificate_authorities", - skip_serializing_if = "Option::is_none" - )] - pub certificate_authorities: Option>, - #[serde(rename = "cert_attribute")] - pub cert_attribute: models::CertAttributeEnum, - #[serde(rename = "user_attribute")] - pub user_attribute: models::UserAttributeEnum, -} - -impl MutualTlsStage { - /// MutualTLSStage Serializer - pub fn new( - pk: uuid::Uuid, - name: String, - component: String, - verbose_name: String, - verbose_name_plural: String, - meta_model_name: String, - flow_set: Vec, - mode: models::StageModeEnum, - cert_attribute: models::CertAttributeEnum, - user_attribute: models::UserAttributeEnum, - ) -> MutualTlsStage { - MutualTlsStage { - pk, - name, - component, - verbose_name, - verbose_name_plural, - meta_model_name, - flow_set, - mode, - certificate_authorities: None, - cert_attribute, - user_attribute, - } - } -} diff --git a/packages/client-rust/src/models/mutual_tls_stage_request.rs b/packages/client-rust/src/models/mutual_tls_stage_request.rs deleted file mode 100644 index 44be8f7fef..0000000000 --- a/packages/client-rust/src/models/mutual_tls_stage_request.rs +++ /dev/null @@ -1,49 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// MutualTlsStageRequest : MutualTLSStage Serializer -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct MutualTlsStageRequest { - #[serde(rename = "name")] - pub name: String, - #[serde(rename = "mode")] - pub mode: models::StageModeEnum, - /// Configure certificate authorities to validate the certificate against. This option has a - /// higher priority than the `client_certificate` option on `Brand`. - #[serde( - rename = "certificate_authorities", - skip_serializing_if = "Option::is_none" - )] - pub certificate_authorities: Option>, - #[serde(rename = "cert_attribute")] - pub cert_attribute: models::CertAttributeEnum, - #[serde(rename = "user_attribute")] - pub user_attribute: models::UserAttributeEnum, -} - -impl MutualTlsStageRequest { - /// MutualTLSStage Serializer - pub fn new( - name: String, - mode: models::StageModeEnum, - cert_attribute: models::CertAttributeEnum, - user_attribute: models::UserAttributeEnum, - ) -> MutualTlsStageRequest { - MutualTlsStageRequest { - name, - mode, - certificate_authorities: None, - cert_attribute, - user_attribute, - } - } -} diff --git a/packages/client-rust/src/models/network.rs b/packages/client-rust/src/models/network.rs deleted file mode 100644 index cde8548df8..0000000000 --- a/packages/client-rust/src/models/network.rs +++ /dev/null @@ -1,34 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct Network { - #[serde(rename = "hostname")] - pub hostname: String, - #[serde(rename = "firewall_enabled", skip_serializing_if = "Option::is_none")] - pub firewall_enabled: Option, - #[serde(rename = "interfaces")] - pub interfaces: Vec, - #[serde(rename = "gateway", skip_serializing_if = "Option::is_none")] - pub gateway: Option, -} - -impl Network { - pub fn new(hostname: String, interfaces: Vec) -> Network { - Network { - hostname, - firewall_enabled: None, - interfaces, - gateway: None, - } - } -} diff --git a/packages/client-rust/src/models/network_binding_enum.rs b/packages/client-rust/src/models/network_binding_enum.rs deleted file mode 100644 index 8a781f4eeb..0000000000 --- a/packages/client-rust/src/models/network_binding_enum.rs +++ /dev/null @@ -1,41 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// -#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] -pub enum NetworkBindingEnum { - #[serde(rename = "no_binding")] - NoBinding, - #[serde(rename = "bind_asn")] - BindAsn, - #[serde(rename = "bind_asn_network")] - BindAsnNetwork, - #[serde(rename = "bind_asn_network_ip")] - BindAsnNetworkIp, -} - -impl std::fmt::Display for NetworkBindingEnum { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - match self { - Self::NoBinding => write!(f, "no_binding"), - Self::BindAsn => write!(f, "bind_asn"), - Self::BindAsnNetwork => write!(f, "bind_asn_network"), - Self::BindAsnNetworkIp => write!(f, "bind_asn_network_ip"), - } - } -} - -impl Default for NetworkBindingEnum { - fn default() -> NetworkBindingEnum { - Self::NoBinding - } -} diff --git a/packages/client-rust/src/models/network_interface.rs b/packages/client-rust/src/models/network_interface.rs deleted file mode 100644 index fe3815e330..0000000000 --- a/packages/client-rust/src/models/network_interface.rs +++ /dev/null @@ -1,34 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct NetworkInterface { - #[serde(rename = "name")] - pub name: String, - #[serde(rename = "hardware_address")] - pub hardware_address: String, - #[serde(rename = "ip_addresses", skip_serializing_if = "Option::is_none")] - pub ip_addresses: Option>, - #[serde(rename = "dns_servers", skip_serializing_if = "Option::is_none")] - pub dns_servers: Option>, -} - -impl NetworkInterface { - pub fn new(name: String, hardware_address: String) -> NetworkInterface { - NetworkInterface { - name, - hardware_address, - ip_addresses: None, - dns_servers: None, - } - } -} diff --git a/packages/client-rust/src/models/network_interface_request.rs b/packages/client-rust/src/models/network_interface_request.rs deleted file mode 100644 index 2614aa934b..0000000000 --- a/packages/client-rust/src/models/network_interface_request.rs +++ /dev/null @@ -1,34 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct NetworkInterfaceRequest { - #[serde(rename = "name")] - pub name: String, - #[serde(rename = "hardware_address")] - pub hardware_address: String, - #[serde(rename = "ip_addresses", skip_serializing_if = "Option::is_none")] - pub ip_addresses: Option>, - #[serde(rename = "dns_servers", skip_serializing_if = "Option::is_none")] - pub dns_servers: Option>, -} - -impl NetworkInterfaceRequest { - pub fn new(name: String, hardware_address: String) -> NetworkInterfaceRequest { - NetworkInterfaceRequest { - name, - hardware_address, - ip_addresses: None, - dns_servers: None, - } - } -} diff --git a/packages/client-rust/src/models/network_request.rs b/packages/client-rust/src/models/network_request.rs deleted file mode 100644 index d5b52e93e7..0000000000 --- a/packages/client-rust/src/models/network_request.rs +++ /dev/null @@ -1,37 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct NetworkRequest { - #[serde(rename = "hostname")] - pub hostname: String, - #[serde(rename = "firewall_enabled", skip_serializing_if = "Option::is_none")] - pub firewall_enabled: Option, - #[serde(rename = "interfaces")] - pub interfaces: Vec, - #[serde(rename = "gateway", skip_serializing_if = "Option::is_none")] - pub gateway: Option, -} - -impl NetworkRequest { - pub fn new( - hostname: String, - interfaces: Vec, - ) -> NetworkRequest { - NetworkRequest { - hostname, - firewall_enabled: None, - interfaces, - gateway: None, - } - } -} diff --git a/packages/client-rust/src/models/not_configured_action_enum.rs b/packages/client-rust/src/models/not_configured_action_enum.rs deleted file mode 100644 index 664b9b2520..0000000000 --- a/packages/client-rust/src/models/not_configured_action_enum.rs +++ /dev/null @@ -1,38 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// -#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] -pub enum NotConfiguredActionEnum { - #[serde(rename = "skip")] - Skip, - #[serde(rename = "deny")] - Deny, - #[serde(rename = "configure")] - Configure, -} - -impl std::fmt::Display for NotConfiguredActionEnum { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - match self { - Self::Skip => write!(f, "skip"), - Self::Deny => write!(f, "deny"), - Self::Configure => write!(f, "configure"), - } - } -} - -impl Default for NotConfiguredActionEnum { - fn default() -> NotConfiguredActionEnum { - Self::Skip - } -} diff --git a/packages/client-rust/src/models/notification.rs b/packages/client-rust/src/models/notification.rs deleted file mode 100644 index 579c503412..0000000000 --- a/packages/client-rust/src/models/notification.rs +++ /dev/null @@ -1,63 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// Notification : Notification Serializer -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct Notification { - #[serde(rename = "pk")] - pub pk: uuid::Uuid, - #[serde(rename = "severity")] - pub severity: models::SeverityEnum, - #[serde(rename = "body")] - pub body: String, - #[serde( - rename = "hyperlink", - default, - with = "::serde_with::rust::double_option", - skip_serializing_if = "Option::is_none" - )] - pub hyperlink: Option>, - #[serde( - rename = "hyperlink_label", - default, - with = "::serde_with::rust::double_option", - skip_serializing_if = "Option::is_none" - )] - pub hyperlink_label: Option>, - #[serde(rename = "created")] - pub created: String, - #[serde(rename = "event", skip_serializing_if = "Option::is_none")] - pub event: Option, - #[serde(rename = "seen", skip_serializing_if = "Option::is_none")] - pub seen: Option, -} - -impl Notification { - /// Notification Serializer - pub fn new( - pk: uuid::Uuid, - severity: models::SeverityEnum, - body: String, - created: String, - ) -> Notification { - Notification { - pk, - severity, - body, - hyperlink: None, - hyperlink_label: None, - created, - event: None, - seen: None, - } - } -} diff --git a/packages/client-rust/src/models/notification_request.rs b/packages/client-rust/src/models/notification_request.rs deleted file mode 100644 index d8839c301d..0000000000 --- a/packages/client-rust/src/models/notification_request.rs +++ /dev/null @@ -1,46 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// NotificationRequest : Notification Serializer -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct NotificationRequest { - #[serde( - rename = "hyperlink", - default, - with = "::serde_with::rust::double_option", - skip_serializing_if = "Option::is_none" - )] - pub hyperlink: Option>, - #[serde( - rename = "hyperlink_label", - default, - with = "::serde_with::rust::double_option", - skip_serializing_if = "Option::is_none" - )] - pub hyperlink_label: Option>, - #[serde(rename = "event", skip_serializing_if = "Option::is_none")] - pub event: Option, - #[serde(rename = "seen", skip_serializing_if = "Option::is_none")] - pub seen: Option, -} - -impl NotificationRequest { - /// Notification Serializer - pub fn new() -> NotificationRequest { - NotificationRequest { - hyperlink: None, - hyperlink_label: None, - event: None, - seen: None, - } - } -} diff --git a/packages/client-rust/src/models/notification_rule.rs b/packages/client-rust/src/models/notification_rule.rs deleted file mode 100644 index 4dc31e9856..0000000000 --- a/packages/client-rust/src/models/notification_rule.rs +++ /dev/null @@ -1,64 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// NotificationRule : NotificationRule Serializer -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct NotificationRule { - #[serde(rename = "pk")] - pub pk: uuid::Uuid, - #[serde(rename = "name")] - pub name: String, - /// Select which transports should be used to notify the user. If none are selected, the - /// notification will only be shown in the authentik UI. - #[serde(rename = "transports", skip_serializing_if = "Option::is_none")] - pub transports: Option>, - /// Controls which severity level the created notifications will have. - #[serde(rename = "severity", skip_serializing_if = "Option::is_none")] - pub severity: Option, - /// Define which group of users this notification should be sent and shown to. If left empty, - /// Notification won't ben sent. - #[serde( - rename = "destination_group", - default, - with = "::serde_with::rust::double_option", - skip_serializing_if = "Option::is_none" - )] - pub destination_group: Option>, - #[serde(rename = "destination_group_obj")] - pub destination_group_obj: models::Group, - /// When enabled, notification will be sent to user the user that triggered the event.When - /// destination_group is configured, notification is sent to both. - #[serde( - rename = "destination_event_user", - skip_serializing_if = "Option::is_none" - )] - pub destination_event_user: Option, -} - -impl NotificationRule { - /// NotificationRule Serializer - pub fn new( - pk: uuid::Uuid, - name: String, - destination_group_obj: models::Group, - ) -> NotificationRule { - NotificationRule { - pk, - name, - transports: None, - severity: None, - destination_group: None, - destination_group_obj, - destination_event_user: None, - } - } -} diff --git a/packages/client-rust/src/models/notification_rule_request.rs b/packages/client-rust/src/models/notification_rule_request.rs deleted file mode 100644 index 2d5551ce87..0000000000 --- a/packages/client-rust/src/models/notification_rule_request.rs +++ /dev/null @@ -1,54 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// NotificationRuleRequest : NotificationRule Serializer -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct NotificationRuleRequest { - #[serde(rename = "name")] - pub name: String, - /// Select which transports should be used to notify the user. If none are selected, the - /// notification will only be shown in the authentik UI. - #[serde(rename = "transports", skip_serializing_if = "Option::is_none")] - pub transports: Option>, - /// Controls which severity level the created notifications will have. - #[serde(rename = "severity", skip_serializing_if = "Option::is_none")] - pub severity: Option, - /// Define which group of users this notification should be sent and shown to. If left empty, - /// Notification won't ben sent. - #[serde( - rename = "destination_group", - default, - with = "::serde_with::rust::double_option", - skip_serializing_if = "Option::is_none" - )] - pub destination_group: Option>, - /// When enabled, notification will be sent to user the user that triggered the event.When - /// destination_group is configured, notification is sent to both. - #[serde( - rename = "destination_event_user", - skip_serializing_if = "Option::is_none" - )] - pub destination_event_user: Option, -} - -impl NotificationRuleRequest { - /// NotificationRule Serializer - pub fn new(name: String) -> NotificationRuleRequest { - NotificationRuleRequest { - name, - transports: None, - severity: None, - destination_group: None, - destination_event_user: None, - } - } -} diff --git a/packages/client-rust/src/models/notification_transport.rs b/packages/client-rust/src/models/notification_transport.rs deleted file mode 100644 index 6ed8a13f71..0000000000 --- a/packages/client-rust/src/models/notification_transport.rs +++ /dev/null @@ -1,82 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// NotificationTransport : NotificationTransport Serializer -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct NotificationTransport { - #[serde(rename = "pk")] - pub pk: uuid::Uuid, - #[serde(rename = "name")] - pub name: String, - #[serde(rename = "mode", skip_serializing_if = "Option::is_none")] - pub mode: Option, - /// Return selected mode with a UI Label - #[serde(rename = "mode_verbose")] - pub mode_verbose: String, - #[serde(rename = "webhook_url", skip_serializing_if = "Option::is_none")] - pub webhook_url: Option, - /// When set, the selected ceritifcate is used to validate the certificate of the webhook - /// server. - #[serde( - rename = "webhook_ca", - default, - with = "::serde_with::rust::double_option", - skip_serializing_if = "Option::is_none" - )] - pub webhook_ca: Option>, - /// Customize the body of the request. Mapping should return data that is JSON-serializable. - #[serde( - rename = "webhook_mapping_body", - default, - with = "::serde_with::rust::double_option", - skip_serializing_if = "Option::is_none" - )] - pub webhook_mapping_body: Option>, - /// Configure additional headers to be sent. Mapping should return a dictionary of key-value - /// pairs - #[serde( - rename = "webhook_mapping_headers", - default, - with = "::serde_with::rust::double_option", - skip_serializing_if = "Option::is_none" - )] - pub webhook_mapping_headers: Option>, - #[serde( - rename = "email_subject_prefix", - skip_serializing_if = "Option::is_none" - )] - pub email_subject_prefix: Option, - #[serde(rename = "email_template", skip_serializing_if = "Option::is_none")] - pub email_template: Option, - /// Only send notification once, for example when sending a webhook into a chat channel. - #[serde(rename = "send_once", skip_serializing_if = "Option::is_none")] - pub send_once: Option, -} - -impl NotificationTransport { - /// NotificationTransport Serializer - pub fn new(pk: uuid::Uuid, name: String, mode_verbose: String) -> NotificationTransport { - NotificationTransport { - pk, - name, - mode: None, - mode_verbose, - webhook_url: None, - webhook_ca: None, - webhook_mapping_body: None, - webhook_mapping_headers: None, - email_subject_prefix: None, - email_template: None, - send_once: None, - } - } -} diff --git a/packages/client-rust/src/models/notification_transport_request.rs b/packages/client-rust/src/models/notification_transport_request.rs deleted file mode 100644 index 97496e66ff..0000000000 --- a/packages/client-rust/src/models/notification_transport_request.rs +++ /dev/null @@ -1,75 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// NotificationTransportRequest : NotificationTransport Serializer -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct NotificationTransportRequest { - #[serde(rename = "name")] - pub name: String, - #[serde(rename = "mode", skip_serializing_if = "Option::is_none")] - pub mode: Option, - #[serde(rename = "webhook_url", skip_serializing_if = "Option::is_none")] - pub webhook_url: Option, - /// When set, the selected ceritifcate is used to validate the certificate of the webhook - /// server. - #[serde( - rename = "webhook_ca", - default, - with = "::serde_with::rust::double_option", - skip_serializing_if = "Option::is_none" - )] - pub webhook_ca: Option>, - /// Customize the body of the request. Mapping should return data that is JSON-serializable. - #[serde( - rename = "webhook_mapping_body", - default, - with = "::serde_with::rust::double_option", - skip_serializing_if = "Option::is_none" - )] - pub webhook_mapping_body: Option>, - /// Configure additional headers to be sent. Mapping should return a dictionary of key-value - /// pairs - #[serde( - rename = "webhook_mapping_headers", - default, - with = "::serde_with::rust::double_option", - skip_serializing_if = "Option::is_none" - )] - pub webhook_mapping_headers: Option>, - #[serde( - rename = "email_subject_prefix", - skip_serializing_if = "Option::is_none" - )] - pub email_subject_prefix: Option, - #[serde(rename = "email_template", skip_serializing_if = "Option::is_none")] - pub email_template: Option, - /// Only send notification once, for example when sending a webhook into a chat channel. - #[serde(rename = "send_once", skip_serializing_if = "Option::is_none")] - pub send_once: Option, -} - -impl NotificationTransportRequest { - /// NotificationTransport Serializer - pub fn new(name: String) -> NotificationTransportRequest { - NotificationTransportRequest { - name, - mode: None, - webhook_url: None, - webhook_ca: None, - webhook_mapping_body: None, - webhook_mapping_headers: None, - email_subject_prefix: None, - email_template: None, - send_once: None, - } - } -} diff --git a/packages/client-rust/src/models/notification_transport_test.rs b/packages/client-rust/src/models/notification_transport_test.rs deleted file mode 100644 index e702e4848d..0000000000 --- a/packages/client-rust/src/models/notification_transport_test.rs +++ /dev/null @@ -1,25 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// NotificationTransportTest : Notification test serializer -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct NotificationTransportTest { - #[serde(rename = "messages")] - pub messages: Vec, -} - -impl NotificationTransportTest { - /// Notification test serializer - pub fn new(messages: Vec) -> NotificationTransportTest { - NotificationTransportTest { messages } - } -} diff --git a/packages/client-rust/src/models/notification_webhook_mapping.rs b/packages/client-rust/src/models/notification_webhook_mapping.rs deleted file mode 100644 index ce26868439..0000000000 --- a/packages/client-rust/src/models/notification_webhook_mapping.rs +++ /dev/null @@ -1,33 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// NotificationWebhookMapping : NotificationWebhookMapping Serializer -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct NotificationWebhookMapping { - #[serde(rename = "pk")] - pub pk: uuid::Uuid, - #[serde(rename = "name")] - pub name: String, - #[serde(rename = "expression")] - pub expression: String, -} - -impl NotificationWebhookMapping { - /// NotificationWebhookMapping Serializer - pub fn new(pk: uuid::Uuid, name: String, expression: String) -> NotificationWebhookMapping { - NotificationWebhookMapping { - pk, - name, - expression, - } - } -} diff --git a/packages/client-rust/src/models/notification_webhook_mapping_request.rs b/packages/client-rust/src/models/notification_webhook_mapping_request.rs deleted file mode 100644 index 171f40d017..0000000000 --- a/packages/client-rust/src/models/notification_webhook_mapping_request.rs +++ /dev/null @@ -1,27 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// NotificationWebhookMappingRequest : NotificationWebhookMapping Serializer -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct NotificationWebhookMappingRequest { - #[serde(rename = "name")] - pub name: String, - #[serde(rename = "expression")] - pub expression: String, -} - -impl NotificationWebhookMappingRequest { - /// NotificationWebhookMapping Serializer - pub fn new(name: String, expression: String) -> NotificationWebhookMappingRequest { - NotificationWebhookMappingRequest { name, expression } - } -} diff --git a/packages/client-rust/src/models/o_auth2_provider.rs b/packages/client-rust/src/models/o_auth2_provider.rs deleted file mode 100644 index 2b82f2e635..0000000000 --- a/packages/client-rust/src/models/o_auth2_provider.rs +++ /dev/null @@ -1,210 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// OAuth2Provider : OAuth2Provider Serializer -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct OAuth2Provider { - #[serde(rename = "pk")] - pub pk: i32, - #[serde(rename = "name")] - pub name: String, - /// Flow used for authentication when the associated application is accessed by an - /// un-authenticated user. - #[serde( - rename = "authentication_flow", - default, - with = "::serde_with::rust::double_option", - skip_serializing_if = "Option::is_none" - )] - pub authentication_flow: Option>, - /// Flow used when authorizing this provider. - #[serde(rename = "authorization_flow")] - pub authorization_flow: uuid::Uuid, - /// Flow used ending the session from a provider. - #[serde(rename = "invalidation_flow")] - pub invalidation_flow: uuid::Uuid, - #[serde(rename = "property_mappings", skip_serializing_if = "Option::is_none")] - pub property_mappings: Option>, - /// Get object component so that we know how to edit the object - #[serde(rename = "component")] - pub component: String, - /// Internal application name, used in URLs. - #[serde( - rename = "assigned_application_slug", - deserialize_with = "Option::deserialize" - )] - pub assigned_application_slug: Option, - /// Application's display Name. - #[serde( - rename = "assigned_application_name", - deserialize_with = "Option::deserialize" - )] - pub assigned_application_name: Option, - /// Internal application name, used in URLs. - #[serde( - rename = "assigned_backchannel_application_slug", - deserialize_with = "Option::deserialize" - )] - pub assigned_backchannel_application_slug: Option, - /// Application's display Name. - #[serde( - rename = "assigned_backchannel_application_name", - deserialize_with = "Option::deserialize" - )] - pub assigned_backchannel_application_name: Option, - /// Return object's verbose_name - #[serde(rename = "verbose_name")] - pub verbose_name: String, - /// Return object's plural verbose_name - #[serde(rename = "verbose_name_plural")] - pub verbose_name_plural: String, - /// Return internal model name - #[serde(rename = "meta_model_name")] - pub meta_model_name: String, - /// Confidential clients are capable of maintaining the confidentiality of their credentials. - /// Public clients are incapable - #[serde(rename = "client_type", skip_serializing_if = "Option::is_none")] - pub client_type: Option, - #[serde(rename = "client_id", skip_serializing_if = "Option::is_none")] - pub client_id: Option, - #[serde(rename = "client_secret", skip_serializing_if = "Option::is_none")] - pub client_secret: Option, - /// Access codes not valid on or after current time + this value (Format: - /// hours=1;minutes=2;seconds=3). - #[serde( - rename = "access_code_validity", - skip_serializing_if = "Option::is_none" - )] - pub access_code_validity: Option, - /// Tokens not valid on or after current time + this value (Format: - /// hours=1;minutes=2;seconds=3). - #[serde( - rename = "access_token_validity", - skip_serializing_if = "Option::is_none" - )] - pub access_token_validity: Option, - /// Tokens not valid on or after current time + this value (Format: - /// hours=1;minutes=2;seconds=3). - #[serde( - rename = "refresh_token_validity", - skip_serializing_if = "Option::is_none" - )] - pub refresh_token_validity: Option, - /// 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). - #[serde( - rename = "refresh_token_threshold", - skip_serializing_if = "Option::is_none" - )] - pub refresh_token_threshold: Option, - /// Include User claims from scopes in the id_token, for applications that don't access the - /// userinfo endpoint. - #[serde( - rename = "include_claims_in_id_token", - skip_serializing_if = "Option::is_none" - )] - pub include_claims_in_id_token: Option, - /// Key used to sign the tokens. - #[serde( - rename = "signing_key", - default, - with = "::serde_with::rust::double_option", - skip_serializing_if = "Option::is_none" - )] - pub signing_key: Option>, - /// Key used to encrypt the tokens. When set, tokens will be encrypted and returned as JWEs. - #[serde( - rename = "encryption_key", - default, - with = "::serde_with::rust::double_option", - skip_serializing_if = "Option::is_none" - )] - pub encryption_key: Option>, - #[serde(rename = "redirect_uris")] - pub redirect_uris: Vec, - #[serde(rename = "logout_uri", skip_serializing_if = "Option::is_none")] - pub logout_uri: Option, - /// Backchannel logs out with server to server calls. Frontchannel uses iframes in your browser - #[serde(rename = "logout_method", skip_serializing_if = "Option::is_none")] - pub logout_method: Option, - /// Configure what data should be used as unique User Identifier. For most cases, the default - /// should be fine. - #[serde(rename = "sub_mode", skip_serializing_if = "Option::is_none")] - pub sub_mode: Option, - /// Configure how the issuer field of the ID Token should be filled. - #[serde(rename = "issuer_mode", skip_serializing_if = "Option::is_none")] - pub issuer_mode: Option, - #[serde( - rename = "jwt_federation_sources", - skip_serializing_if = "Option::is_none" - )] - pub jwt_federation_sources: Option>, - #[serde( - rename = "jwt_federation_providers", - skip_serializing_if = "Option::is_none" - )] - pub jwt_federation_providers: Option>, -} - -impl OAuth2Provider { - /// OAuth2Provider Serializer - pub fn new( - pk: i32, - name: String, - authorization_flow: uuid::Uuid, - invalidation_flow: uuid::Uuid, - component: String, - assigned_application_slug: Option, - assigned_application_name: Option, - assigned_backchannel_application_slug: Option, - assigned_backchannel_application_name: Option, - verbose_name: String, - verbose_name_plural: String, - meta_model_name: String, - redirect_uris: Vec, - ) -> OAuth2Provider { - OAuth2Provider { - pk, - name, - authentication_flow: None, - authorization_flow, - invalidation_flow, - property_mappings: None, - component, - assigned_application_slug, - assigned_application_name, - assigned_backchannel_application_slug, - assigned_backchannel_application_name, - verbose_name, - verbose_name_plural, - meta_model_name, - client_type: None, - client_id: None, - client_secret: None, - access_code_validity: None, - access_token_validity: None, - refresh_token_validity: None, - refresh_token_threshold: None, - include_claims_in_id_token: None, - signing_key: None, - encryption_key: None, - redirect_uris, - logout_uri: None, - logout_method: None, - sub_mode: None, - issuer_mode: None, - jwt_federation_sources: None, - jwt_federation_providers: None, - } - } -} diff --git a/packages/client-rust/src/models/o_auth2_provider_logout_method_enum.rs b/packages/client-rust/src/models/o_auth2_provider_logout_method_enum.rs deleted file mode 100644 index af23e93150..0000000000 --- a/packages/client-rust/src/models/o_auth2_provider_logout_method_enum.rs +++ /dev/null @@ -1,35 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// -#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] -pub enum OAuth2ProviderLogoutMethodEnum { - #[serde(rename = "backchannel")] - Backchannel, - #[serde(rename = "frontchannel")] - Frontchannel, -} - -impl std::fmt::Display for OAuth2ProviderLogoutMethodEnum { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - match self { - Self::Backchannel => write!(f, "backchannel"), - Self::Frontchannel => write!(f, "frontchannel"), - } - } -} - -impl Default for OAuth2ProviderLogoutMethodEnum { - fn default() -> OAuth2ProviderLogoutMethodEnum { - Self::Backchannel - } -} diff --git a/packages/client-rust/src/models/o_auth2_provider_request.rs b/packages/client-rust/src/models/o_auth2_provider_request.rs deleted file mode 100644 index f44486dc24..0000000000 --- a/packages/client-rust/src/models/o_auth2_provider_request.rs +++ /dev/null @@ -1,154 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// OAuth2ProviderRequest : OAuth2Provider Serializer -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct OAuth2ProviderRequest { - #[serde(rename = "name")] - pub name: String, - /// Flow used for authentication when the associated application is accessed by an - /// un-authenticated user. - #[serde( - rename = "authentication_flow", - default, - with = "::serde_with::rust::double_option", - skip_serializing_if = "Option::is_none" - )] - pub authentication_flow: Option>, - /// Flow used when authorizing this provider. - #[serde(rename = "authorization_flow")] - pub authorization_flow: uuid::Uuid, - /// Flow used ending the session from a provider. - #[serde(rename = "invalidation_flow")] - pub invalidation_flow: uuid::Uuid, - #[serde(rename = "property_mappings", skip_serializing_if = "Option::is_none")] - pub property_mappings: Option>, - /// Confidential clients are capable of maintaining the confidentiality of their credentials. - /// Public clients are incapable - #[serde(rename = "client_type", skip_serializing_if = "Option::is_none")] - pub client_type: Option, - #[serde(rename = "client_id", skip_serializing_if = "Option::is_none")] - pub client_id: Option, - #[serde(rename = "client_secret", skip_serializing_if = "Option::is_none")] - pub client_secret: Option, - /// Access codes not valid on or after current time + this value (Format: - /// hours=1;minutes=2;seconds=3). - #[serde( - rename = "access_code_validity", - skip_serializing_if = "Option::is_none" - )] - pub access_code_validity: Option, - /// Tokens not valid on or after current time + this value (Format: - /// hours=1;minutes=2;seconds=3). - #[serde( - rename = "access_token_validity", - skip_serializing_if = "Option::is_none" - )] - pub access_token_validity: Option, - /// Tokens not valid on or after current time + this value (Format: - /// hours=1;minutes=2;seconds=3). - #[serde( - rename = "refresh_token_validity", - skip_serializing_if = "Option::is_none" - )] - pub refresh_token_validity: Option, - /// 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). - #[serde( - rename = "refresh_token_threshold", - skip_serializing_if = "Option::is_none" - )] - pub refresh_token_threshold: Option, - /// Include User claims from scopes in the id_token, for applications that don't access the - /// userinfo endpoint. - #[serde( - rename = "include_claims_in_id_token", - skip_serializing_if = "Option::is_none" - )] - pub include_claims_in_id_token: Option, - /// Key used to sign the tokens. - #[serde( - rename = "signing_key", - default, - with = "::serde_with::rust::double_option", - skip_serializing_if = "Option::is_none" - )] - pub signing_key: Option>, - /// Key used to encrypt the tokens. When set, tokens will be encrypted and returned as JWEs. - #[serde( - rename = "encryption_key", - default, - with = "::serde_with::rust::double_option", - skip_serializing_if = "Option::is_none" - )] - pub encryption_key: Option>, - #[serde(rename = "redirect_uris")] - pub redirect_uris: Vec, - #[serde(rename = "logout_uri", skip_serializing_if = "Option::is_none")] - pub logout_uri: Option, - /// Backchannel logs out with server to server calls. Frontchannel uses iframes in your browser - #[serde(rename = "logout_method", skip_serializing_if = "Option::is_none")] - pub logout_method: Option, - /// Configure what data should be used as unique User Identifier. For most cases, the default - /// should be fine. - #[serde(rename = "sub_mode", skip_serializing_if = "Option::is_none")] - pub sub_mode: Option, - /// Configure how the issuer field of the ID Token should be filled. - #[serde(rename = "issuer_mode", skip_serializing_if = "Option::is_none")] - pub issuer_mode: Option, - #[serde( - rename = "jwt_federation_sources", - skip_serializing_if = "Option::is_none" - )] - pub jwt_federation_sources: Option>, - #[serde( - rename = "jwt_federation_providers", - skip_serializing_if = "Option::is_none" - )] - pub jwt_federation_providers: Option>, -} - -impl OAuth2ProviderRequest { - /// OAuth2Provider Serializer - pub fn new( - name: String, - authorization_flow: uuid::Uuid, - invalidation_flow: uuid::Uuid, - redirect_uris: Vec, - ) -> OAuth2ProviderRequest { - OAuth2ProviderRequest { - name, - authentication_flow: None, - authorization_flow, - invalidation_flow, - property_mappings: None, - client_type: None, - client_id: None, - client_secret: None, - access_code_validity: None, - access_token_validity: None, - refresh_token_validity: None, - refresh_token_threshold: None, - include_claims_in_id_token: None, - signing_key: None, - encryption_key: None, - redirect_uris, - logout_uri: None, - logout_method: None, - sub_mode: None, - issuer_mode: None, - jwt_federation_sources: None, - jwt_federation_providers: None, - } - } -} diff --git a/packages/client-rust/src/models/o_auth2_provider_setup_urls.rs b/packages/client-rust/src/models/o_auth2_provider_setup_urls.rs deleted file mode 100644 index 8292e20934..0000000000 --- a/packages/client-rust/src/models/o_auth2_provider_setup_urls.rs +++ /dev/null @@ -1,53 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// OAuth2ProviderSetupUrls : OAuth2 Provider Metadata serializer -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct OAuth2ProviderSetupUrls { - #[serde(rename = "issuer")] - pub issuer: String, - #[serde(rename = "authorize")] - pub authorize: String, - #[serde(rename = "token")] - pub token: String, - #[serde(rename = "user_info")] - pub user_info: String, - #[serde(rename = "provider_info")] - pub provider_info: String, - #[serde(rename = "logout")] - pub logout: String, - #[serde(rename = "jwks")] - pub jwks: String, -} - -impl OAuth2ProviderSetupUrls { - /// OAuth2 Provider Metadata serializer - pub fn new( - issuer: String, - authorize: String, - token: String, - user_info: String, - provider_info: String, - logout: String, - jwks: String, - ) -> OAuth2ProviderSetupUrls { - OAuth2ProviderSetupUrls { - issuer, - authorize, - token, - user_info, - provider_info, - logout, - jwks, - } - } -} diff --git a/packages/client-rust/src/models/o_auth_source.rs b/packages/client-rust/src/models/o_auth_source.rs deleted file mode 100644 index a6f270255d..0000000000 --- a/packages/client-rust/src/models/o_auth_source.rs +++ /dev/null @@ -1,211 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// OAuthSource : OAuth Source Serializer -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct OAuthSource { - #[serde(rename = "pk")] - pub pk: uuid::Uuid, - /// Source's display Name. - #[serde(rename = "name")] - pub name: String, - /// Internal source name, used in URLs. - #[serde(rename = "slug")] - pub slug: String, - #[serde(rename = "enabled", skip_serializing_if = "Option::is_none")] - pub enabled: Option, - /// When enabled, this source will be displayed as a prominent button on the login page, - /// instead of a small icon. - #[serde(rename = "promoted", skip_serializing_if = "Option::is_none")] - pub promoted: Option, - /// Flow to use when authenticating existing users. - #[serde( - rename = "authentication_flow", - default, - with = "::serde_with::rust::double_option", - skip_serializing_if = "Option::is_none" - )] - pub authentication_flow: Option>, - /// Flow to use when enrolling new users. - #[serde( - rename = "enrollment_flow", - default, - with = "::serde_with::rust::double_option", - skip_serializing_if = "Option::is_none" - )] - pub enrollment_flow: Option>, - #[serde( - rename = "user_property_mappings", - skip_serializing_if = "Option::is_none" - )] - pub user_property_mappings: Option>, - #[serde( - rename = "group_property_mappings", - skip_serializing_if = "Option::is_none" - )] - pub group_property_mappings: Option>, - /// Get object component so that we know how to edit the object - #[serde(rename = "component")] - pub component: String, - /// Return object's verbose_name - #[serde(rename = "verbose_name")] - pub verbose_name: String, - /// Return object's plural verbose_name - #[serde(rename = "verbose_name_plural")] - pub verbose_name_plural: String, - /// Return internal model name - #[serde(rename = "meta_model_name")] - pub meta_model_name: String, - #[serde(rename = "policy_engine_mode", skip_serializing_if = "Option::is_none")] - pub policy_engine_mode: Option, - /// How the source determines if an existing user should be authenticated or a new user - /// enrolled. - #[serde(rename = "user_matching_mode", skip_serializing_if = "Option::is_none")] - pub user_matching_mode: Option, - /// 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. - #[serde(rename = "managed", deserialize_with = "Option::deserialize")] - pub managed: Option, - #[serde(rename = "user_path_template", skip_serializing_if = "Option::is_none")] - pub user_path_template: Option, - #[serde(rename = "icon", skip_serializing_if = "Option::is_none")] - pub icon: Option, - #[serde(rename = "icon_url", deserialize_with = "Option::deserialize")] - pub icon_url: Option, - #[serde(rename = "icon_themed_urls", deserialize_with = "Option::deserialize")] - pub icon_themed_urls: Option, - /// How the source determines if an existing group should be used or a new group created. - #[serde( - rename = "group_matching_mode", - skip_serializing_if = "Option::is_none" - )] - pub group_matching_mode: Option, - #[serde(rename = "provider_type")] - pub provider_type: models::ProviderTypeEnum, - /// URL used to request the initial token. This URL is only required for OAuth 1. - #[serde( - rename = "request_token_url", - default, - with = "::serde_with::rust::double_option", - skip_serializing_if = "Option::is_none" - )] - pub request_token_url: Option>, - /// URL the user is redirect to to conest the flow. - #[serde( - rename = "authorization_url", - default, - with = "::serde_with::rust::double_option", - skip_serializing_if = "Option::is_none" - )] - pub authorization_url: Option>, - /// URL used by authentik to retrieve tokens. - #[serde( - rename = "access_token_url", - default, - with = "::serde_with::rust::double_option", - skip_serializing_if = "Option::is_none" - )] - pub access_token_url: Option>, - /// URL used by authentik to get user information. - #[serde( - rename = "profile_url", - default, - with = "::serde_with::rust::double_option", - skip_serializing_if = "Option::is_none" - )] - pub profile_url: Option>, - #[serde(rename = "pkce", skip_serializing_if = "Option::is_none")] - pub pkce: Option, - #[serde(rename = "consumer_key")] - pub consumer_key: String, - /// Get OAuth Callback URL - #[serde(rename = "callback_url")] - pub callback_url: String, - #[serde(rename = "additional_scopes", skip_serializing_if = "Option::is_none")] - pub additional_scopes: Option, - #[serde(rename = "type")] - pub r#type: models::SourceType, - #[serde( - rename = "oidc_well_known_url", - skip_serializing_if = "Option::is_none" - )] - pub oidc_well_known_url: Option, - #[serde(rename = "oidc_jwks_url", skip_serializing_if = "Option::is_none")] - pub oidc_jwks_url: Option, - #[serde(rename = "oidc_jwks", skip_serializing_if = "Option::is_none")] - pub oidc_jwks: Option>, - /// How to perform authentication during an authorization_code token request flow - #[serde( - rename = "authorization_code_auth_method", - skip_serializing_if = "Option::is_none" - )] - pub authorization_code_auth_method: Option, -} - -impl OAuthSource { - /// OAuth Source Serializer - pub fn new( - pk: uuid::Uuid, - name: String, - slug: String, - component: String, - verbose_name: String, - verbose_name_plural: String, - meta_model_name: String, - managed: Option, - icon_url: Option, - icon_themed_urls: Option, - provider_type: models::ProviderTypeEnum, - consumer_key: String, - callback_url: String, - r#type: models::SourceType, - ) -> OAuthSource { - OAuthSource { - pk, - name, - slug, - enabled: None, - promoted: None, - authentication_flow: None, - enrollment_flow: None, - user_property_mappings: None, - group_property_mappings: None, - component, - verbose_name, - verbose_name_plural, - meta_model_name, - policy_engine_mode: None, - user_matching_mode: None, - managed, - user_path_template: None, - icon: None, - icon_url, - icon_themed_urls, - group_matching_mode: None, - provider_type, - request_token_url: None, - authorization_url: None, - access_token_url: None, - profile_url: None, - pkce: None, - consumer_key, - callback_url, - additional_scopes: None, - r#type, - oidc_well_known_url: None, - oidc_jwks_url: None, - oidc_jwks: None, - authorization_code_auth_method: None, - } - } -} diff --git a/packages/client-rust/src/models/o_auth_source_property_mapping.rs b/packages/client-rust/src/models/o_auth_source_property_mapping.rs deleted file mode 100644 index 360f84e084..0000000000 --- a/packages/client-rust/src/models/o_auth_source_property_mapping.rs +++ /dev/null @@ -1,68 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// OAuthSourcePropertyMapping : OAuthSourcePropertyMapping Serializer -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct OAuthSourcePropertyMapping { - #[serde(rename = "pk")] - pub pk: uuid::Uuid, - /// 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. - #[serde( - rename = "managed", - default, - with = "::serde_with::rust::double_option", - skip_serializing_if = "Option::is_none" - )] - pub managed: Option>, - #[serde(rename = "name")] - pub name: String, - #[serde(rename = "expression")] - pub expression: String, - /// Get object's component so that we know how to edit the object - #[serde(rename = "component")] - pub component: String, - /// Return object's verbose_name - #[serde(rename = "verbose_name")] - pub verbose_name: String, - /// Return object's plural verbose_name - #[serde(rename = "verbose_name_plural")] - pub verbose_name_plural: String, - /// Return internal model name - #[serde(rename = "meta_model_name")] - pub meta_model_name: String, -} - -impl OAuthSourcePropertyMapping { - /// OAuthSourcePropertyMapping Serializer - pub fn new( - pk: uuid::Uuid, - name: String, - expression: String, - component: String, - verbose_name: String, - verbose_name_plural: String, - meta_model_name: String, - ) -> OAuthSourcePropertyMapping { - OAuthSourcePropertyMapping { - pk, - managed: None, - name, - expression, - component, - verbose_name, - verbose_name_plural, - meta_model_name, - } - } -} diff --git a/packages/client-rust/src/models/o_auth_source_property_mapping_request.rs b/packages/client-rust/src/models/o_auth_source_property_mapping_request.rs deleted file mode 100644 index 39ca4aa663..0000000000 --- a/packages/client-rust/src/models/o_auth_source_property_mapping_request.rs +++ /dev/null @@ -1,41 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// OAuthSourcePropertyMappingRequest : OAuthSourcePropertyMapping Serializer -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct OAuthSourcePropertyMappingRequest { - /// 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. - #[serde( - rename = "managed", - default, - with = "::serde_with::rust::double_option", - skip_serializing_if = "Option::is_none" - )] - pub managed: Option>, - #[serde(rename = "name")] - pub name: String, - #[serde(rename = "expression")] - pub expression: String, -} - -impl OAuthSourcePropertyMappingRequest { - /// OAuthSourcePropertyMapping Serializer - pub fn new(name: String, expression: String) -> OAuthSourcePropertyMappingRequest { - OAuthSourcePropertyMappingRequest { - managed: None, - name, - expression, - } - } -} diff --git a/packages/client-rust/src/models/o_auth_source_request.rs b/packages/client-rust/src/models/o_auth_source_request.rs deleted file mode 100644 index 19077eae56..0000000000 --- a/packages/client-rust/src/models/o_auth_source_request.rs +++ /dev/null @@ -1,167 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// OAuthSourceRequest : OAuth Source Serializer -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct OAuthSourceRequest { - /// Source's display Name. - #[serde(rename = "name")] - pub name: String, - /// Internal source name, used in URLs. - #[serde(rename = "slug")] - pub slug: String, - #[serde(rename = "enabled", skip_serializing_if = "Option::is_none")] - pub enabled: Option, - /// When enabled, this source will be displayed as a prominent button on the login page, - /// instead of a small icon. - #[serde(rename = "promoted", skip_serializing_if = "Option::is_none")] - pub promoted: Option, - /// Flow to use when authenticating existing users. - #[serde( - rename = "authentication_flow", - default, - with = "::serde_with::rust::double_option", - skip_serializing_if = "Option::is_none" - )] - pub authentication_flow: Option>, - /// Flow to use when enrolling new users. - #[serde( - rename = "enrollment_flow", - default, - with = "::serde_with::rust::double_option", - skip_serializing_if = "Option::is_none" - )] - pub enrollment_flow: Option>, - #[serde( - rename = "user_property_mappings", - skip_serializing_if = "Option::is_none" - )] - pub user_property_mappings: Option>, - #[serde( - rename = "group_property_mappings", - skip_serializing_if = "Option::is_none" - )] - pub group_property_mappings: Option>, - #[serde(rename = "policy_engine_mode", skip_serializing_if = "Option::is_none")] - pub policy_engine_mode: Option, - /// How the source determines if an existing user should be authenticated or a new user - /// enrolled. - #[serde(rename = "user_matching_mode", skip_serializing_if = "Option::is_none")] - pub user_matching_mode: Option, - #[serde(rename = "user_path_template", skip_serializing_if = "Option::is_none")] - pub user_path_template: Option, - #[serde(rename = "icon", skip_serializing_if = "Option::is_none")] - pub icon: Option, - /// How the source determines if an existing group should be used or a new group created. - #[serde( - rename = "group_matching_mode", - skip_serializing_if = "Option::is_none" - )] - pub group_matching_mode: Option, - #[serde(rename = "provider_type")] - pub provider_type: models::ProviderTypeEnum, - /// URL used to request the initial token. This URL is only required for OAuth 1. - #[serde( - rename = "request_token_url", - default, - with = "::serde_with::rust::double_option", - skip_serializing_if = "Option::is_none" - )] - pub request_token_url: Option>, - /// URL the user is redirect to to conest the flow. - #[serde( - rename = "authorization_url", - default, - with = "::serde_with::rust::double_option", - skip_serializing_if = "Option::is_none" - )] - pub authorization_url: Option>, - /// URL used by authentik to retrieve tokens. - #[serde( - rename = "access_token_url", - default, - with = "::serde_with::rust::double_option", - skip_serializing_if = "Option::is_none" - )] - pub access_token_url: Option>, - /// URL used by authentik to get user information. - #[serde( - rename = "profile_url", - default, - with = "::serde_with::rust::double_option", - skip_serializing_if = "Option::is_none" - )] - pub profile_url: Option>, - #[serde(rename = "pkce", skip_serializing_if = "Option::is_none")] - pub pkce: Option, - #[serde(rename = "consumer_key")] - pub consumer_key: String, - #[serde(rename = "consumer_secret")] - pub consumer_secret: String, - #[serde(rename = "additional_scopes", skip_serializing_if = "Option::is_none")] - pub additional_scopes: Option, - #[serde( - rename = "oidc_well_known_url", - skip_serializing_if = "Option::is_none" - )] - pub oidc_well_known_url: Option, - #[serde(rename = "oidc_jwks_url", skip_serializing_if = "Option::is_none")] - pub oidc_jwks_url: Option, - #[serde(rename = "oidc_jwks", skip_serializing_if = "Option::is_none")] - pub oidc_jwks: Option>, - /// How to perform authentication during an authorization_code token request flow - #[serde( - rename = "authorization_code_auth_method", - skip_serializing_if = "Option::is_none" - )] - pub authorization_code_auth_method: Option, -} - -impl OAuthSourceRequest { - /// OAuth Source Serializer - pub fn new( - name: String, - slug: String, - provider_type: models::ProviderTypeEnum, - consumer_key: String, - consumer_secret: String, - ) -> OAuthSourceRequest { - OAuthSourceRequest { - name, - slug, - enabled: None, - promoted: None, - authentication_flow: None, - enrollment_flow: None, - user_property_mappings: None, - group_property_mappings: None, - policy_engine_mode: None, - user_matching_mode: None, - user_path_template: None, - icon: None, - group_matching_mode: None, - provider_type, - request_token_url: None, - authorization_url: None, - access_token_url: None, - profile_url: None, - pkce: None, - consumer_key, - consumer_secret, - additional_scopes: None, - oidc_well_known_url: None, - oidc_jwks_url: None, - oidc_jwks: None, - authorization_code_auth_method: None, - } - } -} diff --git a/packages/client-rust/src/models/operating_system.rs b/packages/client-rust/src/models/operating_system.rs deleted file mode 100644 index efdd3a8615..0000000000 --- a/packages/client-rust/src/models/operating_system.rs +++ /dev/null @@ -1,48 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// 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\"} -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct OperatingSystem { - #[serde(rename = "family")] - pub family: models::DeviceFactsOsFamily, - /// Operating System name, such as 'Server 2022' or 'Ubuntu' - #[serde(rename = "name", skip_serializing_if = "Option::is_none")] - pub name: Option, - /// Operating System version, must always be the version number but may contain build name - #[serde(rename = "version", skip_serializing_if = "Option::is_none")] - pub version: Option, - #[serde(rename = "arch", skip_serializing_if = "Option::is_none")] - pub arch: Option, -} - -impl 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\"} - pub fn new(family: models::DeviceFactsOsFamily) -> OperatingSystem { - OperatingSystem { - family, - name: None, - version: None, - arch: None, - } - } -} diff --git a/packages/client-rust/src/models/operating_system_request.rs b/packages/client-rust/src/models/operating_system_request.rs deleted file mode 100644 index 45202a2776..0000000000 --- a/packages/client-rust/src/models/operating_system_request.rs +++ /dev/null @@ -1,49 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// 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\"} -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct OperatingSystemRequest { - #[serde(rename = "family")] - pub family: models::DeviceFactsOsFamily, - /// Operating System name, such as 'Server 2022' or 'Ubuntu' - #[serde(rename = "name", skip_serializing_if = "Option::is_none")] - pub name: Option, - /// Operating System version, must always be the version number but may contain build name - #[serde(rename = "version", skip_serializing_if = "Option::is_none")] - pub version: Option, - #[serde(rename = "arch", skip_serializing_if = "Option::is_none")] - pub arch: Option, -} - -impl 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\"} - pub fn new(family: models::DeviceFactsOsFamily) -> OperatingSystemRequest { - OperatingSystemRequest { - family, - name: None, - version: None, - arch: None, - } - } -} diff --git a/packages/client-rust/src/models/outgoing_sync_delete_action.rs b/packages/client-rust/src/models/outgoing_sync_delete_action.rs deleted file mode 100644 index 6ac24059e8..0000000000 --- a/packages/client-rust/src/models/outgoing_sync_delete_action.rs +++ /dev/null @@ -1,38 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// -#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] -pub enum OutgoingSyncDeleteAction { - #[serde(rename = "do_nothing")] - DoNothing, - #[serde(rename = "delete")] - Delete, - #[serde(rename = "suspend")] - Suspend, -} - -impl std::fmt::Display for OutgoingSyncDeleteAction { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - match self { - Self::DoNothing => write!(f, "do_nothing"), - Self::Delete => write!(f, "delete"), - Self::Suspend => write!(f, "suspend"), - } - } -} - -impl Default for OutgoingSyncDeleteAction { - fn default() -> OutgoingSyncDeleteAction { - Self::DoNothing - } -} diff --git a/packages/client-rust/src/models/outpost_default_config.rs b/packages/client-rust/src/models/outpost_default_config.rs deleted file mode 100644 index e3b0e16586..0000000000 --- a/packages/client-rust/src/models/outpost_default_config.rs +++ /dev/null @@ -1,27 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// OutpostDefaultConfig : Global default outpost config -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct OutpostDefaultConfig { - #[serde(rename = "config")] - pub config: std::collections::HashMap, -} - -impl OutpostDefaultConfig { - /// Global default outpost config - pub fn new( - config: std::collections::HashMap, - ) -> OutpostDefaultConfig { - OutpostDefaultConfig { config } - } -} diff --git a/packages/client-rust/src/models/outpost_health.rs b/packages/client-rust/src/models/outpost_health.rs deleted file mode 100644 index 7a12c92f2d..0000000000 --- a/packages/client-rust/src/models/outpost_health.rs +++ /dev/null @@ -1,74 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// OutpostHealth : Outpost health status -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct OutpostHealth { - #[serde(rename = "uid")] - pub uid: String, - #[serde(rename = "last_seen")] - pub last_seen: String, - #[serde(rename = "version")] - pub version: String, - #[serde(rename = "golang_version")] - pub golang_version: String, - #[serde(rename = "openssl_enabled")] - pub openssl_enabled: bool, - #[serde(rename = "openssl_version")] - pub openssl_version: String, - /// Get FIPS enabled - #[serde(rename = "fips_enabled", deserialize_with = "Option::deserialize")] - pub fips_enabled: Option, - #[serde(rename = "version_should")] - pub version_should: String, - #[serde(rename = "version_outdated")] - pub version_outdated: bool, - #[serde(rename = "build_hash")] - pub build_hash: String, - #[serde(rename = "build_hash_should")] - pub build_hash_should: String, - #[serde(rename = "hostname")] - pub hostname: String, -} - -impl OutpostHealth { - /// Outpost health status - pub fn new( - uid: String, - last_seen: String, - version: String, - golang_version: String, - openssl_enabled: bool, - openssl_version: String, - fips_enabled: Option, - version_should: String, - version_outdated: bool, - build_hash: String, - build_hash_should: String, - hostname: String, - ) -> OutpostHealth { - OutpostHealth { - uid, - last_seen, - version, - golang_version, - openssl_enabled, - openssl_version, - fips_enabled, - version_should, - version_outdated, - build_hash, - build_hash_should, - hostname, - } - } -} diff --git a/packages/client-rust/src/models/outpost_request.rs b/packages/client-rust/src/models/outpost_request.rs deleted file mode 100644 index 263e40ea0e..0000000000 --- a/packages/client-rust/src/models/outpost_request.rs +++ /dev/null @@ -1,62 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// OutpostRequest : Outpost Serializer -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct OutpostRequest { - #[serde(rename = "name")] - pub name: String, - #[serde(rename = "type")] - pub r#type: models::OutpostTypeEnum, - #[serde(rename = "providers")] - pub providers: Vec, - /// Select Service-Connection authentik should use to manage this outpost. Leave empty if - /// authentik should not handle the deployment. - #[serde( - rename = "service_connection", - default, - with = "::serde_with::rust::double_option", - skip_serializing_if = "Option::is_none" - )] - pub service_connection: Option>, - #[serde(rename = "config")] - pub config: std::collections::HashMap, - /// 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. - #[serde( - rename = "managed", - default, - with = "::serde_with::rust::double_option", - skip_serializing_if = "Option::is_none" - )] - pub managed: Option>, -} - -impl OutpostRequest { - /// Outpost Serializer - pub fn new( - name: String, - r#type: models::OutpostTypeEnum, - providers: Vec, - config: std::collections::HashMap, - ) -> OutpostRequest { - OutpostRequest { - name, - r#type, - providers, - service_connection: None, - config, - managed: None, - } - } -} diff --git a/packages/client-rust/src/models/paginated_agent_connector_list.rs b/packages/client-rust/src/models/paginated_agent_connector_list.rs deleted file mode 100644 index e698358bbe..0000000000 --- a/packages/client-rust/src/models/paginated_agent_connector_list.rs +++ /dev/null @@ -1,35 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct PaginatedAgentConnectorList { - #[serde(rename = "pagination")] - pub pagination: models::Pagination, - #[serde(rename = "results")] - pub results: Vec, - #[serde(rename = "autocomplete")] - pub autocomplete: std::collections::HashMap, -} - -impl PaginatedAgentConnectorList { - pub fn new( - pagination: models::Pagination, - results: Vec, - autocomplete: std::collections::HashMap, - ) -> PaginatedAgentConnectorList { - PaginatedAgentConnectorList { - pagination, - results, - autocomplete, - } - } -} diff --git a/packages/client-rust/src/models/paginated_application_entitlement_list.rs b/packages/client-rust/src/models/paginated_application_entitlement_list.rs deleted file mode 100644 index e94fda99a3..0000000000 --- a/packages/client-rust/src/models/paginated_application_entitlement_list.rs +++ /dev/null @@ -1,35 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct PaginatedApplicationEntitlementList { - #[serde(rename = "pagination")] - pub pagination: models::Pagination, - #[serde(rename = "results")] - pub results: Vec, - #[serde(rename = "autocomplete")] - pub autocomplete: std::collections::HashMap, -} - -impl PaginatedApplicationEntitlementList { - pub fn new( - pagination: models::Pagination, - results: Vec, - autocomplete: std::collections::HashMap, - ) -> PaginatedApplicationEntitlementList { - PaginatedApplicationEntitlementList { - pagination, - results, - autocomplete, - } - } -} diff --git a/packages/client-rust/src/models/paginated_application_list.rs b/packages/client-rust/src/models/paginated_application_list.rs deleted file mode 100644 index eb446a1dff..0000000000 --- a/packages/client-rust/src/models/paginated_application_list.rs +++ /dev/null @@ -1,35 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct PaginatedApplicationList { - #[serde(rename = "pagination")] - pub pagination: models::Pagination, - #[serde(rename = "results")] - pub results: Vec, - #[serde(rename = "autocomplete")] - pub autocomplete: std::collections::HashMap, -} - -impl PaginatedApplicationList { - pub fn new( - pagination: models::Pagination, - results: Vec, - autocomplete: std::collections::HashMap, - ) -> PaginatedApplicationList { - PaginatedApplicationList { - pagination, - results, - autocomplete, - } - } -} diff --git a/packages/client-rust/src/models/paginated_authenticated_session_list.rs b/packages/client-rust/src/models/paginated_authenticated_session_list.rs deleted file mode 100644 index cf0dda0381..0000000000 --- a/packages/client-rust/src/models/paginated_authenticated_session_list.rs +++ /dev/null @@ -1,35 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct PaginatedAuthenticatedSessionList { - #[serde(rename = "pagination")] - pub pagination: models::Pagination, - #[serde(rename = "results")] - pub results: Vec, - #[serde(rename = "autocomplete")] - pub autocomplete: std::collections::HashMap, -} - -impl PaginatedAuthenticatedSessionList { - pub fn new( - pagination: models::Pagination, - results: Vec, - autocomplete: std::collections::HashMap, - ) -> PaginatedAuthenticatedSessionList { - PaginatedAuthenticatedSessionList { - pagination, - results, - autocomplete, - } - } -} diff --git a/packages/client-rust/src/models/paginated_authenticator_duo_stage_list.rs b/packages/client-rust/src/models/paginated_authenticator_duo_stage_list.rs deleted file mode 100644 index 7bf476a996..0000000000 --- a/packages/client-rust/src/models/paginated_authenticator_duo_stage_list.rs +++ /dev/null @@ -1,35 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct PaginatedAuthenticatorDuoStageList { - #[serde(rename = "pagination")] - pub pagination: models::Pagination, - #[serde(rename = "results")] - pub results: Vec, - #[serde(rename = "autocomplete")] - pub autocomplete: std::collections::HashMap, -} - -impl PaginatedAuthenticatorDuoStageList { - pub fn new( - pagination: models::Pagination, - results: Vec, - autocomplete: std::collections::HashMap, - ) -> PaginatedAuthenticatorDuoStageList { - PaginatedAuthenticatorDuoStageList { - pagination, - results, - autocomplete, - } - } -} diff --git a/packages/client-rust/src/models/paginated_authenticator_email_stage_list.rs b/packages/client-rust/src/models/paginated_authenticator_email_stage_list.rs deleted file mode 100644 index 1096a708ba..0000000000 --- a/packages/client-rust/src/models/paginated_authenticator_email_stage_list.rs +++ /dev/null @@ -1,35 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct PaginatedAuthenticatorEmailStageList { - #[serde(rename = "pagination")] - pub pagination: models::Pagination, - #[serde(rename = "results")] - pub results: Vec, - #[serde(rename = "autocomplete")] - pub autocomplete: std::collections::HashMap, -} - -impl PaginatedAuthenticatorEmailStageList { - pub fn new( - pagination: models::Pagination, - results: Vec, - autocomplete: std::collections::HashMap, - ) -> PaginatedAuthenticatorEmailStageList { - PaginatedAuthenticatorEmailStageList { - pagination, - results, - autocomplete, - } - } -} diff --git a/packages/client-rust/src/models/paginated_authenticator_endpoint_gdtc_stage_list.rs b/packages/client-rust/src/models/paginated_authenticator_endpoint_gdtc_stage_list.rs deleted file mode 100644 index 886f6883a9..0000000000 --- a/packages/client-rust/src/models/paginated_authenticator_endpoint_gdtc_stage_list.rs +++ /dev/null @@ -1,35 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct PaginatedAuthenticatorEndpointGdtcStageList { - #[serde(rename = "pagination")] - pub pagination: models::Pagination, - #[serde(rename = "results")] - pub results: Vec, - #[serde(rename = "autocomplete")] - pub autocomplete: std::collections::HashMap, -} - -impl PaginatedAuthenticatorEndpointGdtcStageList { - pub fn new( - pagination: models::Pagination, - results: Vec, - autocomplete: std::collections::HashMap, - ) -> PaginatedAuthenticatorEndpointGdtcStageList { - PaginatedAuthenticatorEndpointGdtcStageList { - pagination, - results, - autocomplete, - } - } -} diff --git a/packages/client-rust/src/models/paginated_authenticator_sms_stage_list.rs b/packages/client-rust/src/models/paginated_authenticator_sms_stage_list.rs deleted file mode 100644 index 8dcd294c53..0000000000 --- a/packages/client-rust/src/models/paginated_authenticator_sms_stage_list.rs +++ /dev/null @@ -1,35 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct PaginatedAuthenticatorSmsStageList { - #[serde(rename = "pagination")] - pub pagination: models::Pagination, - #[serde(rename = "results")] - pub results: Vec, - #[serde(rename = "autocomplete")] - pub autocomplete: std::collections::HashMap, -} - -impl PaginatedAuthenticatorSmsStageList { - pub fn new( - pagination: models::Pagination, - results: Vec, - autocomplete: std::collections::HashMap, - ) -> PaginatedAuthenticatorSmsStageList { - PaginatedAuthenticatorSmsStageList { - pagination, - results, - autocomplete, - } - } -} diff --git a/packages/client-rust/src/models/paginated_authenticator_static_stage_list.rs b/packages/client-rust/src/models/paginated_authenticator_static_stage_list.rs deleted file mode 100644 index 7444e9a592..0000000000 --- a/packages/client-rust/src/models/paginated_authenticator_static_stage_list.rs +++ /dev/null @@ -1,35 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct PaginatedAuthenticatorStaticStageList { - #[serde(rename = "pagination")] - pub pagination: models::Pagination, - #[serde(rename = "results")] - pub results: Vec, - #[serde(rename = "autocomplete")] - pub autocomplete: std::collections::HashMap, -} - -impl PaginatedAuthenticatorStaticStageList { - pub fn new( - pagination: models::Pagination, - results: Vec, - autocomplete: std::collections::HashMap, - ) -> PaginatedAuthenticatorStaticStageList { - PaginatedAuthenticatorStaticStageList { - pagination, - results, - autocomplete, - } - } -} diff --git a/packages/client-rust/src/models/paginated_authenticator_totp_stage_list.rs b/packages/client-rust/src/models/paginated_authenticator_totp_stage_list.rs deleted file mode 100644 index dea07a0812..0000000000 --- a/packages/client-rust/src/models/paginated_authenticator_totp_stage_list.rs +++ /dev/null @@ -1,35 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct PaginatedAuthenticatorTotpStageList { - #[serde(rename = "pagination")] - pub pagination: models::Pagination, - #[serde(rename = "results")] - pub results: Vec, - #[serde(rename = "autocomplete")] - pub autocomplete: std::collections::HashMap, -} - -impl PaginatedAuthenticatorTotpStageList { - pub fn new( - pagination: models::Pagination, - results: Vec, - autocomplete: std::collections::HashMap, - ) -> PaginatedAuthenticatorTotpStageList { - PaginatedAuthenticatorTotpStageList { - pagination, - results, - autocomplete, - } - } -} diff --git a/packages/client-rust/src/models/paginated_authenticator_validate_stage_list.rs b/packages/client-rust/src/models/paginated_authenticator_validate_stage_list.rs deleted file mode 100644 index 1691c59d2a..0000000000 --- a/packages/client-rust/src/models/paginated_authenticator_validate_stage_list.rs +++ /dev/null @@ -1,35 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct PaginatedAuthenticatorValidateStageList { - #[serde(rename = "pagination")] - pub pagination: models::Pagination, - #[serde(rename = "results")] - pub results: Vec, - #[serde(rename = "autocomplete")] - pub autocomplete: std::collections::HashMap, -} - -impl PaginatedAuthenticatorValidateStageList { - pub fn new( - pagination: models::Pagination, - results: Vec, - autocomplete: std::collections::HashMap, - ) -> PaginatedAuthenticatorValidateStageList { - PaginatedAuthenticatorValidateStageList { - pagination, - results, - autocomplete, - } - } -} diff --git a/packages/client-rust/src/models/paginated_authenticator_web_authn_stage_list.rs b/packages/client-rust/src/models/paginated_authenticator_web_authn_stage_list.rs deleted file mode 100644 index dd6abb87bc..0000000000 --- a/packages/client-rust/src/models/paginated_authenticator_web_authn_stage_list.rs +++ /dev/null @@ -1,35 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct PaginatedAuthenticatorWebAuthnStageList { - #[serde(rename = "pagination")] - pub pagination: models::Pagination, - #[serde(rename = "results")] - pub results: Vec, - #[serde(rename = "autocomplete")] - pub autocomplete: std::collections::HashMap, -} - -impl PaginatedAuthenticatorWebAuthnStageList { - pub fn new( - pagination: models::Pagination, - results: Vec, - autocomplete: std::collections::HashMap, - ) -> PaginatedAuthenticatorWebAuthnStageList { - PaginatedAuthenticatorWebAuthnStageList { - pagination, - results, - autocomplete, - } - } -} diff --git a/packages/client-rust/src/models/paginated_blueprint_instance_list.rs b/packages/client-rust/src/models/paginated_blueprint_instance_list.rs deleted file mode 100644 index 3b4ab6c96e..0000000000 --- a/packages/client-rust/src/models/paginated_blueprint_instance_list.rs +++ /dev/null @@ -1,35 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct PaginatedBlueprintInstanceList { - #[serde(rename = "pagination")] - pub pagination: models::Pagination, - #[serde(rename = "results")] - pub results: Vec, - #[serde(rename = "autocomplete")] - pub autocomplete: std::collections::HashMap, -} - -impl PaginatedBlueprintInstanceList { - pub fn new( - pagination: models::Pagination, - results: Vec, - autocomplete: std::collections::HashMap, - ) -> PaginatedBlueprintInstanceList { - PaginatedBlueprintInstanceList { - pagination, - results, - autocomplete, - } - } -} diff --git a/packages/client-rust/src/models/paginated_captcha_stage_list.rs b/packages/client-rust/src/models/paginated_captcha_stage_list.rs deleted file mode 100644 index 91dd769a15..0000000000 --- a/packages/client-rust/src/models/paginated_captcha_stage_list.rs +++ /dev/null @@ -1,35 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct PaginatedCaptchaStageList { - #[serde(rename = "pagination")] - pub pagination: models::Pagination, - #[serde(rename = "results")] - pub results: Vec, - #[serde(rename = "autocomplete")] - pub autocomplete: std::collections::HashMap, -} - -impl PaginatedCaptchaStageList { - pub fn new( - pagination: models::Pagination, - results: Vec, - autocomplete: std::collections::HashMap, - ) -> PaginatedCaptchaStageList { - PaginatedCaptchaStageList { - pagination, - results, - autocomplete, - } - } -} diff --git a/packages/client-rust/src/models/paginated_certificate_key_pair_list.rs b/packages/client-rust/src/models/paginated_certificate_key_pair_list.rs deleted file mode 100644 index fa4c9a2ba6..0000000000 --- a/packages/client-rust/src/models/paginated_certificate_key_pair_list.rs +++ /dev/null @@ -1,35 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct PaginatedCertificateKeyPairList { - #[serde(rename = "pagination")] - pub pagination: models::Pagination, - #[serde(rename = "results")] - pub results: Vec, - #[serde(rename = "autocomplete")] - pub autocomplete: std::collections::HashMap, -} - -impl PaginatedCertificateKeyPairList { - pub fn new( - pagination: models::Pagination, - results: Vec, - autocomplete: std::collections::HashMap, - ) -> PaginatedCertificateKeyPairList { - PaginatedCertificateKeyPairList { - pagination, - results, - autocomplete, - } - } -} diff --git a/packages/client-rust/src/models/paginated_connection_token_list.rs b/packages/client-rust/src/models/paginated_connection_token_list.rs deleted file mode 100644 index 1594ea3cac..0000000000 --- a/packages/client-rust/src/models/paginated_connection_token_list.rs +++ /dev/null @@ -1,35 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct PaginatedConnectionTokenList { - #[serde(rename = "pagination")] - pub pagination: models::Pagination, - #[serde(rename = "results")] - pub results: Vec, - #[serde(rename = "autocomplete")] - pub autocomplete: std::collections::HashMap, -} - -impl PaginatedConnectionTokenList { - pub fn new( - pagination: models::Pagination, - results: Vec, - autocomplete: std::collections::HashMap, - ) -> PaginatedConnectionTokenList { - PaginatedConnectionTokenList { - pagination, - results, - autocomplete, - } - } -} diff --git a/packages/client-rust/src/models/paginated_connector_list.rs b/packages/client-rust/src/models/paginated_connector_list.rs deleted file mode 100644 index 78e92279f9..0000000000 --- a/packages/client-rust/src/models/paginated_connector_list.rs +++ /dev/null @@ -1,35 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct PaginatedConnectorList { - #[serde(rename = "pagination")] - pub pagination: models::Pagination, - #[serde(rename = "results")] - pub results: Vec, - #[serde(rename = "autocomplete")] - pub autocomplete: std::collections::HashMap, -} - -impl PaginatedConnectorList { - pub fn new( - pagination: models::Pagination, - results: Vec, - autocomplete: std::collections::HashMap, - ) -> PaginatedConnectorList { - PaginatedConnectorList { - pagination, - results, - autocomplete, - } - } -} diff --git a/packages/client-rust/src/models/paginated_consent_stage_list.rs b/packages/client-rust/src/models/paginated_consent_stage_list.rs deleted file mode 100644 index 6c7084481d..0000000000 --- a/packages/client-rust/src/models/paginated_consent_stage_list.rs +++ /dev/null @@ -1,35 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct PaginatedConsentStageList { - #[serde(rename = "pagination")] - pub pagination: models::Pagination, - #[serde(rename = "results")] - pub results: Vec, - #[serde(rename = "autocomplete")] - pub autocomplete: std::collections::HashMap, -} - -impl PaginatedConsentStageList { - pub fn new( - pagination: models::Pagination, - results: Vec, - autocomplete: std::collections::HashMap, - ) -> PaginatedConsentStageList { - PaginatedConsentStageList { - pagination, - results, - autocomplete, - } - } -} diff --git a/packages/client-rust/src/models/paginated_data_export_list.rs b/packages/client-rust/src/models/paginated_data_export_list.rs deleted file mode 100644 index 1b2b99f692..0000000000 --- a/packages/client-rust/src/models/paginated_data_export_list.rs +++ /dev/null @@ -1,35 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct PaginatedDataExportList { - #[serde(rename = "pagination")] - pub pagination: models::Pagination, - #[serde(rename = "results")] - pub results: Vec, - #[serde(rename = "autocomplete")] - pub autocomplete: std::collections::HashMap, -} - -impl PaginatedDataExportList { - pub fn new( - pagination: models::Pagination, - results: Vec, - autocomplete: std::collections::HashMap, - ) -> PaginatedDataExportList { - PaginatedDataExportList { - pagination, - results, - autocomplete, - } - } -} diff --git a/packages/client-rust/src/models/paginated_deny_stage_list.rs b/packages/client-rust/src/models/paginated_deny_stage_list.rs deleted file mode 100644 index 7435489f75..0000000000 --- a/packages/client-rust/src/models/paginated_deny_stage_list.rs +++ /dev/null @@ -1,35 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct PaginatedDenyStageList { - #[serde(rename = "pagination")] - pub pagination: models::Pagination, - #[serde(rename = "results")] - pub results: Vec, - #[serde(rename = "autocomplete")] - pub autocomplete: std::collections::HashMap, -} - -impl PaginatedDenyStageList { - pub fn new( - pagination: models::Pagination, - results: Vec, - autocomplete: std::collections::HashMap, - ) -> PaginatedDenyStageList { - PaginatedDenyStageList { - pagination, - results, - autocomplete, - } - } -} diff --git a/packages/client-rust/src/models/paginated_device_access_group_list.rs b/packages/client-rust/src/models/paginated_device_access_group_list.rs deleted file mode 100644 index ad5592f2a5..0000000000 --- a/packages/client-rust/src/models/paginated_device_access_group_list.rs +++ /dev/null @@ -1,35 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct PaginatedDeviceAccessGroupList { - #[serde(rename = "pagination")] - pub pagination: models::Pagination, - #[serde(rename = "results")] - pub results: Vec, - #[serde(rename = "autocomplete")] - pub autocomplete: std::collections::HashMap, -} - -impl PaginatedDeviceAccessGroupList { - pub fn new( - pagination: models::Pagination, - results: Vec, - autocomplete: std::collections::HashMap, - ) -> PaginatedDeviceAccessGroupList { - PaginatedDeviceAccessGroupList { - pagination, - results, - autocomplete, - } - } -} diff --git a/packages/client-rust/src/models/paginated_device_user_binding_list.rs b/packages/client-rust/src/models/paginated_device_user_binding_list.rs deleted file mode 100644 index f2ef4252e7..0000000000 --- a/packages/client-rust/src/models/paginated_device_user_binding_list.rs +++ /dev/null @@ -1,35 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct PaginatedDeviceUserBindingList { - #[serde(rename = "pagination")] - pub pagination: models::Pagination, - #[serde(rename = "results")] - pub results: Vec, - #[serde(rename = "autocomplete")] - pub autocomplete: std::collections::HashMap, -} - -impl PaginatedDeviceUserBindingList { - pub fn new( - pagination: models::Pagination, - results: Vec, - autocomplete: std::collections::HashMap, - ) -> PaginatedDeviceUserBindingList { - PaginatedDeviceUserBindingList { - pagination, - results, - autocomplete, - } - } -} diff --git a/packages/client-rust/src/models/paginated_docker_service_connection_list.rs b/packages/client-rust/src/models/paginated_docker_service_connection_list.rs deleted file mode 100644 index 7f99f5d8d6..0000000000 --- a/packages/client-rust/src/models/paginated_docker_service_connection_list.rs +++ /dev/null @@ -1,35 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct PaginatedDockerServiceConnectionList { - #[serde(rename = "pagination")] - pub pagination: models::Pagination, - #[serde(rename = "results")] - pub results: Vec, - #[serde(rename = "autocomplete")] - pub autocomplete: std::collections::HashMap, -} - -impl PaginatedDockerServiceConnectionList { - pub fn new( - pagination: models::Pagination, - results: Vec, - autocomplete: std::collections::HashMap, - ) -> PaginatedDockerServiceConnectionList { - PaginatedDockerServiceConnectionList { - pagination, - results, - autocomplete, - } - } -} diff --git a/packages/client-rust/src/models/paginated_domain_list.rs b/packages/client-rust/src/models/paginated_domain_list.rs deleted file mode 100644 index a8f5a5ec99..0000000000 --- a/packages/client-rust/src/models/paginated_domain_list.rs +++ /dev/null @@ -1,35 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct PaginatedDomainList { - #[serde(rename = "pagination")] - pub pagination: models::Pagination, - #[serde(rename = "results")] - pub results: Vec, - #[serde(rename = "autocomplete")] - pub autocomplete: std::collections::HashMap, -} - -impl PaginatedDomainList { - pub fn new( - pagination: models::Pagination, - results: Vec, - autocomplete: std::collections::HashMap, - ) -> PaginatedDomainList { - PaginatedDomainList { - pagination, - results, - autocomplete, - } - } -} diff --git a/packages/client-rust/src/models/paginated_dummy_policy_list.rs b/packages/client-rust/src/models/paginated_dummy_policy_list.rs deleted file mode 100644 index 487eecd1bb..0000000000 --- a/packages/client-rust/src/models/paginated_dummy_policy_list.rs +++ /dev/null @@ -1,35 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct PaginatedDummyPolicyList { - #[serde(rename = "pagination")] - pub pagination: models::Pagination, - #[serde(rename = "results")] - pub results: Vec, - #[serde(rename = "autocomplete")] - pub autocomplete: std::collections::HashMap, -} - -impl PaginatedDummyPolicyList { - pub fn new( - pagination: models::Pagination, - results: Vec, - autocomplete: std::collections::HashMap, - ) -> PaginatedDummyPolicyList { - PaginatedDummyPolicyList { - pagination, - results, - autocomplete, - } - } -} diff --git a/packages/client-rust/src/models/paginated_dummy_stage_list.rs b/packages/client-rust/src/models/paginated_dummy_stage_list.rs deleted file mode 100644 index 4ed5585605..0000000000 --- a/packages/client-rust/src/models/paginated_dummy_stage_list.rs +++ /dev/null @@ -1,35 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct PaginatedDummyStageList { - #[serde(rename = "pagination")] - pub pagination: models::Pagination, - #[serde(rename = "results")] - pub results: Vec, - #[serde(rename = "autocomplete")] - pub autocomplete: std::collections::HashMap, -} - -impl PaginatedDummyStageList { - pub fn new( - pagination: models::Pagination, - results: Vec, - autocomplete: std::collections::HashMap, - ) -> PaginatedDummyStageList { - PaginatedDummyStageList { - pagination, - results, - autocomplete, - } - } -} diff --git a/packages/client-rust/src/models/paginated_duo_device_list.rs b/packages/client-rust/src/models/paginated_duo_device_list.rs deleted file mode 100644 index 2f08450eea..0000000000 --- a/packages/client-rust/src/models/paginated_duo_device_list.rs +++ /dev/null @@ -1,35 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct PaginatedDuoDeviceList { - #[serde(rename = "pagination")] - pub pagination: models::Pagination, - #[serde(rename = "results")] - pub results: Vec, - #[serde(rename = "autocomplete")] - pub autocomplete: std::collections::HashMap, -} - -impl PaginatedDuoDeviceList { - pub fn new( - pagination: models::Pagination, - results: Vec, - autocomplete: std::collections::HashMap, - ) -> PaginatedDuoDeviceList { - PaginatedDuoDeviceList { - pagination, - results, - autocomplete, - } - } -} diff --git a/packages/client-rust/src/models/paginated_email_device_list.rs b/packages/client-rust/src/models/paginated_email_device_list.rs deleted file mode 100644 index ac91841e8b..0000000000 --- a/packages/client-rust/src/models/paginated_email_device_list.rs +++ /dev/null @@ -1,35 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct PaginatedEmailDeviceList { - #[serde(rename = "pagination")] - pub pagination: models::Pagination, - #[serde(rename = "results")] - pub results: Vec, - #[serde(rename = "autocomplete")] - pub autocomplete: std::collections::HashMap, -} - -impl PaginatedEmailDeviceList { - pub fn new( - pagination: models::Pagination, - results: Vec, - autocomplete: std::collections::HashMap, - ) -> PaginatedEmailDeviceList { - PaginatedEmailDeviceList { - pagination, - results, - autocomplete, - } - } -} diff --git a/packages/client-rust/src/models/paginated_email_stage_list.rs b/packages/client-rust/src/models/paginated_email_stage_list.rs deleted file mode 100644 index a2c442c158..0000000000 --- a/packages/client-rust/src/models/paginated_email_stage_list.rs +++ /dev/null @@ -1,35 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct PaginatedEmailStageList { - #[serde(rename = "pagination")] - pub pagination: models::Pagination, - #[serde(rename = "results")] - pub results: Vec, - #[serde(rename = "autocomplete")] - pub autocomplete: std::collections::HashMap, -} - -impl PaginatedEmailStageList { - pub fn new( - pagination: models::Pagination, - results: Vec, - autocomplete: std::collections::HashMap, - ) -> PaginatedEmailStageList { - PaginatedEmailStageList { - pagination, - results, - autocomplete, - } - } -} diff --git a/packages/client-rust/src/models/paginated_endpoint_device_list.rs b/packages/client-rust/src/models/paginated_endpoint_device_list.rs deleted file mode 100644 index 6fdb34ce8e..0000000000 --- a/packages/client-rust/src/models/paginated_endpoint_device_list.rs +++ /dev/null @@ -1,35 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct PaginatedEndpointDeviceList { - #[serde(rename = "pagination")] - pub pagination: models::Pagination, - #[serde(rename = "results")] - pub results: Vec, - #[serde(rename = "autocomplete")] - pub autocomplete: std::collections::HashMap, -} - -impl PaginatedEndpointDeviceList { - pub fn new( - pagination: models::Pagination, - results: Vec, - autocomplete: std::collections::HashMap, - ) -> PaginatedEndpointDeviceList { - PaginatedEndpointDeviceList { - pagination, - results, - autocomplete, - } - } -} diff --git a/packages/client-rust/src/models/paginated_endpoint_list.rs b/packages/client-rust/src/models/paginated_endpoint_list.rs deleted file mode 100644 index f4b153ecb1..0000000000 --- a/packages/client-rust/src/models/paginated_endpoint_list.rs +++ /dev/null @@ -1,35 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct PaginatedEndpointList { - #[serde(rename = "pagination")] - pub pagination: models::Pagination, - #[serde(rename = "results")] - pub results: Vec, - #[serde(rename = "autocomplete")] - pub autocomplete: std::collections::HashMap, -} - -impl PaginatedEndpointList { - pub fn new( - pagination: models::Pagination, - results: Vec, - autocomplete: std::collections::HashMap, - ) -> PaginatedEndpointList { - PaginatedEndpointList { - pagination, - results, - autocomplete, - } - } -} diff --git a/packages/client-rust/src/models/paginated_endpoint_stage_list.rs b/packages/client-rust/src/models/paginated_endpoint_stage_list.rs deleted file mode 100644 index 6e338d9c9f..0000000000 --- a/packages/client-rust/src/models/paginated_endpoint_stage_list.rs +++ /dev/null @@ -1,35 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct PaginatedEndpointStageList { - #[serde(rename = "pagination")] - pub pagination: models::Pagination, - #[serde(rename = "results")] - pub results: Vec, - #[serde(rename = "autocomplete")] - pub autocomplete: std::collections::HashMap, -} - -impl PaginatedEndpointStageList { - pub fn new( - pagination: models::Pagination, - results: Vec, - autocomplete: std::collections::HashMap, - ) -> PaginatedEndpointStageList { - PaginatedEndpointStageList { - pagination, - results, - autocomplete, - } - } -} diff --git a/packages/client-rust/src/models/paginated_enrollment_token_list.rs b/packages/client-rust/src/models/paginated_enrollment_token_list.rs deleted file mode 100644 index a6a39431dd..0000000000 --- a/packages/client-rust/src/models/paginated_enrollment_token_list.rs +++ /dev/null @@ -1,35 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct PaginatedEnrollmentTokenList { - #[serde(rename = "pagination")] - pub pagination: models::Pagination, - #[serde(rename = "results")] - pub results: Vec, - #[serde(rename = "autocomplete")] - pub autocomplete: std::collections::HashMap, -} - -impl PaginatedEnrollmentTokenList { - pub fn new( - pagination: models::Pagination, - results: Vec, - autocomplete: std::collections::HashMap, - ) -> PaginatedEnrollmentTokenList { - PaginatedEnrollmentTokenList { - pagination, - results, - autocomplete, - } - } -} diff --git a/packages/client-rust/src/models/paginated_event_list.rs b/packages/client-rust/src/models/paginated_event_list.rs deleted file mode 100644 index f2a8f422f2..0000000000 --- a/packages/client-rust/src/models/paginated_event_list.rs +++ /dev/null @@ -1,35 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct PaginatedEventList { - #[serde(rename = "pagination")] - pub pagination: models::Pagination, - #[serde(rename = "results")] - pub results: Vec, - #[serde(rename = "autocomplete")] - pub autocomplete: std::collections::HashMap, -} - -impl PaginatedEventList { - pub fn new( - pagination: models::Pagination, - results: Vec, - autocomplete: std::collections::HashMap, - ) -> PaginatedEventList { - PaginatedEventList { - pagination, - results, - autocomplete, - } - } -} diff --git a/packages/client-rust/src/models/paginated_event_matcher_policy_list.rs b/packages/client-rust/src/models/paginated_event_matcher_policy_list.rs deleted file mode 100644 index fd9a196060..0000000000 --- a/packages/client-rust/src/models/paginated_event_matcher_policy_list.rs +++ /dev/null @@ -1,35 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct PaginatedEventMatcherPolicyList { - #[serde(rename = "pagination")] - pub pagination: models::Pagination, - #[serde(rename = "results")] - pub results: Vec, - #[serde(rename = "autocomplete")] - pub autocomplete: std::collections::HashMap, -} - -impl PaginatedEventMatcherPolicyList { - pub fn new( - pagination: models::Pagination, - results: Vec, - autocomplete: std::collections::HashMap, - ) -> PaginatedEventMatcherPolicyList { - PaginatedEventMatcherPolicyList { - pagination, - results, - autocomplete, - } - } -} diff --git a/packages/client-rust/src/models/paginated_expiring_base_grant_model_list.rs b/packages/client-rust/src/models/paginated_expiring_base_grant_model_list.rs deleted file mode 100644 index 9885f3a053..0000000000 --- a/packages/client-rust/src/models/paginated_expiring_base_grant_model_list.rs +++ /dev/null @@ -1,35 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct PaginatedExpiringBaseGrantModelList { - #[serde(rename = "pagination")] - pub pagination: models::Pagination, - #[serde(rename = "results")] - pub results: Vec, - #[serde(rename = "autocomplete")] - pub autocomplete: std::collections::HashMap, -} - -impl PaginatedExpiringBaseGrantModelList { - pub fn new( - pagination: models::Pagination, - results: Vec, - autocomplete: std::collections::HashMap, - ) -> PaginatedExpiringBaseGrantModelList { - PaginatedExpiringBaseGrantModelList { - pagination, - results, - autocomplete, - } - } -} diff --git a/packages/client-rust/src/models/paginated_expression_policy_list.rs b/packages/client-rust/src/models/paginated_expression_policy_list.rs deleted file mode 100644 index 8b36897915..0000000000 --- a/packages/client-rust/src/models/paginated_expression_policy_list.rs +++ /dev/null @@ -1,35 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct PaginatedExpressionPolicyList { - #[serde(rename = "pagination")] - pub pagination: models::Pagination, - #[serde(rename = "results")] - pub results: Vec, - #[serde(rename = "autocomplete")] - pub autocomplete: std::collections::HashMap, -} - -impl PaginatedExpressionPolicyList { - pub fn new( - pagination: models::Pagination, - results: Vec, - autocomplete: std::collections::HashMap, - ) -> PaginatedExpressionPolicyList { - PaginatedExpressionPolicyList { - pagination, - results, - autocomplete, - } - } -} diff --git a/packages/client-rust/src/models/paginated_extra_role_object_permission_list.rs b/packages/client-rust/src/models/paginated_extra_role_object_permission_list.rs deleted file mode 100644 index e3c57893d4..0000000000 --- a/packages/client-rust/src/models/paginated_extra_role_object_permission_list.rs +++ /dev/null @@ -1,35 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct PaginatedExtraRoleObjectPermissionList { - #[serde(rename = "pagination")] - pub pagination: models::Pagination, - #[serde(rename = "results")] - pub results: Vec, - #[serde(rename = "autocomplete")] - pub autocomplete: std::collections::HashMap, -} - -impl PaginatedExtraRoleObjectPermissionList { - pub fn new( - pagination: models::Pagination, - results: Vec, - autocomplete: std::collections::HashMap, - ) -> PaginatedExtraRoleObjectPermissionList { - PaginatedExtraRoleObjectPermissionList { - pagination, - results, - autocomplete, - } - } -} diff --git a/packages/client-rust/src/models/paginated_fleet_connector_list.rs b/packages/client-rust/src/models/paginated_fleet_connector_list.rs deleted file mode 100644 index de0fa98374..0000000000 --- a/packages/client-rust/src/models/paginated_fleet_connector_list.rs +++ /dev/null @@ -1,35 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct PaginatedFleetConnectorList { - #[serde(rename = "pagination")] - pub pagination: models::Pagination, - #[serde(rename = "results")] - pub results: Vec, - #[serde(rename = "autocomplete")] - pub autocomplete: std::collections::HashMap, -} - -impl PaginatedFleetConnectorList { - pub fn new( - pagination: models::Pagination, - results: Vec, - autocomplete: std::collections::HashMap, - ) -> PaginatedFleetConnectorList { - PaginatedFleetConnectorList { - pagination, - results, - autocomplete, - } - } -} diff --git a/packages/client-rust/src/models/paginated_flow_list.rs b/packages/client-rust/src/models/paginated_flow_list.rs deleted file mode 100644 index 312f0394b6..0000000000 --- a/packages/client-rust/src/models/paginated_flow_list.rs +++ /dev/null @@ -1,35 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct PaginatedFlowList { - #[serde(rename = "pagination")] - pub pagination: models::Pagination, - #[serde(rename = "results")] - pub results: Vec, - #[serde(rename = "autocomplete")] - pub autocomplete: std::collections::HashMap, -} - -impl PaginatedFlowList { - pub fn new( - pagination: models::Pagination, - results: Vec, - autocomplete: std::collections::HashMap, - ) -> PaginatedFlowList { - PaginatedFlowList { - pagination, - results, - autocomplete, - } - } -} diff --git a/packages/client-rust/src/models/paginated_flow_stage_binding_list.rs b/packages/client-rust/src/models/paginated_flow_stage_binding_list.rs deleted file mode 100644 index 8d2420744d..0000000000 --- a/packages/client-rust/src/models/paginated_flow_stage_binding_list.rs +++ /dev/null @@ -1,35 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct PaginatedFlowStageBindingList { - #[serde(rename = "pagination")] - pub pagination: models::Pagination, - #[serde(rename = "results")] - pub results: Vec, - #[serde(rename = "autocomplete")] - pub autocomplete: std::collections::HashMap, -} - -impl PaginatedFlowStageBindingList { - pub fn new( - pagination: models::Pagination, - results: Vec, - autocomplete: std::collections::HashMap, - ) -> PaginatedFlowStageBindingList { - PaginatedFlowStageBindingList { - pagination, - results, - autocomplete, - } - } -} diff --git a/packages/client-rust/src/models/paginated_geo_ip_policy_list.rs b/packages/client-rust/src/models/paginated_geo_ip_policy_list.rs deleted file mode 100644 index d7a9a70234..0000000000 --- a/packages/client-rust/src/models/paginated_geo_ip_policy_list.rs +++ /dev/null @@ -1,35 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct PaginatedGeoIpPolicyList { - #[serde(rename = "pagination")] - pub pagination: models::Pagination, - #[serde(rename = "results")] - pub results: Vec, - #[serde(rename = "autocomplete")] - pub autocomplete: std::collections::HashMap, -} - -impl PaginatedGeoIpPolicyList { - pub fn new( - pagination: models::Pagination, - results: Vec, - autocomplete: std::collections::HashMap, - ) -> PaginatedGeoIpPolicyList { - PaginatedGeoIpPolicyList { - pagination, - results, - autocomplete, - } - } -} diff --git a/packages/client-rust/src/models/paginated_google_chrome_connector_list.rs b/packages/client-rust/src/models/paginated_google_chrome_connector_list.rs deleted file mode 100644 index 190e2aeb93..0000000000 --- a/packages/client-rust/src/models/paginated_google_chrome_connector_list.rs +++ /dev/null @@ -1,35 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct PaginatedGoogleChromeConnectorList { - #[serde(rename = "pagination")] - pub pagination: models::Pagination, - #[serde(rename = "results")] - pub results: Vec, - #[serde(rename = "autocomplete")] - pub autocomplete: std::collections::HashMap, -} - -impl PaginatedGoogleChromeConnectorList { - pub fn new( - pagination: models::Pagination, - results: Vec, - autocomplete: std::collections::HashMap, - ) -> PaginatedGoogleChromeConnectorList { - PaginatedGoogleChromeConnectorList { - pagination, - results, - autocomplete, - } - } -} diff --git a/packages/client-rust/src/models/paginated_google_endpoint_device_list.rs b/packages/client-rust/src/models/paginated_google_endpoint_device_list.rs deleted file mode 100644 index fc4c354fd0..0000000000 --- a/packages/client-rust/src/models/paginated_google_endpoint_device_list.rs +++ /dev/null @@ -1,35 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct PaginatedGoogleEndpointDeviceList { - #[serde(rename = "pagination")] - pub pagination: models::Pagination, - #[serde(rename = "results")] - pub results: Vec, - #[serde(rename = "autocomplete")] - pub autocomplete: std::collections::HashMap, -} - -impl PaginatedGoogleEndpointDeviceList { - pub fn new( - pagination: models::Pagination, - results: Vec, - autocomplete: std::collections::HashMap, - ) -> PaginatedGoogleEndpointDeviceList { - PaginatedGoogleEndpointDeviceList { - pagination, - results, - autocomplete, - } - } -} diff --git a/packages/client-rust/src/models/paginated_google_workspace_provider_group_list.rs b/packages/client-rust/src/models/paginated_google_workspace_provider_group_list.rs deleted file mode 100644 index 4d9a177065..0000000000 --- a/packages/client-rust/src/models/paginated_google_workspace_provider_group_list.rs +++ /dev/null @@ -1,35 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct PaginatedGoogleWorkspaceProviderGroupList { - #[serde(rename = "pagination")] - pub pagination: models::Pagination, - #[serde(rename = "results")] - pub results: Vec, - #[serde(rename = "autocomplete")] - pub autocomplete: std::collections::HashMap, -} - -impl PaginatedGoogleWorkspaceProviderGroupList { - pub fn new( - pagination: models::Pagination, - results: Vec, - autocomplete: std::collections::HashMap, - ) -> PaginatedGoogleWorkspaceProviderGroupList { - PaginatedGoogleWorkspaceProviderGroupList { - pagination, - results, - autocomplete, - } - } -} diff --git a/packages/client-rust/src/models/paginated_google_workspace_provider_list.rs b/packages/client-rust/src/models/paginated_google_workspace_provider_list.rs deleted file mode 100644 index ce0e65331f..0000000000 --- a/packages/client-rust/src/models/paginated_google_workspace_provider_list.rs +++ /dev/null @@ -1,35 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct PaginatedGoogleWorkspaceProviderList { - #[serde(rename = "pagination")] - pub pagination: models::Pagination, - #[serde(rename = "results")] - pub results: Vec, - #[serde(rename = "autocomplete")] - pub autocomplete: std::collections::HashMap, -} - -impl PaginatedGoogleWorkspaceProviderList { - pub fn new( - pagination: models::Pagination, - results: Vec, - autocomplete: std::collections::HashMap, - ) -> PaginatedGoogleWorkspaceProviderList { - PaginatedGoogleWorkspaceProviderList { - pagination, - results, - autocomplete, - } - } -} diff --git a/packages/client-rust/src/models/paginated_google_workspace_provider_mapping_list.rs b/packages/client-rust/src/models/paginated_google_workspace_provider_mapping_list.rs deleted file mode 100644 index 1afa06dc2a..0000000000 --- a/packages/client-rust/src/models/paginated_google_workspace_provider_mapping_list.rs +++ /dev/null @@ -1,35 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct PaginatedGoogleWorkspaceProviderMappingList { - #[serde(rename = "pagination")] - pub pagination: models::Pagination, - #[serde(rename = "results")] - pub results: Vec, - #[serde(rename = "autocomplete")] - pub autocomplete: std::collections::HashMap, -} - -impl PaginatedGoogleWorkspaceProviderMappingList { - pub fn new( - pagination: models::Pagination, - results: Vec, - autocomplete: std::collections::HashMap, - ) -> PaginatedGoogleWorkspaceProviderMappingList { - PaginatedGoogleWorkspaceProviderMappingList { - pagination, - results, - autocomplete, - } - } -} diff --git a/packages/client-rust/src/models/paginated_google_workspace_provider_user_list.rs b/packages/client-rust/src/models/paginated_google_workspace_provider_user_list.rs deleted file mode 100644 index 7c044e9e43..0000000000 --- a/packages/client-rust/src/models/paginated_google_workspace_provider_user_list.rs +++ /dev/null @@ -1,35 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct PaginatedGoogleWorkspaceProviderUserList { - #[serde(rename = "pagination")] - pub pagination: models::Pagination, - #[serde(rename = "results")] - pub results: Vec, - #[serde(rename = "autocomplete")] - pub autocomplete: std::collections::HashMap, -} - -impl PaginatedGoogleWorkspaceProviderUserList { - pub fn new( - pagination: models::Pagination, - results: Vec, - autocomplete: std::collections::HashMap, - ) -> PaginatedGoogleWorkspaceProviderUserList { - PaginatedGoogleWorkspaceProviderUserList { - pagination, - results, - autocomplete, - } - } -} diff --git a/packages/client-rust/src/models/paginated_group_kerberos_source_connection_list.rs b/packages/client-rust/src/models/paginated_group_kerberos_source_connection_list.rs deleted file mode 100644 index fc48c3eea0..0000000000 --- a/packages/client-rust/src/models/paginated_group_kerberos_source_connection_list.rs +++ /dev/null @@ -1,35 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct PaginatedGroupKerberosSourceConnectionList { - #[serde(rename = "pagination")] - pub pagination: models::Pagination, - #[serde(rename = "results")] - pub results: Vec, - #[serde(rename = "autocomplete")] - pub autocomplete: std::collections::HashMap, -} - -impl PaginatedGroupKerberosSourceConnectionList { - pub fn new( - pagination: models::Pagination, - results: Vec, - autocomplete: std::collections::HashMap, - ) -> PaginatedGroupKerberosSourceConnectionList { - PaginatedGroupKerberosSourceConnectionList { - pagination, - results, - autocomplete, - } - } -} diff --git a/packages/client-rust/src/models/paginated_group_ldap_source_connection_list.rs b/packages/client-rust/src/models/paginated_group_ldap_source_connection_list.rs deleted file mode 100644 index ea9bb85aec..0000000000 --- a/packages/client-rust/src/models/paginated_group_ldap_source_connection_list.rs +++ /dev/null @@ -1,35 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct PaginatedGroupLdapSourceConnectionList { - #[serde(rename = "pagination")] - pub pagination: models::Pagination, - #[serde(rename = "results")] - pub results: Vec, - #[serde(rename = "autocomplete")] - pub autocomplete: std::collections::HashMap, -} - -impl PaginatedGroupLdapSourceConnectionList { - pub fn new( - pagination: models::Pagination, - results: Vec, - autocomplete: std::collections::HashMap, - ) -> PaginatedGroupLdapSourceConnectionList { - PaginatedGroupLdapSourceConnectionList { - pagination, - results, - autocomplete, - } - } -} diff --git a/packages/client-rust/src/models/paginated_group_o_auth_source_connection_list.rs b/packages/client-rust/src/models/paginated_group_o_auth_source_connection_list.rs deleted file mode 100644 index ed7b0a4869..0000000000 --- a/packages/client-rust/src/models/paginated_group_o_auth_source_connection_list.rs +++ /dev/null @@ -1,35 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct PaginatedGroupOAuthSourceConnectionList { - #[serde(rename = "pagination")] - pub pagination: models::Pagination, - #[serde(rename = "results")] - pub results: Vec, - #[serde(rename = "autocomplete")] - pub autocomplete: std::collections::HashMap, -} - -impl PaginatedGroupOAuthSourceConnectionList { - pub fn new( - pagination: models::Pagination, - results: Vec, - autocomplete: std::collections::HashMap, - ) -> PaginatedGroupOAuthSourceConnectionList { - PaginatedGroupOAuthSourceConnectionList { - pagination, - results, - autocomplete, - } - } -} diff --git a/packages/client-rust/src/models/paginated_group_plex_source_connection_list.rs b/packages/client-rust/src/models/paginated_group_plex_source_connection_list.rs deleted file mode 100644 index 7576cced4d..0000000000 --- a/packages/client-rust/src/models/paginated_group_plex_source_connection_list.rs +++ /dev/null @@ -1,35 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct PaginatedGroupPlexSourceConnectionList { - #[serde(rename = "pagination")] - pub pagination: models::Pagination, - #[serde(rename = "results")] - pub results: Vec, - #[serde(rename = "autocomplete")] - pub autocomplete: std::collections::HashMap, -} - -impl PaginatedGroupPlexSourceConnectionList { - pub fn new( - pagination: models::Pagination, - results: Vec, - autocomplete: std::collections::HashMap, - ) -> PaginatedGroupPlexSourceConnectionList { - PaginatedGroupPlexSourceConnectionList { - pagination, - results, - autocomplete, - } - } -} diff --git a/packages/client-rust/src/models/paginated_group_saml_source_connection_list.rs b/packages/client-rust/src/models/paginated_group_saml_source_connection_list.rs deleted file mode 100644 index 08679736a8..0000000000 --- a/packages/client-rust/src/models/paginated_group_saml_source_connection_list.rs +++ /dev/null @@ -1,35 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct PaginatedGroupSamlSourceConnectionList { - #[serde(rename = "pagination")] - pub pagination: models::Pagination, - #[serde(rename = "results")] - pub results: Vec, - #[serde(rename = "autocomplete")] - pub autocomplete: std::collections::HashMap, -} - -impl PaginatedGroupSamlSourceConnectionList { - pub fn new( - pagination: models::Pagination, - results: Vec, - autocomplete: std::collections::HashMap, - ) -> PaginatedGroupSamlSourceConnectionList { - PaginatedGroupSamlSourceConnectionList { - pagination, - results, - autocomplete, - } - } -} diff --git a/packages/client-rust/src/models/paginated_group_source_connection_list.rs b/packages/client-rust/src/models/paginated_group_source_connection_list.rs deleted file mode 100644 index b3ea38109a..0000000000 --- a/packages/client-rust/src/models/paginated_group_source_connection_list.rs +++ /dev/null @@ -1,35 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct PaginatedGroupSourceConnectionList { - #[serde(rename = "pagination")] - pub pagination: models::Pagination, - #[serde(rename = "results")] - pub results: Vec, - #[serde(rename = "autocomplete")] - pub autocomplete: std::collections::HashMap, -} - -impl PaginatedGroupSourceConnectionList { - pub fn new( - pagination: models::Pagination, - results: Vec, - autocomplete: std::collections::HashMap, - ) -> PaginatedGroupSourceConnectionList { - PaginatedGroupSourceConnectionList { - pagination, - results, - autocomplete, - } - } -} diff --git a/packages/client-rust/src/models/paginated_group_telegram_source_connection_list.rs b/packages/client-rust/src/models/paginated_group_telegram_source_connection_list.rs deleted file mode 100644 index e60d431375..0000000000 --- a/packages/client-rust/src/models/paginated_group_telegram_source_connection_list.rs +++ /dev/null @@ -1,35 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct PaginatedGroupTelegramSourceConnectionList { - #[serde(rename = "pagination")] - pub pagination: models::Pagination, - #[serde(rename = "results")] - pub results: Vec, - #[serde(rename = "autocomplete")] - pub autocomplete: std::collections::HashMap, -} - -impl PaginatedGroupTelegramSourceConnectionList { - pub fn new( - pagination: models::Pagination, - results: Vec, - autocomplete: std::collections::HashMap, - ) -> PaginatedGroupTelegramSourceConnectionList { - PaginatedGroupTelegramSourceConnectionList { - pagination, - results, - autocomplete, - } - } -} diff --git a/packages/client-rust/src/models/paginated_identification_stage_list.rs b/packages/client-rust/src/models/paginated_identification_stage_list.rs deleted file mode 100644 index 1c7ee259aa..0000000000 --- a/packages/client-rust/src/models/paginated_identification_stage_list.rs +++ /dev/null @@ -1,35 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct PaginatedIdentificationStageList { - #[serde(rename = "pagination")] - pub pagination: models::Pagination, - #[serde(rename = "results")] - pub results: Vec, - #[serde(rename = "autocomplete")] - pub autocomplete: std::collections::HashMap, -} - -impl PaginatedIdentificationStageList { - pub fn new( - pagination: models::Pagination, - results: Vec, - autocomplete: std::collections::HashMap, - ) -> PaginatedIdentificationStageList { - PaginatedIdentificationStageList { - pagination, - results, - autocomplete, - } - } -} diff --git a/packages/client-rust/src/models/paginated_initial_permissions_list.rs b/packages/client-rust/src/models/paginated_initial_permissions_list.rs deleted file mode 100644 index bdde85ec44..0000000000 --- a/packages/client-rust/src/models/paginated_initial_permissions_list.rs +++ /dev/null @@ -1,35 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct PaginatedInitialPermissionsList { - #[serde(rename = "pagination")] - pub pagination: models::Pagination, - #[serde(rename = "results")] - pub results: Vec, - #[serde(rename = "autocomplete")] - pub autocomplete: std::collections::HashMap, -} - -impl PaginatedInitialPermissionsList { - pub fn new( - pagination: models::Pagination, - results: Vec, - autocomplete: std::collections::HashMap, - ) -> PaginatedInitialPermissionsList { - PaginatedInitialPermissionsList { - pagination, - results, - autocomplete, - } - } -} diff --git a/packages/client-rust/src/models/paginated_invitation_list.rs b/packages/client-rust/src/models/paginated_invitation_list.rs deleted file mode 100644 index 4eab3088bd..0000000000 --- a/packages/client-rust/src/models/paginated_invitation_list.rs +++ /dev/null @@ -1,35 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct PaginatedInvitationList { - #[serde(rename = "pagination")] - pub pagination: models::Pagination, - #[serde(rename = "results")] - pub results: Vec, - #[serde(rename = "autocomplete")] - pub autocomplete: std::collections::HashMap, -} - -impl PaginatedInvitationList { - pub fn new( - pagination: models::Pagination, - results: Vec, - autocomplete: std::collections::HashMap, - ) -> PaginatedInvitationList { - PaginatedInvitationList { - pagination, - results, - autocomplete, - } - } -} diff --git a/packages/client-rust/src/models/paginated_invitation_stage_list.rs b/packages/client-rust/src/models/paginated_invitation_stage_list.rs deleted file mode 100644 index 2095b02332..0000000000 --- a/packages/client-rust/src/models/paginated_invitation_stage_list.rs +++ /dev/null @@ -1,35 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct PaginatedInvitationStageList { - #[serde(rename = "pagination")] - pub pagination: models::Pagination, - #[serde(rename = "results")] - pub results: Vec, - #[serde(rename = "autocomplete")] - pub autocomplete: std::collections::HashMap, -} - -impl PaginatedInvitationStageList { - pub fn new( - pagination: models::Pagination, - results: Vec, - autocomplete: std::collections::HashMap, - ) -> PaginatedInvitationStageList { - PaginatedInvitationStageList { - pagination, - results, - autocomplete, - } - } -} diff --git a/packages/client-rust/src/models/paginated_kerberos_source_list.rs b/packages/client-rust/src/models/paginated_kerberos_source_list.rs deleted file mode 100644 index a939b66b45..0000000000 --- a/packages/client-rust/src/models/paginated_kerberos_source_list.rs +++ /dev/null @@ -1,35 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct PaginatedKerberosSourceList { - #[serde(rename = "pagination")] - pub pagination: models::Pagination, - #[serde(rename = "results")] - pub results: Vec, - #[serde(rename = "autocomplete")] - pub autocomplete: std::collections::HashMap, -} - -impl PaginatedKerberosSourceList { - pub fn new( - pagination: models::Pagination, - results: Vec, - autocomplete: std::collections::HashMap, - ) -> PaginatedKerberosSourceList { - PaginatedKerberosSourceList { - pagination, - results, - autocomplete, - } - } -} diff --git a/packages/client-rust/src/models/paginated_kerberos_source_property_mapping_list.rs b/packages/client-rust/src/models/paginated_kerberos_source_property_mapping_list.rs deleted file mode 100644 index 98632b6c2f..0000000000 --- a/packages/client-rust/src/models/paginated_kerberos_source_property_mapping_list.rs +++ /dev/null @@ -1,35 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct PaginatedKerberosSourcePropertyMappingList { - #[serde(rename = "pagination")] - pub pagination: models::Pagination, - #[serde(rename = "results")] - pub results: Vec, - #[serde(rename = "autocomplete")] - pub autocomplete: std::collections::HashMap, -} - -impl PaginatedKerberosSourcePropertyMappingList { - pub fn new( - pagination: models::Pagination, - results: Vec, - autocomplete: std::collections::HashMap, - ) -> PaginatedKerberosSourcePropertyMappingList { - PaginatedKerberosSourcePropertyMappingList { - pagination, - results, - autocomplete, - } - } -} diff --git a/packages/client-rust/src/models/paginated_kubernetes_service_connection_list.rs b/packages/client-rust/src/models/paginated_kubernetes_service_connection_list.rs deleted file mode 100644 index 856caead0f..0000000000 --- a/packages/client-rust/src/models/paginated_kubernetes_service_connection_list.rs +++ /dev/null @@ -1,35 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct PaginatedKubernetesServiceConnectionList { - #[serde(rename = "pagination")] - pub pagination: models::Pagination, - #[serde(rename = "results")] - pub results: Vec, - #[serde(rename = "autocomplete")] - pub autocomplete: std::collections::HashMap, -} - -impl PaginatedKubernetesServiceConnectionList { - pub fn new( - pagination: models::Pagination, - results: Vec, - autocomplete: std::collections::HashMap, - ) -> PaginatedKubernetesServiceConnectionList { - PaginatedKubernetesServiceConnectionList { - pagination, - results, - autocomplete, - } - } -} diff --git a/packages/client-rust/src/models/paginated_ldap_provider_list.rs b/packages/client-rust/src/models/paginated_ldap_provider_list.rs deleted file mode 100644 index 3df22548b2..0000000000 --- a/packages/client-rust/src/models/paginated_ldap_provider_list.rs +++ /dev/null @@ -1,35 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct PaginatedLdapProviderList { - #[serde(rename = "pagination")] - pub pagination: models::Pagination, - #[serde(rename = "results")] - pub results: Vec, - #[serde(rename = "autocomplete")] - pub autocomplete: std::collections::HashMap, -} - -impl PaginatedLdapProviderList { - pub fn new( - pagination: models::Pagination, - results: Vec, - autocomplete: std::collections::HashMap, - ) -> PaginatedLdapProviderList { - PaginatedLdapProviderList { - pagination, - results, - autocomplete, - } - } -} diff --git a/packages/client-rust/src/models/paginated_ldap_source_list.rs b/packages/client-rust/src/models/paginated_ldap_source_list.rs deleted file mode 100644 index 42625fcff1..0000000000 --- a/packages/client-rust/src/models/paginated_ldap_source_list.rs +++ /dev/null @@ -1,35 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct PaginatedLdapSourceList { - #[serde(rename = "pagination")] - pub pagination: models::Pagination, - #[serde(rename = "results")] - pub results: Vec, - #[serde(rename = "autocomplete")] - pub autocomplete: std::collections::HashMap, -} - -impl PaginatedLdapSourceList { - pub fn new( - pagination: models::Pagination, - results: Vec, - autocomplete: std::collections::HashMap, - ) -> PaginatedLdapSourceList { - PaginatedLdapSourceList { - pagination, - results, - autocomplete, - } - } -} diff --git a/packages/client-rust/src/models/paginated_ldap_source_property_mapping_list.rs b/packages/client-rust/src/models/paginated_ldap_source_property_mapping_list.rs deleted file mode 100644 index bc831b4c86..0000000000 --- a/packages/client-rust/src/models/paginated_ldap_source_property_mapping_list.rs +++ /dev/null @@ -1,35 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct PaginatedLdapSourcePropertyMappingList { - #[serde(rename = "pagination")] - pub pagination: models::Pagination, - #[serde(rename = "results")] - pub results: Vec, - #[serde(rename = "autocomplete")] - pub autocomplete: std::collections::HashMap, -} - -impl PaginatedLdapSourcePropertyMappingList { - pub fn new( - pagination: models::Pagination, - results: Vec, - autocomplete: std::collections::HashMap, - ) -> PaginatedLdapSourcePropertyMappingList { - PaginatedLdapSourcePropertyMappingList { - pagination, - results, - autocomplete, - } - } -} diff --git a/packages/client-rust/src/models/paginated_license_list.rs b/packages/client-rust/src/models/paginated_license_list.rs deleted file mode 100644 index 5e9a7e92f6..0000000000 --- a/packages/client-rust/src/models/paginated_license_list.rs +++ /dev/null @@ -1,35 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct PaginatedLicenseList { - #[serde(rename = "pagination")] - pub pagination: models::Pagination, - #[serde(rename = "results")] - pub results: Vec, - #[serde(rename = "autocomplete")] - pub autocomplete: std::collections::HashMap, -} - -impl PaginatedLicenseList { - pub fn new( - pagination: models::Pagination, - results: Vec, - autocomplete: std::collections::HashMap, - ) -> PaginatedLicenseList { - PaginatedLicenseList { - pagination, - results, - autocomplete, - } - } -} diff --git a/packages/client-rust/src/models/paginated_lifecycle_iteration_list.rs b/packages/client-rust/src/models/paginated_lifecycle_iteration_list.rs deleted file mode 100644 index e475dcf7c0..0000000000 --- a/packages/client-rust/src/models/paginated_lifecycle_iteration_list.rs +++ /dev/null @@ -1,35 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct PaginatedLifecycleIterationList { - #[serde(rename = "pagination")] - pub pagination: models::Pagination, - #[serde(rename = "results")] - pub results: Vec, - #[serde(rename = "autocomplete")] - pub autocomplete: std::collections::HashMap, -} - -impl PaginatedLifecycleIterationList { - pub fn new( - pagination: models::Pagination, - results: Vec, - autocomplete: std::collections::HashMap, - ) -> PaginatedLifecycleIterationList { - PaginatedLifecycleIterationList { - pagination, - results, - autocomplete, - } - } -} diff --git a/packages/client-rust/src/models/paginated_lifecycle_rule_list.rs b/packages/client-rust/src/models/paginated_lifecycle_rule_list.rs deleted file mode 100644 index 001d3e2ab9..0000000000 --- a/packages/client-rust/src/models/paginated_lifecycle_rule_list.rs +++ /dev/null @@ -1,35 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct PaginatedLifecycleRuleList { - #[serde(rename = "pagination")] - pub pagination: models::Pagination, - #[serde(rename = "results")] - pub results: Vec, - #[serde(rename = "autocomplete")] - pub autocomplete: std::collections::HashMap, -} - -impl PaginatedLifecycleRuleList { - pub fn new( - pagination: models::Pagination, - results: Vec, - autocomplete: std::collections::HashMap, - ) -> PaginatedLifecycleRuleList { - PaginatedLifecycleRuleList { - pagination, - results, - autocomplete, - } - } -} diff --git a/packages/client-rust/src/models/paginated_microsoft_entra_provider_group_list.rs b/packages/client-rust/src/models/paginated_microsoft_entra_provider_group_list.rs deleted file mode 100644 index 3b01efceba..0000000000 --- a/packages/client-rust/src/models/paginated_microsoft_entra_provider_group_list.rs +++ /dev/null @@ -1,35 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct PaginatedMicrosoftEntraProviderGroupList { - #[serde(rename = "pagination")] - pub pagination: models::Pagination, - #[serde(rename = "results")] - pub results: Vec, - #[serde(rename = "autocomplete")] - pub autocomplete: std::collections::HashMap, -} - -impl PaginatedMicrosoftEntraProviderGroupList { - pub fn new( - pagination: models::Pagination, - results: Vec, - autocomplete: std::collections::HashMap, - ) -> PaginatedMicrosoftEntraProviderGroupList { - PaginatedMicrosoftEntraProviderGroupList { - pagination, - results, - autocomplete, - } - } -} diff --git a/packages/client-rust/src/models/paginated_microsoft_entra_provider_list.rs b/packages/client-rust/src/models/paginated_microsoft_entra_provider_list.rs deleted file mode 100644 index 4a8cd1f866..0000000000 --- a/packages/client-rust/src/models/paginated_microsoft_entra_provider_list.rs +++ /dev/null @@ -1,35 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct PaginatedMicrosoftEntraProviderList { - #[serde(rename = "pagination")] - pub pagination: models::Pagination, - #[serde(rename = "results")] - pub results: Vec, - #[serde(rename = "autocomplete")] - pub autocomplete: std::collections::HashMap, -} - -impl PaginatedMicrosoftEntraProviderList { - pub fn new( - pagination: models::Pagination, - results: Vec, - autocomplete: std::collections::HashMap, - ) -> PaginatedMicrosoftEntraProviderList { - PaginatedMicrosoftEntraProviderList { - pagination, - results, - autocomplete, - } - } -} diff --git a/packages/client-rust/src/models/paginated_microsoft_entra_provider_mapping_list.rs b/packages/client-rust/src/models/paginated_microsoft_entra_provider_mapping_list.rs deleted file mode 100644 index 59c7b48e1b..0000000000 --- a/packages/client-rust/src/models/paginated_microsoft_entra_provider_mapping_list.rs +++ /dev/null @@ -1,35 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct PaginatedMicrosoftEntraProviderMappingList { - #[serde(rename = "pagination")] - pub pagination: models::Pagination, - #[serde(rename = "results")] - pub results: Vec, - #[serde(rename = "autocomplete")] - pub autocomplete: std::collections::HashMap, -} - -impl PaginatedMicrosoftEntraProviderMappingList { - pub fn new( - pagination: models::Pagination, - results: Vec, - autocomplete: std::collections::HashMap, - ) -> PaginatedMicrosoftEntraProviderMappingList { - PaginatedMicrosoftEntraProviderMappingList { - pagination, - results, - autocomplete, - } - } -} diff --git a/packages/client-rust/src/models/paginated_microsoft_entra_provider_user_list.rs b/packages/client-rust/src/models/paginated_microsoft_entra_provider_user_list.rs deleted file mode 100644 index cb3d200717..0000000000 --- a/packages/client-rust/src/models/paginated_microsoft_entra_provider_user_list.rs +++ /dev/null @@ -1,35 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct PaginatedMicrosoftEntraProviderUserList { - #[serde(rename = "pagination")] - pub pagination: models::Pagination, - #[serde(rename = "results")] - pub results: Vec, - #[serde(rename = "autocomplete")] - pub autocomplete: std::collections::HashMap, -} - -impl PaginatedMicrosoftEntraProviderUserList { - pub fn new( - pagination: models::Pagination, - results: Vec, - autocomplete: std::collections::HashMap, - ) -> PaginatedMicrosoftEntraProviderUserList { - PaginatedMicrosoftEntraProviderUserList { - pagination, - results, - autocomplete, - } - } -} diff --git a/packages/client-rust/src/models/paginated_mutual_tls_stage_list.rs b/packages/client-rust/src/models/paginated_mutual_tls_stage_list.rs deleted file mode 100644 index 25d6182225..0000000000 --- a/packages/client-rust/src/models/paginated_mutual_tls_stage_list.rs +++ /dev/null @@ -1,35 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct PaginatedMutualTlsStageList { - #[serde(rename = "pagination")] - pub pagination: models::Pagination, - #[serde(rename = "results")] - pub results: Vec, - #[serde(rename = "autocomplete")] - pub autocomplete: std::collections::HashMap, -} - -impl PaginatedMutualTlsStageList { - pub fn new( - pagination: models::Pagination, - results: Vec, - autocomplete: std::collections::HashMap, - ) -> PaginatedMutualTlsStageList { - PaginatedMutualTlsStageList { - pagination, - results, - autocomplete, - } - } -} diff --git a/packages/client-rust/src/models/paginated_notification_list.rs b/packages/client-rust/src/models/paginated_notification_list.rs deleted file mode 100644 index f8bf2cb2e4..0000000000 --- a/packages/client-rust/src/models/paginated_notification_list.rs +++ /dev/null @@ -1,35 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct PaginatedNotificationList { - #[serde(rename = "pagination")] - pub pagination: models::Pagination, - #[serde(rename = "results")] - pub results: Vec, - #[serde(rename = "autocomplete")] - pub autocomplete: std::collections::HashMap, -} - -impl PaginatedNotificationList { - pub fn new( - pagination: models::Pagination, - results: Vec, - autocomplete: std::collections::HashMap, - ) -> PaginatedNotificationList { - PaginatedNotificationList { - pagination, - results, - autocomplete, - } - } -} diff --git a/packages/client-rust/src/models/paginated_notification_rule_list.rs b/packages/client-rust/src/models/paginated_notification_rule_list.rs deleted file mode 100644 index b72929086e..0000000000 --- a/packages/client-rust/src/models/paginated_notification_rule_list.rs +++ /dev/null @@ -1,35 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct PaginatedNotificationRuleList { - #[serde(rename = "pagination")] - pub pagination: models::Pagination, - #[serde(rename = "results")] - pub results: Vec, - #[serde(rename = "autocomplete")] - pub autocomplete: std::collections::HashMap, -} - -impl PaginatedNotificationRuleList { - pub fn new( - pagination: models::Pagination, - results: Vec, - autocomplete: std::collections::HashMap, - ) -> PaginatedNotificationRuleList { - PaginatedNotificationRuleList { - pagination, - results, - autocomplete, - } - } -} diff --git a/packages/client-rust/src/models/paginated_notification_transport_list.rs b/packages/client-rust/src/models/paginated_notification_transport_list.rs deleted file mode 100644 index 2d6788e935..0000000000 --- a/packages/client-rust/src/models/paginated_notification_transport_list.rs +++ /dev/null @@ -1,35 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct PaginatedNotificationTransportList { - #[serde(rename = "pagination")] - pub pagination: models::Pagination, - #[serde(rename = "results")] - pub results: Vec, - #[serde(rename = "autocomplete")] - pub autocomplete: std::collections::HashMap, -} - -impl PaginatedNotificationTransportList { - pub fn new( - pagination: models::Pagination, - results: Vec, - autocomplete: std::collections::HashMap, - ) -> PaginatedNotificationTransportList { - PaginatedNotificationTransportList { - pagination, - results, - autocomplete, - } - } -} diff --git a/packages/client-rust/src/models/paginated_notification_webhook_mapping_list.rs b/packages/client-rust/src/models/paginated_notification_webhook_mapping_list.rs deleted file mode 100644 index 350d1775ce..0000000000 --- a/packages/client-rust/src/models/paginated_notification_webhook_mapping_list.rs +++ /dev/null @@ -1,35 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct PaginatedNotificationWebhookMappingList { - #[serde(rename = "pagination")] - pub pagination: models::Pagination, - #[serde(rename = "results")] - pub results: Vec, - #[serde(rename = "autocomplete")] - pub autocomplete: std::collections::HashMap, -} - -impl PaginatedNotificationWebhookMappingList { - pub fn new( - pagination: models::Pagination, - results: Vec, - autocomplete: std::collections::HashMap, - ) -> PaginatedNotificationWebhookMappingList { - PaginatedNotificationWebhookMappingList { - pagination, - results, - autocomplete, - } - } -} diff --git a/packages/client-rust/src/models/paginated_o_auth2_provider_list.rs b/packages/client-rust/src/models/paginated_o_auth2_provider_list.rs deleted file mode 100644 index 3acf92d3ad..0000000000 --- a/packages/client-rust/src/models/paginated_o_auth2_provider_list.rs +++ /dev/null @@ -1,35 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct PaginatedOAuth2ProviderList { - #[serde(rename = "pagination")] - pub pagination: models::Pagination, - #[serde(rename = "results")] - pub results: Vec, - #[serde(rename = "autocomplete")] - pub autocomplete: std::collections::HashMap, -} - -impl PaginatedOAuth2ProviderList { - pub fn new( - pagination: models::Pagination, - results: Vec, - autocomplete: std::collections::HashMap, - ) -> PaginatedOAuth2ProviderList { - PaginatedOAuth2ProviderList { - pagination, - results, - autocomplete, - } - } -} diff --git a/packages/client-rust/src/models/paginated_o_auth_source_list.rs b/packages/client-rust/src/models/paginated_o_auth_source_list.rs deleted file mode 100644 index a38a919fed..0000000000 --- a/packages/client-rust/src/models/paginated_o_auth_source_list.rs +++ /dev/null @@ -1,35 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct PaginatedOAuthSourceList { - #[serde(rename = "pagination")] - pub pagination: models::Pagination, - #[serde(rename = "results")] - pub results: Vec, - #[serde(rename = "autocomplete")] - pub autocomplete: std::collections::HashMap, -} - -impl PaginatedOAuthSourceList { - pub fn new( - pagination: models::Pagination, - results: Vec, - autocomplete: std::collections::HashMap, - ) -> PaginatedOAuthSourceList { - PaginatedOAuthSourceList { - pagination, - results, - autocomplete, - } - } -} diff --git a/packages/client-rust/src/models/paginated_o_auth_source_property_mapping_list.rs b/packages/client-rust/src/models/paginated_o_auth_source_property_mapping_list.rs deleted file mode 100644 index 7a10601f09..0000000000 --- a/packages/client-rust/src/models/paginated_o_auth_source_property_mapping_list.rs +++ /dev/null @@ -1,35 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct PaginatedOAuthSourcePropertyMappingList { - #[serde(rename = "pagination")] - pub pagination: models::Pagination, - #[serde(rename = "results")] - pub results: Vec, - #[serde(rename = "autocomplete")] - pub autocomplete: std::collections::HashMap, -} - -impl PaginatedOAuthSourcePropertyMappingList { - pub fn new( - pagination: models::Pagination, - results: Vec, - autocomplete: std::collections::HashMap, - ) -> PaginatedOAuthSourcePropertyMappingList { - PaginatedOAuthSourcePropertyMappingList { - pagination, - results, - autocomplete, - } - } -} diff --git a/packages/client-rust/src/models/paginated_password_expiry_policy_list.rs b/packages/client-rust/src/models/paginated_password_expiry_policy_list.rs deleted file mode 100644 index 6e95debef6..0000000000 --- a/packages/client-rust/src/models/paginated_password_expiry_policy_list.rs +++ /dev/null @@ -1,35 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct PaginatedPasswordExpiryPolicyList { - #[serde(rename = "pagination")] - pub pagination: models::Pagination, - #[serde(rename = "results")] - pub results: Vec, - #[serde(rename = "autocomplete")] - pub autocomplete: std::collections::HashMap, -} - -impl PaginatedPasswordExpiryPolicyList { - pub fn new( - pagination: models::Pagination, - results: Vec, - autocomplete: std::collections::HashMap, - ) -> PaginatedPasswordExpiryPolicyList { - PaginatedPasswordExpiryPolicyList { - pagination, - results, - autocomplete, - } - } -} diff --git a/packages/client-rust/src/models/paginated_password_policy_list.rs b/packages/client-rust/src/models/paginated_password_policy_list.rs deleted file mode 100644 index 648253d7b2..0000000000 --- a/packages/client-rust/src/models/paginated_password_policy_list.rs +++ /dev/null @@ -1,35 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct PaginatedPasswordPolicyList { - #[serde(rename = "pagination")] - pub pagination: models::Pagination, - #[serde(rename = "results")] - pub results: Vec, - #[serde(rename = "autocomplete")] - pub autocomplete: std::collections::HashMap, -} - -impl PaginatedPasswordPolicyList { - pub fn new( - pagination: models::Pagination, - results: Vec, - autocomplete: std::collections::HashMap, - ) -> PaginatedPasswordPolicyList { - PaginatedPasswordPolicyList { - pagination, - results, - autocomplete, - } - } -} diff --git a/packages/client-rust/src/models/paginated_password_stage_list.rs b/packages/client-rust/src/models/paginated_password_stage_list.rs deleted file mode 100644 index fb09914000..0000000000 --- a/packages/client-rust/src/models/paginated_password_stage_list.rs +++ /dev/null @@ -1,35 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct PaginatedPasswordStageList { - #[serde(rename = "pagination")] - pub pagination: models::Pagination, - #[serde(rename = "results")] - pub results: Vec, - #[serde(rename = "autocomplete")] - pub autocomplete: std::collections::HashMap, -} - -impl PaginatedPasswordStageList { - pub fn new( - pagination: models::Pagination, - results: Vec, - autocomplete: std::collections::HashMap, - ) -> PaginatedPasswordStageList { - PaginatedPasswordStageList { - pagination, - results, - autocomplete, - } - } -} diff --git a/packages/client-rust/src/models/paginated_permission_list.rs b/packages/client-rust/src/models/paginated_permission_list.rs deleted file mode 100644 index fbc6115fdc..0000000000 --- a/packages/client-rust/src/models/paginated_permission_list.rs +++ /dev/null @@ -1,35 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct PaginatedPermissionList { - #[serde(rename = "pagination")] - pub pagination: models::Pagination, - #[serde(rename = "results")] - pub results: Vec, - #[serde(rename = "autocomplete")] - pub autocomplete: std::collections::HashMap, -} - -impl PaginatedPermissionList { - pub fn new( - pagination: models::Pagination, - results: Vec, - autocomplete: std::collections::HashMap, - ) -> PaginatedPermissionList { - PaginatedPermissionList { - pagination, - results, - autocomplete, - } - } -} diff --git a/packages/client-rust/src/models/paginated_plex_source_list.rs b/packages/client-rust/src/models/paginated_plex_source_list.rs deleted file mode 100644 index e583150216..0000000000 --- a/packages/client-rust/src/models/paginated_plex_source_list.rs +++ /dev/null @@ -1,35 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct PaginatedPlexSourceList { - #[serde(rename = "pagination")] - pub pagination: models::Pagination, - #[serde(rename = "results")] - pub results: Vec, - #[serde(rename = "autocomplete")] - pub autocomplete: std::collections::HashMap, -} - -impl PaginatedPlexSourceList { - pub fn new( - pagination: models::Pagination, - results: Vec, - autocomplete: std::collections::HashMap, - ) -> PaginatedPlexSourceList { - PaginatedPlexSourceList { - pagination, - results, - autocomplete, - } - } -} diff --git a/packages/client-rust/src/models/paginated_plex_source_property_mapping_list.rs b/packages/client-rust/src/models/paginated_plex_source_property_mapping_list.rs deleted file mode 100644 index c04f90ce2c..0000000000 --- a/packages/client-rust/src/models/paginated_plex_source_property_mapping_list.rs +++ /dev/null @@ -1,35 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct PaginatedPlexSourcePropertyMappingList { - #[serde(rename = "pagination")] - pub pagination: models::Pagination, - #[serde(rename = "results")] - pub results: Vec, - #[serde(rename = "autocomplete")] - pub autocomplete: std::collections::HashMap, -} - -impl PaginatedPlexSourcePropertyMappingList { - pub fn new( - pagination: models::Pagination, - results: Vec, - autocomplete: std::collections::HashMap, - ) -> PaginatedPlexSourcePropertyMappingList { - PaginatedPlexSourcePropertyMappingList { - pagination, - results, - autocomplete, - } - } -} diff --git a/packages/client-rust/src/models/paginated_policy_binding_list.rs b/packages/client-rust/src/models/paginated_policy_binding_list.rs deleted file mode 100644 index 5a60a385db..0000000000 --- a/packages/client-rust/src/models/paginated_policy_binding_list.rs +++ /dev/null @@ -1,35 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct PaginatedPolicyBindingList { - #[serde(rename = "pagination")] - pub pagination: models::Pagination, - #[serde(rename = "results")] - pub results: Vec, - #[serde(rename = "autocomplete")] - pub autocomplete: std::collections::HashMap, -} - -impl PaginatedPolicyBindingList { - pub fn new( - pagination: models::Pagination, - results: Vec, - autocomplete: std::collections::HashMap, - ) -> PaginatedPolicyBindingList { - PaginatedPolicyBindingList { - pagination, - results, - autocomplete, - } - } -} diff --git a/packages/client-rust/src/models/paginated_policy_list.rs b/packages/client-rust/src/models/paginated_policy_list.rs deleted file mode 100644 index 6ffb6fafd0..0000000000 --- a/packages/client-rust/src/models/paginated_policy_list.rs +++ /dev/null @@ -1,35 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct PaginatedPolicyList { - #[serde(rename = "pagination")] - pub pagination: models::Pagination, - #[serde(rename = "results")] - pub results: Vec, - #[serde(rename = "autocomplete")] - pub autocomplete: std::collections::HashMap, -} - -impl PaginatedPolicyList { - pub fn new( - pagination: models::Pagination, - results: Vec, - autocomplete: std::collections::HashMap, - ) -> PaginatedPolicyList { - PaginatedPolicyList { - pagination, - results, - autocomplete, - } - } -} diff --git a/packages/client-rust/src/models/paginated_prompt_list.rs b/packages/client-rust/src/models/paginated_prompt_list.rs deleted file mode 100644 index 74e21bbbc9..0000000000 --- a/packages/client-rust/src/models/paginated_prompt_list.rs +++ /dev/null @@ -1,35 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct PaginatedPromptList { - #[serde(rename = "pagination")] - pub pagination: models::Pagination, - #[serde(rename = "results")] - pub results: Vec, - #[serde(rename = "autocomplete")] - pub autocomplete: std::collections::HashMap, -} - -impl PaginatedPromptList { - pub fn new( - pagination: models::Pagination, - results: Vec, - autocomplete: std::collections::HashMap, - ) -> PaginatedPromptList { - PaginatedPromptList { - pagination, - results, - autocomplete, - } - } -} diff --git a/packages/client-rust/src/models/paginated_prompt_stage_list.rs b/packages/client-rust/src/models/paginated_prompt_stage_list.rs deleted file mode 100644 index c3fa999eb0..0000000000 --- a/packages/client-rust/src/models/paginated_prompt_stage_list.rs +++ /dev/null @@ -1,35 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct PaginatedPromptStageList { - #[serde(rename = "pagination")] - pub pagination: models::Pagination, - #[serde(rename = "results")] - pub results: Vec, - #[serde(rename = "autocomplete")] - pub autocomplete: std::collections::HashMap, -} - -impl PaginatedPromptStageList { - pub fn new( - pagination: models::Pagination, - results: Vec, - autocomplete: std::collections::HashMap, - ) -> PaginatedPromptStageList { - PaginatedPromptStageList { - pagination, - results, - autocomplete, - } - } -} diff --git a/packages/client-rust/src/models/paginated_property_mapping_list.rs b/packages/client-rust/src/models/paginated_property_mapping_list.rs deleted file mode 100644 index 2728152f88..0000000000 --- a/packages/client-rust/src/models/paginated_property_mapping_list.rs +++ /dev/null @@ -1,35 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct PaginatedPropertyMappingList { - #[serde(rename = "pagination")] - pub pagination: models::Pagination, - #[serde(rename = "results")] - pub results: Vec, - #[serde(rename = "autocomplete")] - pub autocomplete: std::collections::HashMap, -} - -impl PaginatedPropertyMappingList { - pub fn new( - pagination: models::Pagination, - results: Vec, - autocomplete: std::collections::HashMap, - ) -> PaginatedPropertyMappingList { - PaginatedPropertyMappingList { - pagination, - results, - autocomplete, - } - } -} diff --git a/packages/client-rust/src/models/paginated_provider_list.rs b/packages/client-rust/src/models/paginated_provider_list.rs deleted file mode 100644 index aa3ff363b3..0000000000 --- a/packages/client-rust/src/models/paginated_provider_list.rs +++ /dev/null @@ -1,35 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct PaginatedProviderList { - #[serde(rename = "pagination")] - pub pagination: models::Pagination, - #[serde(rename = "results")] - pub results: Vec, - #[serde(rename = "autocomplete")] - pub autocomplete: std::collections::HashMap, -} - -impl PaginatedProviderList { - pub fn new( - pagination: models::Pagination, - results: Vec, - autocomplete: std::collections::HashMap, - ) -> PaginatedProviderList { - PaginatedProviderList { - pagination, - results, - autocomplete, - } - } -} diff --git a/packages/client-rust/src/models/paginated_proxy_provider_list.rs b/packages/client-rust/src/models/paginated_proxy_provider_list.rs deleted file mode 100644 index 7f371a743f..0000000000 --- a/packages/client-rust/src/models/paginated_proxy_provider_list.rs +++ /dev/null @@ -1,35 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct PaginatedProxyProviderList { - #[serde(rename = "pagination")] - pub pagination: models::Pagination, - #[serde(rename = "results")] - pub results: Vec, - #[serde(rename = "autocomplete")] - pub autocomplete: std::collections::HashMap, -} - -impl PaginatedProxyProviderList { - pub fn new( - pagination: models::Pagination, - results: Vec, - autocomplete: std::collections::HashMap, - ) -> PaginatedProxyProviderList { - PaginatedProxyProviderList { - pagination, - results, - autocomplete, - } - } -} diff --git a/packages/client-rust/src/models/paginated_rac_property_mapping_list.rs b/packages/client-rust/src/models/paginated_rac_property_mapping_list.rs deleted file mode 100644 index acd4ae9a12..0000000000 --- a/packages/client-rust/src/models/paginated_rac_property_mapping_list.rs +++ /dev/null @@ -1,35 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct PaginatedRacPropertyMappingList { - #[serde(rename = "pagination")] - pub pagination: models::Pagination, - #[serde(rename = "results")] - pub results: Vec, - #[serde(rename = "autocomplete")] - pub autocomplete: std::collections::HashMap, -} - -impl PaginatedRacPropertyMappingList { - pub fn new( - pagination: models::Pagination, - results: Vec, - autocomplete: std::collections::HashMap, - ) -> PaginatedRacPropertyMappingList { - PaginatedRacPropertyMappingList { - pagination, - results, - autocomplete, - } - } -} diff --git a/packages/client-rust/src/models/paginated_rac_provider_list.rs b/packages/client-rust/src/models/paginated_rac_provider_list.rs deleted file mode 100644 index 0802d02095..0000000000 --- a/packages/client-rust/src/models/paginated_rac_provider_list.rs +++ /dev/null @@ -1,35 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct PaginatedRacProviderList { - #[serde(rename = "pagination")] - pub pagination: models::Pagination, - #[serde(rename = "results")] - pub results: Vec, - #[serde(rename = "autocomplete")] - pub autocomplete: std::collections::HashMap, -} - -impl PaginatedRacProviderList { - pub fn new( - pagination: models::Pagination, - results: Vec, - autocomplete: std::collections::HashMap, - ) -> PaginatedRacProviderList { - PaginatedRacProviderList { - pagination, - results, - autocomplete, - } - } -} diff --git a/packages/client-rust/src/models/paginated_radius_provider_list.rs b/packages/client-rust/src/models/paginated_radius_provider_list.rs deleted file mode 100644 index cb7c7b8f5e..0000000000 --- a/packages/client-rust/src/models/paginated_radius_provider_list.rs +++ /dev/null @@ -1,35 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct PaginatedRadiusProviderList { - #[serde(rename = "pagination")] - pub pagination: models::Pagination, - #[serde(rename = "results")] - pub results: Vec, - #[serde(rename = "autocomplete")] - pub autocomplete: std::collections::HashMap, -} - -impl PaginatedRadiusProviderList { - pub fn new( - pagination: models::Pagination, - results: Vec, - autocomplete: std::collections::HashMap, - ) -> PaginatedRadiusProviderList { - PaginatedRadiusProviderList { - pagination, - results, - autocomplete, - } - } -} diff --git a/packages/client-rust/src/models/paginated_radius_provider_property_mapping_list.rs b/packages/client-rust/src/models/paginated_radius_provider_property_mapping_list.rs deleted file mode 100644 index 41e73eff42..0000000000 --- a/packages/client-rust/src/models/paginated_radius_provider_property_mapping_list.rs +++ /dev/null @@ -1,35 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct PaginatedRadiusProviderPropertyMappingList { - #[serde(rename = "pagination")] - pub pagination: models::Pagination, - #[serde(rename = "results")] - pub results: Vec, - #[serde(rename = "autocomplete")] - pub autocomplete: std::collections::HashMap, -} - -impl PaginatedRadiusProviderPropertyMappingList { - pub fn new( - pagination: models::Pagination, - results: Vec, - autocomplete: std::collections::HashMap, - ) -> PaginatedRadiusProviderPropertyMappingList { - PaginatedRadiusProviderPropertyMappingList { - pagination, - results, - autocomplete, - } - } -} diff --git a/packages/client-rust/src/models/paginated_redirect_stage_list.rs b/packages/client-rust/src/models/paginated_redirect_stage_list.rs deleted file mode 100644 index d64ec93501..0000000000 --- a/packages/client-rust/src/models/paginated_redirect_stage_list.rs +++ /dev/null @@ -1,35 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct PaginatedRedirectStageList { - #[serde(rename = "pagination")] - pub pagination: models::Pagination, - #[serde(rename = "results")] - pub results: Vec, - #[serde(rename = "autocomplete")] - pub autocomplete: std::collections::HashMap, -} - -impl PaginatedRedirectStageList { - pub fn new( - pagination: models::Pagination, - results: Vec, - autocomplete: std::collections::HashMap, - ) -> PaginatedRedirectStageList { - PaginatedRedirectStageList { - pagination, - results, - autocomplete, - } - } -} diff --git a/packages/client-rust/src/models/paginated_reputation_list.rs b/packages/client-rust/src/models/paginated_reputation_list.rs deleted file mode 100644 index 85778a6200..0000000000 --- a/packages/client-rust/src/models/paginated_reputation_list.rs +++ /dev/null @@ -1,35 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct PaginatedReputationList { - #[serde(rename = "pagination")] - pub pagination: models::Pagination, - #[serde(rename = "results")] - pub results: Vec, - #[serde(rename = "autocomplete")] - pub autocomplete: std::collections::HashMap, -} - -impl PaginatedReputationList { - pub fn new( - pagination: models::Pagination, - results: Vec, - autocomplete: std::collections::HashMap, - ) -> PaginatedReputationList { - PaginatedReputationList { - pagination, - results, - autocomplete, - } - } -} diff --git a/packages/client-rust/src/models/paginated_reputation_policy_list.rs b/packages/client-rust/src/models/paginated_reputation_policy_list.rs deleted file mode 100644 index 8544a9bf34..0000000000 --- a/packages/client-rust/src/models/paginated_reputation_policy_list.rs +++ /dev/null @@ -1,35 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct PaginatedReputationPolicyList { - #[serde(rename = "pagination")] - pub pagination: models::Pagination, - #[serde(rename = "results")] - pub results: Vec, - #[serde(rename = "autocomplete")] - pub autocomplete: std::collections::HashMap, -} - -impl PaginatedReputationPolicyList { - pub fn new( - pagination: models::Pagination, - results: Vec, - autocomplete: std::collections::HashMap, - ) -> PaginatedReputationPolicyList { - PaginatedReputationPolicyList { - pagination, - results, - autocomplete, - } - } -} diff --git a/packages/client-rust/src/models/paginated_role_assigned_object_permission_list.rs b/packages/client-rust/src/models/paginated_role_assigned_object_permission_list.rs deleted file mode 100644 index 117b12d09a..0000000000 --- a/packages/client-rust/src/models/paginated_role_assigned_object_permission_list.rs +++ /dev/null @@ -1,35 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct PaginatedRoleAssignedObjectPermissionList { - #[serde(rename = "pagination")] - pub pagination: models::Pagination, - #[serde(rename = "results")] - pub results: Vec, - #[serde(rename = "autocomplete")] - pub autocomplete: std::collections::HashMap, -} - -impl PaginatedRoleAssignedObjectPermissionList { - pub fn new( - pagination: models::Pagination, - results: Vec, - autocomplete: std::collections::HashMap, - ) -> PaginatedRoleAssignedObjectPermissionList { - PaginatedRoleAssignedObjectPermissionList { - pagination, - results, - autocomplete, - } - } -} diff --git a/packages/client-rust/src/models/paginated_role_list.rs b/packages/client-rust/src/models/paginated_role_list.rs deleted file mode 100644 index 9faf04a42d..0000000000 --- a/packages/client-rust/src/models/paginated_role_list.rs +++ /dev/null @@ -1,35 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct PaginatedRoleList { - #[serde(rename = "pagination")] - pub pagination: models::Pagination, - #[serde(rename = "results")] - pub results: Vec, - #[serde(rename = "autocomplete")] - pub autocomplete: std::collections::HashMap, -} - -impl PaginatedRoleList { - pub fn new( - pagination: models::Pagination, - results: Vec, - autocomplete: std::collections::HashMap, - ) -> PaginatedRoleList { - PaginatedRoleList { - pagination, - results, - autocomplete, - } - } -} diff --git a/packages/client-rust/src/models/paginated_saml_property_mapping_list.rs b/packages/client-rust/src/models/paginated_saml_property_mapping_list.rs deleted file mode 100644 index c4694b1b4c..0000000000 --- a/packages/client-rust/src/models/paginated_saml_property_mapping_list.rs +++ /dev/null @@ -1,35 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct PaginatedSamlPropertyMappingList { - #[serde(rename = "pagination")] - pub pagination: models::Pagination, - #[serde(rename = "results")] - pub results: Vec, - #[serde(rename = "autocomplete")] - pub autocomplete: std::collections::HashMap, -} - -impl PaginatedSamlPropertyMappingList { - pub fn new( - pagination: models::Pagination, - results: Vec, - autocomplete: std::collections::HashMap, - ) -> PaginatedSamlPropertyMappingList { - PaginatedSamlPropertyMappingList { - pagination, - results, - autocomplete, - } - } -} diff --git a/packages/client-rust/src/models/paginated_saml_provider_list.rs b/packages/client-rust/src/models/paginated_saml_provider_list.rs deleted file mode 100644 index 1ab50f9366..0000000000 --- a/packages/client-rust/src/models/paginated_saml_provider_list.rs +++ /dev/null @@ -1,35 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct PaginatedSamlProviderList { - #[serde(rename = "pagination")] - pub pagination: models::Pagination, - #[serde(rename = "results")] - pub results: Vec, - #[serde(rename = "autocomplete")] - pub autocomplete: std::collections::HashMap, -} - -impl PaginatedSamlProviderList { - pub fn new( - pagination: models::Pagination, - results: Vec, - autocomplete: std::collections::HashMap, - ) -> PaginatedSamlProviderList { - PaginatedSamlProviderList { - pagination, - results, - autocomplete, - } - } -} diff --git a/packages/client-rust/src/models/paginated_saml_source_list.rs b/packages/client-rust/src/models/paginated_saml_source_list.rs deleted file mode 100644 index 17e7ec5697..0000000000 --- a/packages/client-rust/src/models/paginated_saml_source_list.rs +++ /dev/null @@ -1,35 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct PaginatedSamlSourceList { - #[serde(rename = "pagination")] - pub pagination: models::Pagination, - #[serde(rename = "results")] - pub results: Vec, - #[serde(rename = "autocomplete")] - pub autocomplete: std::collections::HashMap, -} - -impl PaginatedSamlSourceList { - pub fn new( - pagination: models::Pagination, - results: Vec, - autocomplete: std::collections::HashMap, - ) -> PaginatedSamlSourceList { - PaginatedSamlSourceList { - pagination, - results, - autocomplete, - } - } -} diff --git a/packages/client-rust/src/models/paginated_saml_source_property_mapping_list.rs b/packages/client-rust/src/models/paginated_saml_source_property_mapping_list.rs deleted file mode 100644 index 70e01d7ccf..0000000000 --- a/packages/client-rust/src/models/paginated_saml_source_property_mapping_list.rs +++ /dev/null @@ -1,35 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct PaginatedSamlSourcePropertyMappingList { - #[serde(rename = "pagination")] - pub pagination: models::Pagination, - #[serde(rename = "results")] - pub results: Vec, - #[serde(rename = "autocomplete")] - pub autocomplete: std::collections::HashMap, -} - -impl PaginatedSamlSourcePropertyMappingList { - pub fn new( - pagination: models::Pagination, - results: Vec, - autocomplete: std::collections::HashMap, - ) -> PaginatedSamlSourcePropertyMappingList { - PaginatedSamlSourcePropertyMappingList { - pagination, - results, - autocomplete, - } - } -} diff --git a/packages/client-rust/src/models/paginated_schedule_list.rs b/packages/client-rust/src/models/paginated_schedule_list.rs deleted file mode 100644 index f42be51ca7..0000000000 --- a/packages/client-rust/src/models/paginated_schedule_list.rs +++ /dev/null @@ -1,35 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct PaginatedScheduleList { - #[serde(rename = "pagination")] - pub pagination: models::Pagination, - #[serde(rename = "results")] - pub results: Vec, - #[serde(rename = "autocomplete")] - pub autocomplete: std::collections::HashMap, -} - -impl PaginatedScheduleList { - pub fn new( - pagination: models::Pagination, - results: Vec, - autocomplete: std::collections::HashMap, - ) -> PaginatedScheduleList { - PaginatedScheduleList { - pagination, - results, - autocomplete, - } - } -} diff --git a/packages/client-rust/src/models/paginated_scim_mapping_list.rs b/packages/client-rust/src/models/paginated_scim_mapping_list.rs deleted file mode 100644 index 196270e2ad..0000000000 --- a/packages/client-rust/src/models/paginated_scim_mapping_list.rs +++ /dev/null @@ -1,35 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct PaginatedScimMappingList { - #[serde(rename = "pagination")] - pub pagination: models::Pagination, - #[serde(rename = "results")] - pub results: Vec, - #[serde(rename = "autocomplete")] - pub autocomplete: std::collections::HashMap, -} - -impl PaginatedScimMappingList { - pub fn new( - pagination: models::Pagination, - results: Vec, - autocomplete: std::collections::HashMap, - ) -> PaginatedScimMappingList { - PaginatedScimMappingList { - pagination, - results, - autocomplete, - } - } -} diff --git a/packages/client-rust/src/models/paginated_scim_provider_group_list.rs b/packages/client-rust/src/models/paginated_scim_provider_group_list.rs deleted file mode 100644 index 2477cac4a3..0000000000 --- a/packages/client-rust/src/models/paginated_scim_provider_group_list.rs +++ /dev/null @@ -1,35 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct PaginatedScimProviderGroupList { - #[serde(rename = "pagination")] - pub pagination: models::Pagination, - #[serde(rename = "results")] - pub results: Vec, - #[serde(rename = "autocomplete")] - pub autocomplete: std::collections::HashMap, -} - -impl PaginatedScimProviderGroupList { - pub fn new( - pagination: models::Pagination, - results: Vec, - autocomplete: std::collections::HashMap, - ) -> PaginatedScimProviderGroupList { - PaginatedScimProviderGroupList { - pagination, - results, - autocomplete, - } - } -} diff --git a/packages/client-rust/src/models/paginated_scim_provider_list.rs b/packages/client-rust/src/models/paginated_scim_provider_list.rs deleted file mode 100644 index 97b7d1cee5..0000000000 --- a/packages/client-rust/src/models/paginated_scim_provider_list.rs +++ /dev/null @@ -1,35 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct PaginatedScimProviderList { - #[serde(rename = "pagination")] - pub pagination: models::Pagination, - #[serde(rename = "results")] - pub results: Vec, - #[serde(rename = "autocomplete")] - pub autocomplete: std::collections::HashMap, -} - -impl PaginatedScimProviderList { - pub fn new( - pagination: models::Pagination, - results: Vec, - autocomplete: std::collections::HashMap, - ) -> PaginatedScimProviderList { - PaginatedScimProviderList { - pagination, - results, - autocomplete, - } - } -} diff --git a/packages/client-rust/src/models/paginated_scim_provider_user_list.rs b/packages/client-rust/src/models/paginated_scim_provider_user_list.rs deleted file mode 100644 index 8bcd6450af..0000000000 --- a/packages/client-rust/src/models/paginated_scim_provider_user_list.rs +++ /dev/null @@ -1,35 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct PaginatedScimProviderUserList { - #[serde(rename = "pagination")] - pub pagination: models::Pagination, - #[serde(rename = "results")] - pub results: Vec, - #[serde(rename = "autocomplete")] - pub autocomplete: std::collections::HashMap, -} - -impl PaginatedScimProviderUserList { - pub fn new( - pagination: models::Pagination, - results: Vec, - autocomplete: std::collections::HashMap, - ) -> PaginatedScimProviderUserList { - PaginatedScimProviderUserList { - pagination, - results, - autocomplete, - } - } -} diff --git a/packages/client-rust/src/models/paginated_scim_source_group_list.rs b/packages/client-rust/src/models/paginated_scim_source_group_list.rs deleted file mode 100644 index 9c66c12818..0000000000 --- a/packages/client-rust/src/models/paginated_scim_source_group_list.rs +++ /dev/null @@ -1,35 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct PaginatedScimSourceGroupList { - #[serde(rename = "pagination")] - pub pagination: models::Pagination, - #[serde(rename = "results")] - pub results: Vec, - #[serde(rename = "autocomplete")] - pub autocomplete: std::collections::HashMap, -} - -impl PaginatedScimSourceGroupList { - pub fn new( - pagination: models::Pagination, - results: Vec, - autocomplete: std::collections::HashMap, - ) -> PaginatedScimSourceGroupList { - PaginatedScimSourceGroupList { - pagination, - results, - autocomplete, - } - } -} diff --git a/packages/client-rust/src/models/paginated_scim_source_list.rs b/packages/client-rust/src/models/paginated_scim_source_list.rs deleted file mode 100644 index f3d5ce027b..0000000000 --- a/packages/client-rust/src/models/paginated_scim_source_list.rs +++ /dev/null @@ -1,35 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct PaginatedScimSourceList { - #[serde(rename = "pagination")] - pub pagination: models::Pagination, - #[serde(rename = "results")] - pub results: Vec, - #[serde(rename = "autocomplete")] - pub autocomplete: std::collections::HashMap, -} - -impl PaginatedScimSourceList { - pub fn new( - pagination: models::Pagination, - results: Vec, - autocomplete: std::collections::HashMap, - ) -> PaginatedScimSourceList { - PaginatedScimSourceList { - pagination, - results, - autocomplete, - } - } -} diff --git a/packages/client-rust/src/models/paginated_scim_source_property_mapping_list.rs b/packages/client-rust/src/models/paginated_scim_source_property_mapping_list.rs deleted file mode 100644 index 2bdddb5da6..0000000000 --- a/packages/client-rust/src/models/paginated_scim_source_property_mapping_list.rs +++ /dev/null @@ -1,35 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct PaginatedScimSourcePropertyMappingList { - #[serde(rename = "pagination")] - pub pagination: models::Pagination, - #[serde(rename = "results")] - pub results: Vec, - #[serde(rename = "autocomplete")] - pub autocomplete: std::collections::HashMap, -} - -impl PaginatedScimSourcePropertyMappingList { - pub fn new( - pagination: models::Pagination, - results: Vec, - autocomplete: std::collections::HashMap, - ) -> PaginatedScimSourcePropertyMappingList { - PaginatedScimSourcePropertyMappingList { - pagination, - results, - autocomplete, - } - } -} diff --git a/packages/client-rust/src/models/paginated_scim_source_user_list.rs b/packages/client-rust/src/models/paginated_scim_source_user_list.rs deleted file mode 100644 index e9e06252cc..0000000000 --- a/packages/client-rust/src/models/paginated_scim_source_user_list.rs +++ /dev/null @@ -1,35 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct PaginatedScimSourceUserList { - #[serde(rename = "pagination")] - pub pagination: models::Pagination, - #[serde(rename = "results")] - pub results: Vec, - #[serde(rename = "autocomplete")] - pub autocomplete: std::collections::HashMap, -} - -impl PaginatedScimSourceUserList { - pub fn new( - pagination: models::Pagination, - results: Vec, - autocomplete: std::collections::HashMap, - ) -> PaginatedScimSourceUserList { - PaginatedScimSourceUserList { - pagination, - results, - autocomplete, - } - } -} diff --git a/packages/client-rust/src/models/paginated_scope_mapping_list.rs b/packages/client-rust/src/models/paginated_scope_mapping_list.rs deleted file mode 100644 index 9a2830f79e..0000000000 --- a/packages/client-rust/src/models/paginated_scope_mapping_list.rs +++ /dev/null @@ -1,35 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct PaginatedScopeMappingList { - #[serde(rename = "pagination")] - pub pagination: models::Pagination, - #[serde(rename = "results")] - pub results: Vec, - #[serde(rename = "autocomplete")] - pub autocomplete: std::collections::HashMap, -} - -impl PaginatedScopeMappingList { - pub fn new( - pagination: models::Pagination, - results: Vec, - autocomplete: std::collections::HashMap, - ) -> PaginatedScopeMappingList { - PaginatedScopeMappingList { - pagination, - results, - autocomplete, - } - } -} diff --git a/packages/client-rust/src/models/paginated_service_connection_list.rs b/packages/client-rust/src/models/paginated_service_connection_list.rs deleted file mode 100644 index 391ed38ca9..0000000000 --- a/packages/client-rust/src/models/paginated_service_connection_list.rs +++ /dev/null @@ -1,35 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct PaginatedServiceConnectionList { - #[serde(rename = "pagination")] - pub pagination: models::Pagination, - #[serde(rename = "results")] - pub results: Vec, - #[serde(rename = "autocomplete")] - pub autocomplete: std::collections::HashMap, -} - -impl PaginatedServiceConnectionList { - pub fn new( - pagination: models::Pagination, - results: Vec, - autocomplete: std::collections::HashMap, - ) -> PaginatedServiceConnectionList { - PaginatedServiceConnectionList { - pagination, - results, - autocomplete, - } - } -} diff --git a/packages/client-rust/src/models/paginated_sms_device_list.rs b/packages/client-rust/src/models/paginated_sms_device_list.rs deleted file mode 100644 index 7fb08ced4f..0000000000 --- a/packages/client-rust/src/models/paginated_sms_device_list.rs +++ /dev/null @@ -1,35 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct PaginatedSmsDeviceList { - #[serde(rename = "pagination")] - pub pagination: models::Pagination, - #[serde(rename = "results")] - pub results: Vec, - #[serde(rename = "autocomplete")] - pub autocomplete: std::collections::HashMap, -} - -impl PaginatedSmsDeviceList { - pub fn new( - pagination: models::Pagination, - results: Vec, - autocomplete: std::collections::HashMap, - ) -> PaginatedSmsDeviceList { - PaginatedSmsDeviceList { - pagination, - results, - autocomplete, - } - } -} diff --git a/packages/client-rust/src/models/paginated_source_list.rs b/packages/client-rust/src/models/paginated_source_list.rs deleted file mode 100644 index a282dad882..0000000000 --- a/packages/client-rust/src/models/paginated_source_list.rs +++ /dev/null @@ -1,35 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct PaginatedSourceList { - #[serde(rename = "pagination")] - pub pagination: models::Pagination, - #[serde(rename = "results")] - pub results: Vec, - #[serde(rename = "autocomplete")] - pub autocomplete: std::collections::HashMap, -} - -impl PaginatedSourceList { - pub fn new( - pagination: models::Pagination, - results: Vec, - autocomplete: std::collections::HashMap, - ) -> PaginatedSourceList { - PaginatedSourceList { - pagination, - results, - autocomplete, - } - } -} diff --git a/packages/client-rust/src/models/paginated_source_stage_list.rs b/packages/client-rust/src/models/paginated_source_stage_list.rs deleted file mode 100644 index 65a6cdd457..0000000000 --- a/packages/client-rust/src/models/paginated_source_stage_list.rs +++ /dev/null @@ -1,35 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct PaginatedSourceStageList { - #[serde(rename = "pagination")] - pub pagination: models::Pagination, - #[serde(rename = "results")] - pub results: Vec, - #[serde(rename = "autocomplete")] - pub autocomplete: std::collections::HashMap, -} - -impl PaginatedSourceStageList { - pub fn new( - pagination: models::Pagination, - results: Vec, - autocomplete: std::collections::HashMap, - ) -> PaginatedSourceStageList { - PaginatedSourceStageList { - pagination, - results, - autocomplete, - } - } -} diff --git a/packages/client-rust/src/models/paginated_ssf_provider_list.rs b/packages/client-rust/src/models/paginated_ssf_provider_list.rs deleted file mode 100644 index d56ed8e87e..0000000000 --- a/packages/client-rust/src/models/paginated_ssf_provider_list.rs +++ /dev/null @@ -1,35 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct PaginatedSsfProviderList { - #[serde(rename = "pagination")] - pub pagination: models::Pagination, - #[serde(rename = "results")] - pub results: Vec, - #[serde(rename = "autocomplete")] - pub autocomplete: std::collections::HashMap, -} - -impl PaginatedSsfProviderList { - pub fn new( - pagination: models::Pagination, - results: Vec, - autocomplete: std::collections::HashMap, - ) -> PaginatedSsfProviderList { - PaginatedSsfProviderList { - pagination, - results, - autocomplete, - } - } -} diff --git a/packages/client-rust/src/models/paginated_ssf_stream_list.rs b/packages/client-rust/src/models/paginated_ssf_stream_list.rs deleted file mode 100644 index 31b988ea22..0000000000 --- a/packages/client-rust/src/models/paginated_ssf_stream_list.rs +++ /dev/null @@ -1,35 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct PaginatedSsfStreamList { - #[serde(rename = "pagination")] - pub pagination: models::Pagination, - #[serde(rename = "results")] - pub results: Vec, - #[serde(rename = "autocomplete")] - pub autocomplete: std::collections::HashMap, -} - -impl PaginatedSsfStreamList { - pub fn new( - pagination: models::Pagination, - results: Vec, - autocomplete: std::collections::HashMap, - ) -> PaginatedSsfStreamList { - PaginatedSsfStreamList { - pagination, - results, - autocomplete, - } - } -} diff --git a/packages/client-rust/src/models/paginated_stage_list.rs b/packages/client-rust/src/models/paginated_stage_list.rs deleted file mode 100644 index 92b124847c..0000000000 --- a/packages/client-rust/src/models/paginated_stage_list.rs +++ /dev/null @@ -1,35 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct PaginatedStageList { - #[serde(rename = "pagination")] - pub pagination: models::Pagination, - #[serde(rename = "results")] - pub results: Vec, - #[serde(rename = "autocomplete")] - pub autocomplete: std::collections::HashMap, -} - -impl PaginatedStageList { - pub fn new( - pagination: models::Pagination, - results: Vec, - autocomplete: std::collections::HashMap, - ) -> PaginatedStageList { - PaginatedStageList { - pagination, - results, - autocomplete, - } - } -} diff --git a/packages/client-rust/src/models/paginated_static_device_list.rs b/packages/client-rust/src/models/paginated_static_device_list.rs deleted file mode 100644 index 480eb615e5..0000000000 --- a/packages/client-rust/src/models/paginated_static_device_list.rs +++ /dev/null @@ -1,35 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct PaginatedStaticDeviceList { - #[serde(rename = "pagination")] - pub pagination: models::Pagination, - #[serde(rename = "results")] - pub results: Vec, - #[serde(rename = "autocomplete")] - pub autocomplete: std::collections::HashMap, -} - -impl PaginatedStaticDeviceList { - pub fn new( - pagination: models::Pagination, - results: Vec, - autocomplete: std::collections::HashMap, - ) -> PaginatedStaticDeviceList { - PaginatedStaticDeviceList { - pagination, - results, - autocomplete, - } - } -} diff --git a/packages/client-rust/src/models/paginated_task_list.rs b/packages/client-rust/src/models/paginated_task_list.rs deleted file mode 100644 index 30a14456dd..0000000000 --- a/packages/client-rust/src/models/paginated_task_list.rs +++ /dev/null @@ -1,35 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct PaginatedTaskList { - #[serde(rename = "pagination")] - pub pagination: models::Pagination, - #[serde(rename = "results")] - pub results: Vec, - #[serde(rename = "autocomplete")] - pub autocomplete: std::collections::HashMap, -} - -impl PaginatedTaskList { - pub fn new( - pagination: models::Pagination, - results: Vec, - autocomplete: std::collections::HashMap, - ) -> PaginatedTaskList { - PaginatedTaskList { - pagination, - results, - autocomplete, - } - } -} diff --git a/packages/client-rust/src/models/paginated_telegram_source_list.rs b/packages/client-rust/src/models/paginated_telegram_source_list.rs deleted file mode 100644 index ca57a95661..0000000000 --- a/packages/client-rust/src/models/paginated_telegram_source_list.rs +++ /dev/null @@ -1,35 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct PaginatedTelegramSourceList { - #[serde(rename = "pagination")] - pub pagination: models::Pagination, - #[serde(rename = "results")] - pub results: Vec, - #[serde(rename = "autocomplete")] - pub autocomplete: std::collections::HashMap, -} - -impl PaginatedTelegramSourceList { - pub fn new( - pagination: models::Pagination, - results: Vec, - autocomplete: std::collections::HashMap, - ) -> PaginatedTelegramSourceList { - PaginatedTelegramSourceList { - pagination, - results, - autocomplete, - } - } -} diff --git a/packages/client-rust/src/models/paginated_telegram_source_property_mapping_list.rs b/packages/client-rust/src/models/paginated_telegram_source_property_mapping_list.rs deleted file mode 100644 index 6506182f0b..0000000000 --- a/packages/client-rust/src/models/paginated_telegram_source_property_mapping_list.rs +++ /dev/null @@ -1,35 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct PaginatedTelegramSourcePropertyMappingList { - #[serde(rename = "pagination")] - pub pagination: models::Pagination, - #[serde(rename = "results")] - pub results: Vec, - #[serde(rename = "autocomplete")] - pub autocomplete: std::collections::HashMap, -} - -impl PaginatedTelegramSourcePropertyMappingList { - pub fn new( - pagination: models::Pagination, - results: Vec, - autocomplete: std::collections::HashMap, - ) -> PaginatedTelegramSourcePropertyMappingList { - PaginatedTelegramSourcePropertyMappingList { - pagination, - results, - autocomplete, - } - } -} diff --git a/packages/client-rust/src/models/paginated_tenant_list.rs b/packages/client-rust/src/models/paginated_tenant_list.rs deleted file mode 100644 index 5da81ea218..0000000000 --- a/packages/client-rust/src/models/paginated_tenant_list.rs +++ /dev/null @@ -1,35 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct PaginatedTenantList { - #[serde(rename = "pagination")] - pub pagination: models::Pagination, - #[serde(rename = "results")] - pub results: Vec, - #[serde(rename = "autocomplete")] - pub autocomplete: std::collections::HashMap, -} - -impl PaginatedTenantList { - pub fn new( - pagination: models::Pagination, - results: Vec, - autocomplete: std::collections::HashMap, - ) -> PaginatedTenantList { - PaginatedTenantList { - pagination, - results, - autocomplete, - } - } -} diff --git a/packages/client-rust/src/models/paginated_token_list.rs b/packages/client-rust/src/models/paginated_token_list.rs deleted file mode 100644 index b2b065e25b..0000000000 --- a/packages/client-rust/src/models/paginated_token_list.rs +++ /dev/null @@ -1,35 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct PaginatedTokenList { - #[serde(rename = "pagination")] - pub pagination: models::Pagination, - #[serde(rename = "results")] - pub results: Vec, - #[serde(rename = "autocomplete")] - pub autocomplete: std::collections::HashMap, -} - -impl PaginatedTokenList { - pub fn new( - pagination: models::Pagination, - results: Vec, - autocomplete: std::collections::HashMap, - ) -> PaginatedTokenList { - PaginatedTokenList { - pagination, - results, - autocomplete, - } - } -} diff --git a/packages/client-rust/src/models/paginated_token_model_list.rs b/packages/client-rust/src/models/paginated_token_model_list.rs deleted file mode 100644 index 26385653db..0000000000 --- a/packages/client-rust/src/models/paginated_token_model_list.rs +++ /dev/null @@ -1,35 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct PaginatedTokenModelList { - #[serde(rename = "pagination")] - pub pagination: models::Pagination, - #[serde(rename = "results")] - pub results: Vec, - #[serde(rename = "autocomplete")] - pub autocomplete: std::collections::HashMap, -} - -impl PaginatedTokenModelList { - pub fn new( - pagination: models::Pagination, - results: Vec, - autocomplete: std::collections::HashMap, - ) -> PaginatedTokenModelList { - PaginatedTokenModelList { - pagination, - results, - autocomplete, - } - } -} diff --git a/packages/client-rust/src/models/paginated_totp_device_list.rs b/packages/client-rust/src/models/paginated_totp_device_list.rs deleted file mode 100644 index 3bdcc1444c..0000000000 --- a/packages/client-rust/src/models/paginated_totp_device_list.rs +++ /dev/null @@ -1,35 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct PaginatedTotpDeviceList { - #[serde(rename = "pagination")] - pub pagination: models::Pagination, - #[serde(rename = "results")] - pub results: Vec, - #[serde(rename = "autocomplete")] - pub autocomplete: std::collections::HashMap, -} - -impl PaginatedTotpDeviceList { - pub fn new( - pagination: models::Pagination, - results: Vec, - autocomplete: std::collections::HashMap, - ) -> PaginatedTotpDeviceList { - PaginatedTotpDeviceList { - pagination, - results, - autocomplete, - } - } -} diff --git a/packages/client-rust/src/models/paginated_unique_password_policy_list.rs b/packages/client-rust/src/models/paginated_unique_password_policy_list.rs deleted file mode 100644 index c83b90b9a4..0000000000 --- a/packages/client-rust/src/models/paginated_unique_password_policy_list.rs +++ /dev/null @@ -1,35 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct PaginatedUniquePasswordPolicyList { - #[serde(rename = "pagination")] - pub pagination: models::Pagination, - #[serde(rename = "results")] - pub results: Vec, - #[serde(rename = "autocomplete")] - pub autocomplete: std::collections::HashMap, -} - -impl PaginatedUniquePasswordPolicyList { - pub fn new( - pagination: models::Pagination, - results: Vec, - autocomplete: std::collections::HashMap, - ) -> PaginatedUniquePasswordPolicyList { - PaginatedUniquePasswordPolicyList { - pagination, - results, - autocomplete, - } - } -} diff --git a/packages/client-rust/src/models/paginated_user_consent_list.rs b/packages/client-rust/src/models/paginated_user_consent_list.rs deleted file mode 100644 index 994a9ef869..0000000000 --- a/packages/client-rust/src/models/paginated_user_consent_list.rs +++ /dev/null @@ -1,35 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct PaginatedUserConsentList { - #[serde(rename = "pagination")] - pub pagination: models::Pagination, - #[serde(rename = "results")] - pub results: Vec, - #[serde(rename = "autocomplete")] - pub autocomplete: std::collections::HashMap, -} - -impl PaginatedUserConsentList { - pub fn new( - pagination: models::Pagination, - results: Vec, - autocomplete: std::collections::HashMap, - ) -> PaginatedUserConsentList { - PaginatedUserConsentList { - pagination, - results, - autocomplete, - } - } -} diff --git a/packages/client-rust/src/models/paginated_user_delete_stage_list.rs b/packages/client-rust/src/models/paginated_user_delete_stage_list.rs deleted file mode 100644 index 2675e0d7e0..0000000000 --- a/packages/client-rust/src/models/paginated_user_delete_stage_list.rs +++ /dev/null @@ -1,35 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct PaginatedUserDeleteStageList { - #[serde(rename = "pagination")] - pub pagination: models::Pagination, - #[serde(rename = "results")] - pub results: Vec, - #[serde(rename = "autocomplete")] - pub autocomplete: std::collections::HashMap, -} - -impl PaginatedUserDeleteStageList { - pub fn new( - pagination: models::Pagination, - results: Vec, - autocomplete: std::collections::HashMap, - ) -> PaginatedUserDeleteStageList { - PaginatedUserDeleteStageList { - pagination, - results, - autocomplete, - } - } -} diff --git a/packages/client-rust/src/models/paginated_user_kerberos_source_connection_list.rs b/packages/client-rust/src/models/paginated_user_kerberos_source_connection_list.rs deleted file mode 100644 index 5c4e2eb54a..0000000000 --- a/packages/client-rust/src/models/paginated_user_kerberos_source_connection_list.rs +++ /dev/null @@ -1,35 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct PaginatedUserKerberosSourceConnectionList { - #[serde(rename = "pagination")] - pub pagination: models::Pagination, - #[serde(rename = "results")] - pub results: Vec, - #[serde(rename = "autocomplete")] - pub autocomplete: std::collections::HashMap, -} - -impl PaginatedUserKerberosSourceConnectionList { - pub fn new( - pagination: models::Pagination, - results: Vec, - autocomplete: std::collections::HashMap, - ) -> PaginatedUserKerberosSourceConnectionList { - PaginatedUserKerberosSourceConnectionList { - pagination, - results, - autocomplete, - } - } -} diff --git a/packages/client-rust/src/models/paginated_user_ldap_source_connection_list.rs b/packages/client-rust/src/models/paginated_user_ldap_source_connection_list.rs deleted file mode 100644 index be1d8be5ac..0000000000 --- a/packages/client-rust/src/models/paginated_user_ldap_source_connection_list.rs +++ /dev/null @@ -1,35 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct PaginatedUserLdapSourceConnectionList { - #[serde(rename = "pagination")] - pub pagination: models::Pagination, - #[serde(rename = "results")] - pub results: Vec, - #[serde(rename = "autocomplete")] - pub autocomplete: std::collections::HashMap, -} - -impl PaginatedUserLdapSourceConnectionList { - pub fn new( - pagination: models::Pagination, - results: Vec, - autocomplete: std::collections::HashMap, - ) -> PaginatedUserLdapSourceConnectionList { - PaginatedUserLdapSourceConnectionList { - pagination, - results, - autocomplete, - } - } -} diff --git a/packages/client-rust/src/models/paginated_user_login_stage_list.rs b/packages/client-rust/src/models/paginated_user_login_stage_list.rs deleted file mode 100644 index 66ebc68007..0000000000 --- a/packages/client-rust/src/models/paginated_user_login_stage_list.rs +++ /dev/null @@ -1,35 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct PaginatedUserLoginStageList { - #[serde(rename = "pagination")] - pub pagination: models::Pagination, - #[serde(rename = "results")] - pub results: Vec, - #[serde(rename = "autocomplete")] - pub autocomplete: std::collections::HashMap, -} - -impl PaginatedUserLoginStageList { - pub fn new( - pagination: models::Pagination, - results: Vec, - autocomplete: std::collections::HashMap, - ) -> PaginatedUserLoginStageList { - PaginatedUserLoginStageList { - pagination, - results, - autocomplete, - } - } -} diff --git a/packages/client-rust/src/models/paginated_user_logout_stage_list.rs b/packages/client-rust/src/models/paginated_user_logout_stage_list.rs deleted file mode 100644 index 5812c88c84..0000000000 --- a/packages/client-rust/src/models/paginated_user_logout_stage_list.rs +++ /dev/null @@ -1,35 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct PaginatedUserLogoutStageList { - #[serde(rename = "pagination")] - pub pagination: models::Pagination, - #[serde(rename = "results")] - pub results: Vec, - #[serde(rename = "autocomplete")] - pub autocomplete: std::collections::HashMap, -} - -impl PaginatedUserLogoutStageList { - pub fn new( - pagination: models::Pagination, - results: Vec, - autocomplete: std::collections::HashMap, - ) -> PaginatedUserLogoutStageList { - PaginatedUserLogoutStageList { - pagination, - results, - autocomplete, - } - } -} diff --git a/packages/client-rust/src/models/paginated_user_o_auth_source_connection_list.rs b/packages/client-rust/src/models/paginated_user_o_auth_source_connection_list.rs deleted file mode 100644 index e747af3edc..0000000000 --- a/packages/client-rust/src/models/paginated_user_o_auth_source_connection_list.rs +++ /dev/null @@ -1,35 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct PaginatedUserOAuthSourceConnectionList { - #[serde(rename = "pagination")] - pub pagination: models::Pagination, - #[serde(rename = "results")] - pub results: Vec, - #[serde(rename = "autocomplete")] - pub autocomplete: std::collections::HashMap, -} - -impl PaginatedUserOAuthSourceConnectionList { - pub fn new( - pagination: models::Pagination, - results: Vec, - autocomplete: std::collections::HashMap, - ) -> PaginatedUserOAuthSourceConnectionList { - PaginatedUserOAuthSourceConnectionList { - pagination, - results, - autocomplete, - } - } -} diff --git a/packages/client-rust/src/models/paginated_user_plex_source_connection_list.rs b/packages/client-rust/src/models/paginated_user_plex_source_connection_list.rs deleted file mode 100644 index adb3d62ab4..0000000000 --- a/packages/client-rust/src/models/paginated_user_plex_source_connection_list.rs +++ /dev/null @@ -1,35 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct PaginatedUserPlexSourceConnectionList { - #[serde(rename = "pagination")] - pub pagination: models::Pagination, - #[serde(rename = "results")] - pub results: Vec, - #[serde(rename = "autocomplete")] - pub autocomplete: std::collections::HashMap, -} - -impl PaginatedUserPlexSourceConnectionList { - pub fn new( - pagination: models::Pagination, - results: Vec, - autocomplete: std::collections::HashMap, - ) -> PaginatedUserPlexSourceConnectionList { - PaginatedUserPlexSourceConnectionList { - pagination, - results, - autocomplete, - } - } -} diff --git a/packages/client-rust/src/models/paginated_user_saml_source_connection_list.rs b/packages/client-rust/src/models/paginated_user_saml_source_connection_list.rs deleted file mode 100644 index 4496792aab..0000000000 --- a/packages/client-rust/src/models/paginated_user_saml_source_connection_list.rs +++ /dev/null @@ -1,35 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct PaginatedUserSamlSourceConnectionList { - #[serde(rename = "pagination")] - pub pagination: models::Pagination, - #[serde(rename = "results")] - pub results: Vec, - #[serde(rename = "autocomplete")] - pub autocomplete: std::collections::HashMap, -} - -impl PaginatedUserSamlSourceConnectionList { - pub fn new( - pagination: models::Pagination, - results: Vec, - autocomplete: std::collections::HashMap, - ) -> PaginatedUserSamlSourceConnectionList { - PaginatedUserSamlSourceConnectionList { - pagination, - results, - autocomplete, - } - } -} diff --git a/packages/client-rust/src/models/paginated_user_source_connection_list.rs b/packages/client-rust/src/models/paginated_user_source_connection_list.rs deleted file mode 100644 index 6784fbcb7c..0000000000 --- a/packages/client-rust/src/models/paginated_user_source_connection_list.rs +++ /dev/null @@ -1,35 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct PaginatedUserSourceConnectionList { - #[serde(rename = "pagination")] - pub pagination: models::Pagination, - #[serde(rename = "results")] - pub results: Vec, - #[serde(rename = "autocomplete")] - pub autocomplete: std::collections::HashMap, -} - -impl PaginatedUserSourceConnectionList { - pub fn new( - pagination: models::Pagination, - results: Vec, - autocomplete: std::collections::HashMap, - ) -> PaginatedUserSourceConnectionList { - PaginatedUserSourceConnectionList { - pagination, - results, - autocomplete, - } - } -} diff --git a/packages/client-rust/src/models/paginated_user_telegram_source_connection_list.rs b/packages/client-rust/src/models/paginated_user_telegram_source_connection_list.rs deleted file mode 100644 index 3eb9ceb34c..0000000000 --- a/packages/client-rust/src/models/paginated_user_telegram_source_connection_list.rs +++ /dev/null @@ -1,35 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct PaginatedUserTelegramSourceConnectionList { - #[serde(rename = "pagination")] - pub pagination: models::Pagination, - #[serde(rename = "results")] - pub results: Vec, - #[serde(rename = "autocomplete")] - pub autocomplete: std::collections::HashMap, -} - -impl PaginatedUserTelegramSourceConnectionList { - pub fn new( - pagination: models::Pagination, - results: Vec, - autocomplete: std::collections::HashMap, - ) -> PaginatedUserTelegramSourceConnectionList { - PaginatedUserTelegramSourceConnectionList { - pagination, - results, - autocomplete, - } - } -} diff --git a/packages/client-rust/src/models/paginated_user_write_stage_list.rs b/packages/client-rust/src/models/paginated_user_write_stage_list.rs deleted file mode 100644 index eb09c88deb..0000000000 --- a/packages/client-rust/src/models/paginated_user_write_stage_list.rs +++ /dev/null @@ -1,35 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct PaginatedUserWriteStageList { - #[serde(rename = "pagination")] - pub pagination: models::Pagination, - #[serde(rename = "results")] - pub results: Vec, - #[serde(rename = "autocomplete")] - pub autocomplete: std::collections::HashMap, -} - -impl PaginatedUserWriteStageList { - pub fn new( - pagination: models::Pagination, - results: Vec, - autocomplete: std::collections::HashMap, - ) -> PaginatedUserWriteStageList { - PaginatedUserWriteStageList { - pagination, - results, - autocomplete, - } - } -} diff --git a/packages/client-rust/src/models/paginated_web_authn_device_list.rs b/packages/client-rust/src/models/paginated_web_authn_device_list.rs deleted file mode 100644 index 118244f29f..0000000000 --- a/packages/client-rust/src/models/paginated_web_authn_device_list.rs +++ /dev/null @@ -1,35 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct PaginatedWebAuthnDeviceList { - #[serde(rename = "pagination")] - pub pagination: models::Pagination, - #[serde(rename = "results")] - pub results: Vec, - #[serde(rename = "autocomplete")] - pub autocomplete: std::collections::HashMap, -} - -impl PaginatedWebAuthnDeviceList { - pub fn new( - pagination: models::Pagination, - results: Vec, - autocomplete: std::collections::HashMap, - ) -> PaginatedWebAuthnDeviceList { - PaginatedWebAuthnDeviceList { - pagination, - results, - autocomplete, - } - } -} diff --git a/packages/client-rust/src/models/paginated_web_authn_device_type_list.rs b/packages/client-rust/src/models/paginated_web_authn_device_type_list.rs deleted file mode 100644 index 4075461506..0000000000 --- a/packages/client-rust/src/models/paginated_web_authn_device_type_list.rs +++ /dev/null @@ -1,35 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct PaginatedWebAuthnDeviceTypeList { - #[serde(rename = "pagination")] - pub pagination: models::Pagination, - #[serde(rename = "results")] - pub results: Vec, - #[serde(rename = "autocomplete")] - pub autocomplete: std::collections::HashMap, -} - -impl PaginatedWebAuthnDeviceTypeList { - pub fn new( - pagination: models::Pagination, - results: Vec, - autocomplete: std::collections::HashMap, - ) -> PaginatedWebAuthnDeviceTypeList { - PaginatedWebAuthnDeviceTypeList { - pagination, - results, - autocomplete, - } - } -} diff --git a/packages/client-rust/src/models/paginated_ws_federation_provider_list.rs b/packages/client-rust/src/models/paginated_ws_federation_provider_list.rs deleted file mode 100644 index 5c9dc3f209..0000000000 --- a/packages/client-rust/src/models/paginated_ws_federation_provider_list.rs +++ /dev/null @@ -1,35 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct PaginatedWsFederationProviderList { - #[serde(rename = "pagination")] - pub pagination: models::Pagination, - #[serde(rename = "results")] - pub results: Vec, - #[serde(rename = "autocomplete")] - pub autocomplete: std::collections::HashMap, -} - -impl PaginatedWsFederationProviderList { - pub fn new( - pagination: models::Pagination, - results: Vec, - autocomplete: std::collections::HashMap, - ) -> PaginatedWsFederationProviderList { - PaginatedWsFederationProviderList { - pagination, - results, - autocomplete, - } - } -} diff --git a/packages/client-rust/src/models/password_expiry_policy.rs b/packages/client-rust/src/models/password_expiry_policy.rs deleted file mode 100644 index f56c01b43b..0000000000 --- a/packages/client-rust/src/models/password_expiry_policy.rs +++ /dev/null @@ -1,70 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// PasswordExpiryPolicy : Password Expiry Policy Serializer -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct PasswordExpiryPolicy { - #[serde(rename = "pk")] - pub pk: uuid::Uuid, - #[serde(rename = "name")] - pub name: String, - /// When this option is enabled, all executions of this policy will be logged. By default, only - /// execution errors are logged. - #[serde(rename = "execution_logging", skip_serializing_if = "Option::is_none")] - pub execution_logging: Option, - /// Get object component so that we know how to edit the object - #[serde(rename = "component")] - pub component: String, - /// Return object's verbose_name - #[serde(rename = "verbose_name")] - pub verbose_name: String, - /// Return object's plural verbose_name - #[serde(rename = "verbose_name_plural")] - pub verbose_name_plural: String, - /// Return internal model name - #[serde(rename = "meta_model_name")] - pub meta_model_name: String, - /// Return objects policy is bound to - #[serde(rename = "bound_to")] - pub bound_to: i32, - #[serde(rename = "days")] - pub days: i32, - #[serde(rename = "deny_only", skip_serializing_if = "Option::is_none")] - pub deny_only: Option, -} - -impl PasswordExpiryPolicy { - /// Password Expiry Policy Serializer - pub fn new( - pk: uuid::Uuid, - name: String, - component: String, - verbose_name: String, - verbose_name_plural: String, - meta_model_name: String, - bound_to: i32, - days: i32, - ) -> PasswordExpiryPolicy { - PasswordExpiryPolicy { - pk, - name, - execution_logging: None, - component, - verbose_name, - verbose_name_plural, - meta_model_name, - bound_to, - days, - deny_only: None, - } - } -} diff --git a/packages/client-rust/src/models/password_expiry_policy_request.rs b/packages/client-rust/src/models/password_expiry_policy_request.rs deleted file mode 100644 index a00871f906..0000000000 --- a/packages/client-rust/src/models/password_expiry_policy_request.rs +++ /dev/null @@ -1,38 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// PasswordExpiryPolicyRequest : Password Expiry Policy Serializer -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct PasswordExpiryPolicyRequest { - #[serde(rename = "name")] - pub name: String, - /// When this option is enabled, all executions of this policy will be logged. By default, only - /// execution errors are logged. - #[serde(rename = "execution_logging", skip_serializing_if = "Option::is_none")] - pub execution_logging: Option, - #[serde(rename = "days")] - pub days: i32, - #[serde(rename = "deny_only", skip_serializing_if = "Option::is_none")] - pub deny_only: Option, -} - -impl PasswordExpiryPolicyRequest { - /// Password Expiry Policy Serializer - pub fn new(name: String, days: i32) -> PasswordExpiryPolicyRequest { - PasswordExpiryPolicyRequest { - name, - execution_logging: None, - days, - deny_only: None, - } - } -} diff --git a/packages/client-rust/src/models/password_policy.rs b/packages/client-rust/src/models/password_policy.rs deleted file mode 100644 index 53d7e57baf..0000000000 --- a/packages/client-rust/src/models/password_policy.rs +++ /dev/null @@ -1,111 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// PasswordPolicy : Password Policy Serializer -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct PasswordPolicy { - #[serde(rename = "pk")] - pub pk: uuid::Uuid, - #[serde(rename = "name")] - pub name: String, - /// When this option is enabled, all executions of this policy will be logged. By default, only - /// execution errors are logged. - #[serde(rename = "execution_logging", skip_serializing_if = "Option::is_none")] - pub execution_logging: Option, - /// Get object component so that we know how to edit the object - #[serde(rename = "component")] - pub component: String, - /// Return object's verbose_name - #[serde(rename = "verbose_name")] - pub verbose_name: String, - /// Return object's plural verbose_name - #[serde(rename = "verbose_name_plural")] - pub verbose_name_plural: String, - /// Return internal model name - #[serde(rename = "meta_model_name")] - pub meta_model_name: String, - /// Return objects policy is bound to - #[serde(rename = "bound_to")] - pub bound_to: i32, - /// Field key to check, field keys defined in Prompt stages are available. - #[serde(rename = "password_field", skip_serializing_if = "Option::is_none")] - pub password_field: Option, - #[serde(rename = "amount_digits", skip_serializing_if = "Option::is_none")] - pub amount_digits: Option, - #[serde(rename = "amount_uppercase", skip_serializing_if = "Option::is_none")] - pub amount_uppercase: Option, - #[serde(rename = "amount_lowercase", skip_serializing_if = "Option::is_none")] - pub amount_lowercase: Option, - #[serde(rename = "amount_symbols", skip_serializing_if = "Option::is_none")] - pub amount_symbols: Option, - #[serde(rename = "length_min", skip_serializing_if = "Option::is_none")] - pub length_min: Option, - #[serde(rename = "symbol_charset", skip_serializing_if = "Option::is_none")] - pub symbol_charset: Option, - #[serde(rename = "error_message", skip_serializing_if = "Option::is_none")] - pub error_message: Option, - #[serde(rename = "check_static_rules", skip_serializing_if = "Option::is_none")] - pub check_static_rules: Option, - #[serde( - rename = "check_have_i_been_pwned", - skip_serializing_if = "Option::is_none" - )] - pub check_have_i_been_pwned: Option, - #[serde(rename = "check_zxcvbn", skip_serializing_if = "Option::is_none")] - pub check_zxcvbn: Option, - /// How many times the password hash is allowed to be on haveibeenpwned - #[serde(rename = "hibp_allowed_count", skip_serializing_if = "Option::is_none")] - pub hibp_allowed_count: Option, - /// If the zxcvbn score is equal or less than this value, the policy will fail. - #[serde( - rename = "zxcvbn_score_threshold", - skip_serializing_if = "Option::is_none" - )] - pub zxcvbn_score_threshold: Option, -} - -impl PasswordPolicy { - /// Password Policy Serializer - pub fn new( - pk: uuid::Uuid, - name: String, - component: String, - verbose_name: String, - verbose_name_plural: String, - meta_model_name: String, - bound_to: i32, - ) -> PasswordPolicy { - PasswordPolicy { - pk, - name, - execution_logging: None, - component, - verbose_name, - verbose_name_plural, - meta_model_name, - bound_to, - password_field: None, - amount_digits: None, - amount_uppercase: None, - amount_lowercase: None, - amount_symbols: None, - length_min: None, - symbol_charset: None, - error_message: None, - check_static_rules: None, - check_have_i_been_pwned: None, - check_zxcvbn: None, - hibp_allowed_count: None, - zxcvbn_score_threshold: None, - } - } -} diff --git a/packages/client-rust/src/models/password_policy_request.rs b/packages/client-rust/src/models/password_policy_request.rs deleted file mode 100644 index 38874efb98..0000000000 --- a/packages/client-rust/src/models/password_policy_request.rs +++ /dev/null @@ -1,80 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// PasswordPolicyRequest : Password Policy Serializer -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct PasswordPolicyRequest { - #[serde(rename = "name")] - pub name: String, - /// When this option is enabled, all executions of this policy will be logged. By default, only - /// execution errors are logged. - #[serde(rename = "execution_logging", skip_serializing_if = "Option::is_none")] - pub execution_logging: Option, - /// Field key to check, field keys defined in Prompt stages are available. - #[serde(rename = "password_field", skip_serializing_if = "Option::is_none")] - pub password_field: Option, - #[serde(rename = "amount_digits", skip_serializing_if = "Option::is_none")] - pub amount_digits: Option, - #[serde(rename = "amount_uppercase", skip_serializing_if = "Option::is_none")] - pub amount_uppercase: Option, - #[serde(rename = "amount_lowercase", skip_serializing_if = "Option::is_none")] - pub amount_lowercase: Option, - #[serde(rename = "amount_symbols", skip_serializing_if = "Option::is_none")] - pub amount_symbols: Option, - #[serde(rename = "length_min", skip_serializing_if = "Option::is_none")] - pub length_min: Option, - #[serde(rename = "symbol_charset", skip_serializing_if = "Option::is_none")] - pub symbol_charset: Option, - #[serde(rename = "error_message", skip_serializing_if = "Option::is_none")] - pub error_message: Option, - #[serde(rename = "check_static_rules", skip_serializing_if = "Option::is_none")] - pub check_static_rules: Option, - #[serde( - rename = "check_have_i_been_pwned", - skip_serializing_if = "Option::is_none" - )] - pub check_have_i_been_pwned: Option, - #[serde(rename = "check_zxcvbn", skip_serializing_if = "Option::is_none")] - pub check_zxcvbn: Option, - /// How many times the password hash is allowed to be on haveibeenpwned - #[serde(rename = "hibp_allowed_count", skip_serializing_if = "Option::is_none")] - pub hibp_allowed_count: Option, - /// If the zxcvbn score is equal or less than this value, the policy will fail. - #[serde( - rename = "zxcvbn_score_threshold", - skip_serializing_if = "Option::is_none" - )] - pub zxcvbn_score_threshold: Option, -} - -impl PasswordPolicyRequest { - /// Password Policy Serializer - pub fn new(name: String) -> PasswordPolicyRequest { - PasswordPolicyRequest { - name, - execution_logging: None, - password_field: None, - amount_digits: None, - amount_uppercase: None, - amount_lowercase: None, - amount_symbols: None, - length_min: None, - symbol_charset: None, - error_message: None, - check_static_rules: None, - check_have_i_been_pwned: None, - check_zxcvbn: None, - hibp_allowed_count: None, - zxcvbn_score_threshold: None, - } - } -} diff --git a/packages/client-rust/src/models/password_stage.rs b/packages/client-rust/src/models/password_stage.rs deleted file mode 100644 index acd4f1d4f2..0000000000 --- a/packages/client-rust/src/models/password_stage.rs +++ /dev/null @@ -1,87 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// PasswordStage : PasswordStage Serializer -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct PasswordStage { - #[serde(rename = "pk")] - pub pk: uuid::Uuid, - #[serde(rename = "name")] - pub name: String, - /// Get object type so that we know how to edit the object - #[serde(rename = "component")] - pub component: String, - /// Return object's verbose_name - #[serde(rename = "verbose_name")] - pub verbose_name: String, - /// Return object's plural verbose_name - #[serde(rename = "verbose_name_plural")] - pub verbose_name_plural: String, - /// Return internal model name - #[serde(rename = "meta_model_name")] - pub meta_model_name: String, - #[serde(rename = "flow_set")] - pub flow_set: Vec, - /// Selection of backends to test the password against. - #[serde(rename = "backends")] - pub backends: Vec, - /// Flow used by an authenticated user to configure this Stage. If empty, user will not be able - /// to configure this stage. - #[serde( - rename = "configure_flow", - default, - with = "::serde_with::rust::double_option", - skip_serializing_if = "Option::is_none" - )] - pub configure_flow: Option>, - /// 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. - #[serde( - rename = "failed_attempts_before_cancel", - skip_serializing_if = "Option::is_none" - )] - pub failed_attempts_before_cancel: Option, - /// When enabled, provides a 'show password' button with the password input field. - #[serde( - rename = "allow_show_password", - skip_serializing_if = "Option::is_none" - )] - pub allow_show_password: Option, -} - -impl PasswordStage { - /// PasswordStage Serializer - pub fn new( - pk: uuid::Uuid, - name: String, - component: String, - verbose_name: String, - verbose_name_plural: String, - meta_model_name: String, - flow_set: Vec, - backends: Vec, - ) -> PasswordStage { - PasswordStage { - pk, - name, - component, - verbose_name, - verbose_name_plural, - meta_model_name, - flow_set, - backends, - configure_flow: None, - failed_attempts_before_cancel: None, - allow_show_password: None, - } - } -} diff --git a/packages/client-rust/src/models/password_stage_request.rs b/packages/client-rust/src/models/password_stage_request.rs deleted file mode 100644 index 8bd5c9bac8..0000000000 --- a/packages/client-rust/src/models/password_stage_request.rs +++ /dev/null @@ -1,56 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// PasswordStageRequest : PasswordStage Serializer -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct PasswordStageRequest { - #[serde(rename = "name")] - pub name: String, - /// Selection of backends to test the password against. - #[serde(rename = "backends")] - pub backends: Vec, - /// Flow used by an authenticated user to configure this Stage. If empty, user will not be able - /// to configure this stage. - #[serde( - rename = "configure_flow", - default, - with = "::serde_with::rust::double_option", - skip_serializing_if = "Option::is_none" - )] - pub configure_flow: Option>, - /// 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. - #[serde( - rename = "failed_attempts_before_cancel", - skip_serializing_if = "Option::is_none" - )] - pub failed_attempts_before_cancel: Option, - /// When enabled, provides a 'show password' button with the password input field. - #[serde( - rename = "allow_show_password", - skip_serializing_if = "Option::is_none" - )] - pub allow_show_password: Option, -} - -impl PasswordStageRequest { - /// PasswordStage Serializer - pub fn new(name: String, backends: Vec) -> PasswordStageRequest { - PasswordStageRequest { - name, - backends, - configure_flow: None, - failed_attempts_before_cancel: None, - allow_show_password: None, - } - } -} diff --git a/packages/client-rust/src/models/patched_agent_connector_request.rs b/packages/client-rust/src/models/patched_agent_connector_request.rs deleted file mode 100644 index a718ff1cc1..0000000000 --- a/packages/client-rust/src/models/patched_agent_connector_request.rs +++ /dev/null @@ -1,89 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct PatchedAgentConnectorRequest { - #[serde(rename = "connector_uuid", skip_serializing_if = "Option::is_none")] - pub connector_uuid: Option, - #[serde(rename = "name", skip_serializing_if = "Option::is_none")] - pub name: Option, - #[serde(rename = "enabled", skip_serializing_if = "Option::is_none")] - pub enabled: Option, - #[serde(rename = "snapshot_expiry", skip_serializing_if = "Option::is_none")] - pub snapshot_expiry: Option, - #[serde( - rename = "auth_session_duration", - skip_serializing_if = "Option::is_none" - )] - pub auth_session_duration: Option, - #[serde( - rename = "auth_terminate_session_on_expiry", - skip_serializing_if = "Option::is_none" - )] - pub auth_terminate_session_on_expiry: Option, - #[serde(rename = "refresh_interval", skip_serializing_if = "Option::is_none")] - pub refresh_interval: Option, - #[serde( - rename = "authorization_flow", - default, - with = "::serde_with::rust::double_option", - skip_serializing_if = "Option::is_none" - )] - pub authorization_flow: Option>, - #[serde(rename = "nss_uid_offset", skip_serializing_if = "Option::is_none")] - pub nss_uid_offset: Option, - #[serde(rename = "nss_gid_offset", skip_serializing_if = "Option::is_none")] - pub nss_gid_offset: Option, - #[serde( - rename = "challenge_key", - default, - with = "::serde_with::rust::double_option", - skip_serializing_if = "Option::is_none" - )] - pub challenge_key: Option>, - #[serde( - rename = "challenge_idle_timeout", - skip_serializing_if = "Option::is_none" - )] - pub challenge_idle_timeout: Option, - #[serde( - rename = "challenge_trigger_check_in", - skip_serializing_if = "Option::is_none" - )] - pub challenge_trigger_check_in: Option, - #[serde( - rename = "jwt_federation_providers", - skip_serializing_if = "Option::is_none" - )] - pub jwt_federation_providers: Option>, -} - -impl PatchedAgentConnectorRequest { - pub fn new() -> PatchedAgentConnectorRequest { - PatchedAgentConnectorRequest { - connector_uuid: None, - name: None, - enabled: None, - snapshot_expiry: None, - auth_session_duration: None, - auth_terminate_session_on_expiry: None, - refresh_interval: None, - authorization_flow: None, - nss_uid_offset: None, - nss_gid_offset: None, - challenge_key: None, - challenge_idle_timeout: None, - challenge_trigger_check_in: None, - jwt_federation_providers: None, - } - } -} diff --git a/packages/client-rust/src/models/patched_application_entitlement_request.rs b/packages/client-rust/src/models/patched_application_entitlement_request.rs deleted file mode 100644 index f82aa2f3d1..0000000000 --- a/packages/client-rust/src/models/patched_application_entitlement_request.rs +++ /dev/null @@ -1,33 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// PatchedApplicationEntitlementRequest : ApplicationEntitlement Serializer -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct PatchedApplicationEntitlementRequest { - #[serde(rename = "name", skip_serializing_if = "Option::is_none")] - pub name: Option, - #[serde(rename = "app", skip_serializing_if = "Option::is_none")] - pub app: Option, - #[serde(rename = "attributes", skip_serializing_if = "Option::is_none")] - pub attributes: Option>, -} - -impl PatchedApplicationEntitlementRequest { - /// ApplicationEntitlement Serializer - pub fn new() -> PatchedApplicationEntitlementRequest { - PatchedApplicationEntitlementRequest { - name: None, - app: None, - attributes: None, - } - } -} diff --git a/packages/client-rust/src/models/patched_application_request.rs b/packages/client-rust/src/models/patched_application_request.rs deleted file mode 100644 index 34e4e12770..0000000000 --- a/packages/client-rust/src/models/patched_application_request.rs +++ /dev/null @@ -1,68 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// PatchedApplicationRequest : Application Serializer -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct PatchedApplicationRequest { - /// Application's display Name. - #[serde(rename = "name", skip_serializing_if = "Option::is_none")] - pub name: Option, - /// Internal application name, used in URLs. - #[serde(rename = "slug", skip_serializing_if = "Option::is_none")] - pub slug: Option, - #[serde( - rename = "provider", - default, - with = "::serde_with::rust::double_option", - skip_serializing_if = "Option::is_none" - )] - pub provider: Option>, - #[serde( - rename = "backchannel_providers", - skip_serializing_if = "Option::is_none" - )] - pub backchannel_providers: Option>, - /// Open launch URL in a new browser tab or window. - #[serde(rename = "open_in_new_tab", skip_serializing_if = "Option::is_none")] - pub open_in_new_tab: Option, - #[serde(rename = "meta_launch_url", skip_serializing_if = "Option::is_none")] - pub meta_launch_url: Option, - #[serde(rename = "meta_icon", skip_serializing_if = "Option::is_none")] - pub meta_icon: Option, - #[serde(rename = "meta_description", skip_serializing_if = "Option::is_none")] - pub meta_description: Option, - #[serde(rename = "meta_publisher", skip_serializing_if = "Option::is_none")] - pub meta_publisher: Option, - #[serde(rename = "policy_engine_mode", skip_serializing_if = "Option::is_none")] - pub policy_engine_mode: Option, - #[serde(rename = "group", skip_serializing_if = "Option::is_none")] - pub group: Option, -} - -impl PatchedApplicationRequest { - /// Application Serializer - pub fn new() -> PatchedApplicationRequest { - PatchedApplicationRequest { - name: None, - slug: None, - provider: None, - backchannel_providers: None, - open_in_new_tab: None, - meta_launch_url: None, - meta_icon: None, - meta_description: None, - meta_publisher: None, - policy_engine_mode: None, - group: None, - } - } -} diff --git a/packages/client-rust/src/models/patched_authenticator_duo_stage_request.rs b/packages/client-rust/src/models/patched_authenticator_duo_stage_request.rs deleted file mode 100644 index a77212c2d3..0000000000 --- a/packages/client-rust/src/models/patched_authenticator_duo_stage_request.rs +++ /dev/null @@ -1,58 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// PatchedAuthenticatorDuoStageRequest : AuthenticatorDuoStage Serializer -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct PatchedAuthenticatorDuoStageRequest { - #[serde(rename = "name", skip_serializing_if = "Option::is_none")] - pub name: Option, - /// Flow used by an authenticated user to configure this Stage. If empty, user will not be able - /// to configure this stage. - #[serde( - rename = "configure_flow", - default, - with = "::serde_with::rust::double_option", - skip_serializing_if = "Option::is_none" - )] - pub configure_flow: Option>, - #[serde(rename = "friendly_name", skip_serializing_if = "Option::is_none")] - pub friendly_name: Option, - #[serde(rename = "client_id", skip_serializing_if = "Option::is_none")] - pub client_id: Option, - #[serde(rename = "client_secret", skip_serializing_if = "Option::is_none")] - pub client_secret: Option, - #[serde(rename = "api_hostname", skip_serializing_if = "Option::is_none")] - pub api_hostname: Option, - #[serde( - rename = "admin_integration_key", - skip_serializing_if = "Option::is_none" - )] - pub admin_integration_key: Option, - #[serde(rename = "admin_secret_key", skip_serializing_if = "Option::is_none")] - pub admin_secret_key: Option, -} - -impl PatchedAuthenticatorDuoStageRequest { - /// AuthenticatorDuoStage Serializer - pub fn new() -> PatchedAuthenticatorDuoStageRequest { - PatchedAuthenticatorDuoStageRequest { - name: None, - configure_flow: None, - friendly_name: None, - client_id: None, - client_secret: None, - api_hostname: None, - admin_integration_key: None, - admin_secret_key: None, - } - } -} diff --git a/packages/client-rust/src/models/patched_authenticator_email_stage_request.rs b/packages/client-rust/src/models/patched_authenticator_email_stage_request.rs deleted file mode 100644 index 30f92e9a76..0000000000 --- a/packages/client-rust/src/models/patched_authenticator_email_stage_request.rs +++ /dev/null @@ -1,82 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// PatchedAuthenticatorEmailStageRequest : AuthenticatorEmailStage Serializer -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct PatchedAuthenticatorEmailStageRequest { - #[serde(rename = "name", skip_serializing_if = "Option::is_none")] - pub name: Option, - /// Flow used by an authenticated user to configure this Stage. If empty, user will not be able - /// to configure this stage. - #[serde( - rename = "configure_flow", - default, - with = "::serde_with::rust::double_option", - skip_serializing_if = "Option::is_none" - )] - pub configure_flow: Option>, - #[serde(rename = "friendly_name", skip_serializing_if = "Option::is_none")] - pub friendly_name: Option, - /// When enabled, global Email connection settings will be used and connection settings below - /// will be ignored. - #[serde( - rename = "use_global_settings", - skip_serializing_if = "Option::is_none" - )] - pub use_global_settings: Option, - #[serde(rename = "host", skip_serializing_if = "Option::is_none")] - pub host: Option, - #[serde(rename = "port", skip_serializing_if = "Option::is_none")] - pub port: Option, - #[serde(rename = "username", skip_serializing_if = "Option::is_none")] - pub username: Option, - #[serde(rename = "password", skip_serializing_if = "Option::is_none")] - pub password: Option, - #[serde(rename = "use_tls", skip_serializing_if = "Option::is_none")] - pub use_tls: Option, - #[serde(rename = "use_ssl", skip_serializing_if = "Option::is_none")] - pub use_ssl: Option, - #[serde(rename = "timeout", skip_serializing_if = "Option::is_none")] - pub timeout: Option, - #[serde(rename = "from_address", skip_serializing_if = "Option::is_none")] - pub from_address: Option, - #[serde(rename = "subject", skip_serializing_if = "Option::is_none")] - pub subject: Option, - /// Time the token sent is valid (Format: hours=3,minutes=17,seconds=300). - #[serde(rename = "token_expiry", skip_serializing_if = "Option::is_none")] - pub token_expiry: Option, - #[serde(rename = "template", skip_serializing_if = "Option::is_none")] - pub template: Option, -} - -impl PatchedAuthenticatorEmailStageRequest { - /// AuthenticatorEmailStage Serializer - pub fn new() -> PatchedAuthenticatorEmailStageRequest { - PatchedAuthenticatorEmailStageRequest { - name: None, - configure_flow: None, - friendly_name: None, - use_global_settings: None, - host: None, - port: None, - username: None, - password: None, - use_tls: None, - use_ssl: None, - timeout: None, - from_address: None, - subject: None, - token_expiry: None, - template: None, - } - } -} diff --git a/packages/client-rust/src/models/patched_authenticator_endpoint_gdtc_stage_request.rs b/packages/client-rust/src/models/patched_authenticator_endpoint_gdtc_stage_request.rs deleted file mode 100644 index 15ee52a204..0000000000 --- a/packages/client-rust/src/models/patched_authenticator_endpoint_gdtc_stage_request.rs +++ /dev/null @@ -1,43 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// PatchedAuthenticatorEndpointGdtcStageRequest : AuthenticatorEndpointGDTCStage Serializer -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct PatchedAuthenticatorEndpointGdtcStageRequest { - #[serde(rename = "name", skip_serializing_if = "Option::is_none")] - pub name: Option, - /// Flow used by an authenticated user to configure this Stage. If empty, user will not be able - /// to configure this stage. - #[serde( - rename = "configure_flow", - default, - with = "::serde_with::rust::double_option", - skip_serializing_if = "Option::is_none" - )] - pub configure_flow: Option>, - #[serde(rename = "friendly_name", skip_serializing_if = "Option::is_none")] - pub friendly_name: Option, - #[serde(rename = "credentials", skip_serializing_if = "Option::is_none")] - pub credentials: Option>, -} - -impl PatchedAuthenticatorEndpointGdtcStageRequest { - /// AuthenticatorEndpointGDTCStage Serializer - pub fn new() -> PatchedAuthenticatorEndpointGdtcStageRequest { - PatchedAuthenticatorEndpointGdtcStageRequest { - name: None, - configure_flow: None, - friendly_name: None, - credentials: None, - } - } -} diff --git a/packages/client-rust/src/models/patched_authenticator_sms_stage_request.rs b/packages/client-rust/src/models/patched_authenticator_sms_stage_request.rs deleted file mode 100644 index 8db5bc3133..0000000000 --- a/packages/client-rust/src/models/patched_authenticator_sms_stage_request.rs +++ /dev/null @@ -1,73 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// PatchedAuthenticatorSmsStageRequest : AuthenticatorSMSStage Serializer -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct PatchedAuthenticatorSmsStageRequest { - #[serde(rename = "name", skip_serializing_if = "Option::is_none")] - pub name: Option, - /// Flow used by an authenticated user to configure this Stage. If empty, user will not be able - /// to configure this stage. - #[serde( - rename = "configure_flow", - default, - with = "::serde_with::rust::double_option", - skip_serializing_if = "Option::is_none" - )] - pub configure_flow: Option>, - #[serde(rename = "friendly_name", skip_serializing_if = "Option::is_none")] - pub friendly_name: Option, - #[serde(rename = "provider", skip_serializing_if = "Option::is_none")] - pub provider: Option, - #[serde(rename = "from_number", skip_serializing_if = "Option::is_none")] - pub from_number: Option, - #[serde(rename = "account_sid", skip_serializing_if = "Option::is_none")] - pub account_sid: Option, - #[serde(rename = "auth", skip_serializing_if = "Option::is_none")] - pub auth: Option, - #[serde(rename = "auth_password", skip_serializing_if = "Option::is_none")] - pub auth_password: Option, - #[serde(rename = "auth_type", skip_serializing_if = "Option::is_none")] - pub auth_type: Option, - /// 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. - #[serde(rename = "verify_only", skip_serializing_if = "Option::is_none")] - pub verify_only: Option, - /// Optionally modify the payload being sent to custom providers. - #[serde( - rename = "mapping", - default, - with = "::serde_with::rust::double_option", - skip_serializing_if = "Option::is_none" - )] - pub mapping: Option>, -} - -impl PatchedAuthenticatorSmsStageRequest { - /// AuthenticatorSMSStage Serializer - pub fn new() -> PatchedAuthenticatorSmsStageRequest { - PatchedAuthenticatorSmsStageRequest { - name: None, - configure_flow: None, - friendly_name: None, - provider: None, - from_number: None, - account_sid: None, - auth: None, - auth_password: None, - auth_type: None, - verify_only: None, - mapping: None, - } - } -} diff --git a/packages/client-rust/src/models/patched_authenticator_static_stage_request.rs b/packages/client-rust/src/models/patched_authenticator_static_stage_request.rs deleted file mode 100644 index 454f99925c..0000000000 --- a/packages/client-rust/src/models/patched_authenticator_static_stage_request.rs +++ /dev/null @@ -1,46 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// PatchedAuthenticatorStaticStageRequest : AuthenticatorStaticStage Serializer -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct PatchedAuthenticatorStaticStageRequest { - #[serde(rename = "name", skip_serializing_if = "Option::is_none")] - pub name: Option, - /// Flow used by an authenticated user to configure this Stage. If empty, user will not be able - /// to configure this stage. - #[serde( - rename = "configure_flow", - default, - with = "::serde_with::rust::double_option", - skip_serializing_if = "Option::is_none" - )] - pub configure_flow: Option>, - #[serde(rename = "friendly_name", skip_serializing_if = "Option::is_none")] - pub friendly_name: Option, - #[serde(rename = "token_count", skip_serializing_if = "Option::is_none")] - pub token_count: Option, - #[serde(rename = "token_length", skip_serializing_if = "Option::is_none")] - pub token_length: Option, -} - -impl PatchedAuthenticatorStaticStageRequest { - /// AuthenticatorStaticStage Serializer - pub fn new() -> PatchedAuthenticatorStaticStageRequest { - PatchedAuthenticatorStaticStageRequest { - name: None, - configure_flow: None, - friendly_name: None, - token_count: None, - token_length: None, - } - } -} diff --git a/packages/client-rust/src/models/patched_authenticator_totp_stage_request.rs b/packages/client-rust/src/models/patched_authenticator_totp_stage_request.rs deleted file mode 100644 index 52778781af..0000000000 --- a/packages/client-rust/src/models/patched_authenticator_totp_stage_request.rs +++ /dev/null @@ -1,43 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// PatchedAuthenticatorTotpStageRequest : AuthenticatorTOTPStage Serializer -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct PatchedAuthenticatorTotpStageRequest { - #[serde(rename = "name", skip_serializing_if = "Option::is_none")] - pub name: Option, - /// Flow used by an authenticated user to configure this Stage. If empty, user will not be able - /// to configure this stage. - #[serde( - rename = "configure_flow", - default, - with = "::serde_with::rust::double_option", - skip_serializing_if = "Option::is_none" - )] - pub configure_flow: Option>, - #[serde(rename = "friendly_name", skip_serializing_if = "Option::is_none")] - pub friendly_name: Option, - #[serde(rename = "digits", skip_serializing_if = "Option::is_none")] - pub digits: Option, -} - -impl PatchedAuthenticatorTotpStageRequest { - /// AuthenticatorTOTPStage Serializer - pub fn new() -> PatchedAuthenticatorTotpStageRequest { - PatchedAuthenticatorTotpStageRequest { - name: None, - configure_flow: None, - friendly_name: None, - digits: None, - } - } -} diff --git a/packages/client-rust/src/models/patched_authenticator_validate_stage_request.rs b/packages/client-rust/src/models/patched_authenticator_validate_stage_request.rs deleted file mode 100644 index 0569b9848a..0000000000 --- a/packages/client-rust/src/models/patched_authenticator_validate_stage_request.rs +++ /dev/null @@ -1,68 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// PatchedAuthenticatorValidateStageRequest : AuthenticatorValidateStage Serializer -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct PatchedAuthenticatorValidateStageRequest { - #[serde(rename = "name", skip_serializing_if = "Option::is_none")] - pub name: Option, - #[serde( - rename = "not_configured_action", - skip_serializing_if = "Option::is_none" - )] - pub not_configured_action: Option, - /// Device classes which can be used to authenticate - #[serde(rename = "device_classes", skip_serializing_if = "Option::is_none")] - pub device_classes: Option>, - /// Stages used to configure Authenticator when user doesn't have any compatible devices. After - /// this configuration Stage passes, the user is not prompted again. - #[serde( - rename = "configuration_stages", - skip_serializing_if = "Option::is_none" - )] - pub configuration_stages: Option>, - /// If any of the user's device has been used within this threshold, this stage will be skipped - #[serde( - rename = "last_auth_threshold", - skip_serializing_if = "Option::is_none" - )] - pub last_auth_threshold: Option, - /// Enforce user verification for WebAuthn devices. - #[serde( - rename = "webauthn_user_verification", - skip_serializing_if = "Option::is_none" - )] - pub webauthn_user_verification: Option, - #[serde(rename = "webauthn_hints", skip_serializing_if = "Option::is_none")] - pub webauthn_hints: Option>, - #[serde( - rename = "webauthn_allowed_device_types", - skip_serializing_if = "Option::is_none" - )] - pub webauthn_allowed_device_types: Option>, -} - -impl PatchedAuthenticatorValidateStageRequest { - /// AuthenticatorValidateStage Serializer - pub fn new() -> PatchedAuthenticatorValidateStageRequest { - PatchedAuthenticatorValidateStageRequest { - name: None, - not_configured_action: None, - device_classes: None, - configuration_stages: None, - last_auth_threshold: None, - webauthn_user_verification: None, - webauthn_hints: None, - webauthn_allowed_device_types: None, - } - } -} diff --git a/packages/client-rust/src/models/patched_authenticator_web_authn_stage_request.rs b/packages/client-rust/src/models/patched_authenticator_web_authn_stage_request.rs deleted file mode 100644 index 921cce9325..0000000000 --- a/packages/client-rust/src/models/patched_authenticator_web_authn_stage_request.rs +++ /dev/null @@ -1,76 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// PatchedAuthenticatorWebAuthnStageRequest : AuthenticatorWebAuthnStage Serializer -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct PatchedAuthenticatorWebAuthnStageRequest { - #[serde(rename = "name", skip_serializing_if = "Option::is_none")] - pub name: Option, - /// Flow used by an authenticated user to configure this Stage. If empty, user will not be able - /// to configure this stage. - #[serde( - rename = "configure_flow", - default, - with = "::serde_with::rust::double_option", - skip_serializing_if = "Option::is_none" - )] - pub configure_flow: Option>, - #[serde(rename = "friendly_name", skip_serializing_if = "Option::is_none")] - pub friendly_name: Option, - #[serde(rename = "user_verification", skip_serializing_if = "Option::is_none")] - pub user_verification: Option, - #[serde( - rename = "authenticator_attachment", - default, - with = "::serde_with::rust::double_option", - skip_serializing_if = "Option::is_none" - )] - pub authenticator_attachment: Option>, - #[serde( - rename = "resident_key_requirement", - skip_serializing_if = "Option::is_none" - )] - pub resident_key_requirement: Option, - #[serde(rename = "hints", skip_serializing_if = "Option::is_none")] - pub hints: Option>, - #[serde( - rename = "device_type_restrictions", - skip_serializing_if = "Option::is_none" - )] - pub device_type_restrictions: Option>, - /// When enabled, a given device can only be registered once. - #[serde( - rename = "prevent_duplicate_devices", - skip_serializing_if = "Option::is_none" - )] - pub prevent_duplicate_devices: Option, - #[serde(rename = "max_attempts", skip_serializing_if = "Option::is_none")] - pub max_attempts: Option, -} - -impl PatchedAuthenticatorWebAuthnStageRequest { - /// AuthenticatorWebAuthnStage Serializer - pub fn new() -> PatchedAuthenticatorWebAuthnStageRequest { - PatchedAuthenticatorWebAuthnStageRequest { - name: None, - configure_flow: None, - friendly_name: None, - user_verification: None, - authenticator_attachment: None, - resident_key_requirement: None, - hints: None, - device_type_restrictions: None, - prevent_duplicate_devices: None, - max_attempts: None, - } - } -} diff --git a/packages/client-rust/src/models/patched_blueprint_instance_request.rs b/packages/client-rust/src/models/patched_blueprint_instance_request.rs deleted file mode 100644 index cec1b2bd16..0000000000 --- a/packages/client-rust/src/models/patched_blueprint_instance_request.rs +++ /dev/null @@ -1,39 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// PatchedBlueprintInstanceRequest : Info about a single blueprint instance file -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct PatchedBlueprintInstanceRequest { - #[serde(rename = "name", skip_serializing_if = "Option::is_none")] - pub name: Option, - #[serde(rename = "path", skip_serializing_if = "Option::is_none")] - pub path: Option, - #[serde(rename = "context", skip_serializing_if = "Option::is_none")] - pub context: Option>, - #[serde(rename = "enabled", skip_serializing_if = "Option::is_none")] - pub enabled: Option, - #[serde(rename = "content", skip_serializing_if = "Option::is_none")] - pub content: Option, -} - -impl PatchedBlueprintInstanceRequest { - /// Info about a single blueprint instance file - pub fn new() -> PatchedBlueprintInstanceRequest { - PatchedBlueprintInstanceRequest { - name: None, - path: None, - context: None, - enabled: None, - content: None, - } - } -} diff --git a/packages/client-rust/src/models/patched_brand_request.rs b/packages/client-rust/src/models/patched_brand_request.rs deleted file mode 100644 index bfbf3b137b..0000000000 --- a/packages/client-rust/src/models/patched_brand_request.rs +++ /dev/null @@ -1,128 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// PatchedBrandRequest : Brand Serializer -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct PatchedBrandRequest { - /// Domain that activates this brand. Can be a superset, i.e. `a.b` for `aa.b` and `ba.b` - #[serde(rename = "domain", skip_serializing_if = "Option::is_none")] - pub domain: Option, - #[serde(rename = "default", skip_serializing_if = "Option::is_none")] - pub default: Option, - #[serde(rename = "branding_title", skip_serializing_if = "Option::is_none")] - pub branding_title: Option, - #[serde(rename = "branding_logo", skip_serializing_if = "Option::is_none")] - pub branding_logo: Option, - #[serde(rename = "branding_favicon", skip_serializing_if = "Option::is_none")] - pub branding_favicon: Option, - #[serde( - rename = "branding_custom_css", - skip_serializing_if = "Option::is_none" - )] - pub branding_custom_css: Option, - #[serde( - rename = "branding_default_flow_background", - skip_serializing_if = "Option::is_none" - )] - pub branding_default_flow_background: Option, - #[serde( - rename = "flow_authentication", - default, - with = "::serde_with::rust::double_option", - skip_serializing_if = "Option::is_none" - )] - pub flow_authentication: Option>, - #[serde( - rename = "flow_invalidation", - default, - with = "::serde_with::rust::double_option", - skip_serializing_if = "Option::is_none" - )] - pub flow_invalidation: Option>, - #[serde( - rename = "flow_recovery", - default, - with = "::serde_with::rust::double_option", - skip_serializing_if = "Option::is_none" - )] - pub flow_recovery: Option>, - #[serde( - rename = "flow_unenrollment", - default, - with = "::serde_with::rust::double_option", - skip_serializing_if = "Option::is_none" - )] - pub flow_unenrollment: Option>, - #[serde( - rename = "flow_user_settings", - default, - with = "::serde_with::rust::double_option", - skip_serializing_if = "Option::is_none" - )] - pub flow_user_settings: Option>, - #[serde( - rename = "flow_device_code", - default, - with = "::serde_with::rust::double_option", - skip_serializing_if = "Option::is_none" - )] - pub flow_device_code: Option>, - /// When set, external users will be redirected to this application after authenticating. - #[serde( - rename = "default_application", - default, - with = "::serde_with::rust::double_option", - skip_serializing_if = "Option::is_none" - )] - pub default_application: Option>, - /// Web Certificate used by the authentik Core webserver. - #[serde( - rename = "web_certificate", - default, - with = "::serde_with::rust::double_option", - skip_serializing_if = "Option::is_none" - )] - pub web_certificate: Option>, - /// Certificates used for client authentication. - #[serde( - rename = "client_certificates", - skip_serializing_if = "Option::is_none" - )] - pub client_certificates: Option>, - #[serde(rename = "attributes", skip_serializing_if = "Option::is_none")] - pub attributes: Option>, -} - -impl PatchedBrandRequest { - /// Brand Serializer - pub fn new() -> PatchedBrandRequest { - PatchedBrandRequest { - domain: None, - default: None, - branding_title: None, - branding_logo: None, - branding_favicon: None, - branding_custom_css: None, - branding_default_flow_background: None, - flow_authentication: None, - flow_invalidation: None, - flow_recovery: None, - flow_unenrollment: None, - flow_user_settings: None, - flow_device_code: None, - default_application: None, - web_certificate: None, - client_certificates: None, - attributes: None, - } - } -} diff --git a/packages/client-rust/src/models/patched_captcha_stage_request.rs b/packages/client-rust/src/models/patched_captcha_stage_request.rs deleted file mode 100644 index 0420a70263..0000000000 --- a/packages/client-rust/src/models/patched_captcha_stage_request.rs +++ /dev/null @@ -1,65 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// PatchedCaptchaStageRequest : CaptchaStage Serializer -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct PatchedCaptchaStageRequest { - #[serde(rename = "name", skip_serializing_if = "Option::is_none")] - pub name: Option, - /// Public key, acquired your captcha Provider. - #[serde(rename = "public_key", skip_serializing_if = "Option::is_none")] - pub public_key: Option, - /// Private key, acquired your captcha Provider. - #[serde(rename = "private_key", skip_serializing_if = "Option::is_none")] - pub private_key: Option, - #[serde(rename = "js_url", skip_serializing_if = "Option::is_none")] - pub js_url: Option, - #[serde(rename = "api_url", skip_serializing_if = "Option::is_none")] - pub api_url: Option, - #[serde(rename = "interactive", skip_serializing_if = "Option::is_none")] - pub interactive: Option, - #[serde( - rename = "score_min_threshold", - skip_serializing_if = "Option::is_none" - )] - pub score_min_threshold: Option, - #[serde( - rename = "score_max_threshold", - skip_serializing_if = "Option::is_none" - )] - pub score_max_threshold: Option, - /// 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 - #[serde( - rename = "error_on_invalid_score", - skip_serializing_if = "Option::is_none" - )] - pub error_on_invalid_score: Option, -} - -impl PatchedCaptchaStageRequest { - /// CaptchaStage Serializer - pub fn new() -> PatchedCaptchaStageRequest { - PatchedCaptchaStageRequest { - name: None, - public_key: None, - private_key: None, - js_url: None, - api_url: None, - interactive: None, - score_min_threshold: None, - score_max_threshold: None, - error_on_invalid_score: None, - } - } -} diff --git a/packages/client-rust/src/models/patched_certificate_key_pair_request.rs b/packages/client-rust/src/models/patched_certificate_key_pair_request.rs deleted file mode 100644 index b7b67abe50..0000000000 --- a/packages/client-rust/src/models/patched_certificate_key_pair_request.rs +++ /dev/null @@ -1,35 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// PatchedCertificateKeyPairRequest : CertificateKeyPair Serializer -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct PatchedCertificateKeyPairRequest { - #[serde(rename = "name", skip_serializing_if = "Option::is_none")] - pub name: Option, - /// PEM-encoded Certificate data - #[serde(rename = "certificate_data", skip_serializing_if = "Option::is_none")] - pub certificate_data: Option, - /// Optional Private Key. If this is set, you can use this keypair for encryption. - #[serde(rename = "key_data", skip_serializing_if = "Option::is_none")] - pub key_data: Option, -} - -impl PatchedCertificateKeyPairRequest { - /// CertificateKeyPair Serializer - pub fn new() -> PatchedCertificateKeyPairRequest { - PatchedCertificateKeyPairRequest { - name: None, - certificate_data: None, - key_data: None, - } - } -} diff --git a/packages/client-rust/src/models/patched_connection_token_request.rs b/packages/client-rust/src/models/patched_connection_token_request.rs deleted file mode 100644 index eb133b7953..0000000000 --- a/packages/client-rust/src/models/patched_connection_token_request.rs +++ /dev/null @@ -1,33 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// PatchedConnectionTokenRequest : ConnectionToken Serializer -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct PatchedConnectionTokenRequest { - #[serde(rename = "pk", skip_serializing_if = "Option::is_none")] - pub pk: Option, - #[serde(rename = "provider", skip_serializing_if = "Option::is_none")] - pub provider: Option, - #[serde(rename = "endpoint", skip_serializing_if = "Option::is_none")] - pub endpoint: Option, -} - -impl PatchedConnectionTokenRequest { - /// ConnectionToken Serializer - pub fn new() -> PatchedConnectionTokenRequest { - PatchedConnectionTokenRequest { - pk: None, - provider: None, - endpoint: None, - } - } -} diff --git a/packages/client-rust/src/models/patched_consent_stage_request.rs b/packages/client-rust/src/models/patched_consent_stage_request.rs deleted file mode 100644 index aa802fbcca..0000000000 --- a/packages/client-rust/src/models/patched_consent_stage_request.rs +++ /dev/null @@ -1,34 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// PatchedConsentStageRequest : ConsentStage Serializer -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct PatchedConsentStageRequest { - #[serde(rename = "name", skip_serializing_if = "Option::is_none")] - pub name: Option, - #[serde(rename = "mode", skip_serializing_if = "Option::is_none")] - pub mode: Option, - /// Offset after which consent expires. (Format: hours=1;minutes=2;seconds=3). - #[serde(rename = "consent_expire_in", skip_serializing_if = "Option::is_none")] - pub consent_expire_in: Option, -} - -impl PatchedConsentStageRequest { - /// ConsentStage Serializer - pub fn new() -> PatchedConsentStageRequest { - PatchedConsentStageRequest { - name: None, - mode: None, - consent_expire_in: None, - } - } -} diff --git a/packages/client-rust/src/models/patched_deny_stage_request.rs b/packages/client-rust/src/models/patched_deny_stage_request.rs deleted file mode 100644 index 632084dd02..0000000000 --- a/packages/client-rust/src/models/patched_deny_stage_request.rs +++ /dev/null @@ -1,30 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// PatchedDenyStageRequest : DenyStage Serializer -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct PatchedDenyStageRequest { - #[serde(rename = "name", skip_serializing_if = "Option::is_none")] - pub name: Option, - #[serde(rename = "deny_message", skip_serializing_if = "Option::is_none")] - pub deny_message: Option, -} - -impl PatchedDenyStageRequest { - /// DenyStage Serializer - pub fn new() -> PatchedDenyStageRequest { - PatchedDenyStageRequest { - name: None, - deny_message: None, - } - } -} diff --git a/packages/client-rust/src/models/patched_device_access_group_request.rs b/packages/client-rust/src/models/patched_device_access_group_request.rs deleted file mode 100644 index 5c99260250..0000000000 --- a/packages/client-rust/src/models/patched_device_access_group_request.rs +++ /dev/null @@ -1,28 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct PatchedDeviceAccessGroupRequest { - #[serde(rename = "name", skip_serializing_if = "Option::is_none")] - pub name: Option, - #[serde(rename = "attributes", skip_serializing_if = "Option::is_none")] - pub attributes: Option>, -} - -impl PatchedDeviceAccessGroupRequest { - pub fn new() -> PatchedDeviceAccessGroupRequest { - PatchedDeviceAccessGroupRequest { - name: None, - attributes: None, - } - } -} diff --git a/packages/client-rust/src/models/patched_device_user_binding_request.rs b/packages/client-rust/src/models/patched_device_user_binding_request.rs deleted file mode 100644 index 06d611e83f..0000000000 --- a/packages/client-rust/src/models/patched_device_user_binding_request.rs +++ /dev/null @@ -1,72 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// PatchedDeviceUserBindingRequest : PolicyBinding Serializer -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct PatchedDeviceUserBindingRequest { - #[serde( - rename = "policy", - default, - with = "::serde_with::rust::double_option", - skip_serializing_if = "Option::is_none" - )] - pub policy: Option>, - #[serde( - rename = "group", - default, - with = "::serde_with::rust::double_option", - skip_serializing_if = "Option::is_none" - )] - pub group: Option>, - #[serde( - rename = "user", - default, - with = "::serde_with::rust::double_option", - skip_serializing_if = "Option::is_none" - )] - pub user: Option>, - #[serde(rename = "target", skip_serializing_if = "Option::is_none")] - pub target: Option, - /// Negates the outcome of the policy. Messages are unaffected. - #[serde(rename = "negate", skip_serializing_if = "Option::is_none")] - pub negate: Option, - #[serde(rename = "enabled", skip_serializing_if = "Option::is_none")] - pub enabled: Option, - #[serde(rename = "order", skip_serializing_if = "Option::is_none")] - pub order: Option, - /// Timeout after which Policy execution is terminated. - #[serde(rename = "timeout", skip_serializing_if = "Option::is_none")] - pub timeout: Option, - /// Result if the Policy execution fails. - #[serde(rename = "failure_result", skip_serializing_if = "Option::is_none")] - pub failure_result: Option, - #[serde(rename = "is_primary", skip_serializing_if = "Option::is_none")] - pub is_primary: Option, -} - -impl PatchedDeviceUserBindingRequest { - /// PolicyBinding Serializer - pub fn new() -> PatchedDeviceUserBindingRequest { - PatchedDeviceUserBindingRequest { - policy: None, - group: None, - user: None, - target: None, - negate: None, - enabled: None, - order: None, - timeout: None, - failure_result: None, - is_primary: None, - } - } -} diff --git a/packages/client-rust/src/models/patched_docker_service_connection_request.rs b/packages/client-rust/src/models/patched_docker_service_connection_request.rs deleted file mode 100644 index ba21e2ebe7..0000000000 --- a/packages/client-rust/src/models/patched_docker_service_connection_request.rs +++ /dev/null @@ -1,54 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// PatchedDockerServiceConnectionRequest : DockerServiceConnection Serializer -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct PatchedDockerServiceConnectionRequest { - #[serde(rename = "name", skip_serializing_if = "Option::is_none")] - pub name: Option, - /// If enabled, use the local connection. Required Docker socket/Kubernetes Integration - #[serde(rename = "local", skip_serializing_if = "Option::is_none")] - pub local: Option, - /// Can be in the format of 'unix://' when connecting to a local docker daemon, or 'https://:2376' when connecting to a remote system. - #[serde(rename = "url", skip_serializing_if = "Option::is_none")] - pub url: Option, - /// CA which the endpoint's Certificate is verified against. Can be left empty for no - /// validation. - #[serde( - rename = "tls_verification", - default, - with = "::serde_with::rust::double_option", - skip_serializing_if = "Option::is_none" - )] - pub tls_verification: Option>, - /// Certificate/Key used for authentication. Can be left empty for no authentication. - #[serde( - rename = "tls_authentication", - default, - with = "::serde_with::rust::double_option", - skip_serializing_if = "Option::is_none" - )] - pub tls_authentication: Option>, -} - -impl PatchedDockerServiceConnectionRequest { - /// DockerServiceConnection Serializer - pub fn new() -> PatchedDockerServiceConnectionRequest { - PatchedDockerServiceConnectionRequest { - name: None, - local: None, - url: None, - tls_verification: None, - tls_authentication: None, - } - } -} diff --git a/packages/client-rust/src/models/patched_domain_request.rs b/packages/client-rust/src/models/patched_domain_request.rs deleted file mode 100644 index 284c59ac35..0000000000 --- a/packages/client-rust/src/models/patched_domain_request.rs +++ /dev/null @@ -1,33 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// PatchedDomainRequest : Domain Serializer -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct PatchedDomainRequest { - #[serde(rename = "domain", skip_serializing_if = "Option::is_none")] - pub domain: Option, - #[serde(rename = "is_primary", skip_serializing_if = "Option::is_none")] - pub is_primary: Option, - #[serde(rename = "tenant", skip_serializing_if = "Option::is_none")] - pub tenant: Option, -} - -impl PatchedDomainRequest { - /// Domain Serializer - pub fn new() -> PatchedDomainRequest { - PatchedDomainRequest { - domain: None, - is_primary: None, - tenant: None, - } - } -} diff --git a/packages/client-rust/src/models/patched_dummy_policy_request.rs b/packages/client-rust/src/models/patched_dummy_policy_request.rs deleted file mode 100644 index 4779e25837..0000000000 --- a/packages/client-rust/src/models/patched_dummy_policy_request.rs +++ /dev/null @@ -1,41 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// PatchedDummyPolicyRequest : Dummy Policy Serializer -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct PatchedDummyPolicyRequest { - #[serde(rename = "name", skip_serializing_if = "Option::is_none")] - pub name: Option, - /// When this option is enabled, all executions of this policy will be logged. By default, only - /// execution errors are logged. - #[serde(rename = "execution_logging", skip_serializing_if = "Option::is_none")] - pub execution_logging: Option, - #[serde(rename = "result", skip_serializing_if = "Option::is_none")] - pub result: Option, - #[serde(rename = "wait_min", skip_serializing_if = "Option::is_none")] - pub wait_min: Option, - #[serde(rename = "wait_max", skip_serializing_if = "Option::is_none")] - pub wait_max: Option, -} - -impl PatchedDummyPolicyRequest { - /// Dummy Policy Serializer - pub fn new() -> PatchedDummyPolicyRequest { - PatchedDummyPolicyRequest { - name: None, - execution_logging: None, - result: None, - wait_min: None, - wait_max: None, - } - } -} diff --git a/packages/client-rust/src/models/patched_dummy_stage_request.rs b/packages/client-rust/src/models/patched_dummy_stage_request.rs deleted file mode 100644 index 1860e34b89..0000000000 --- a/packages/client-rust/src/models/patched_dummy_stage_request.rs +++ /dev/null @@ -1,30 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// PatchedDummyStageRequest : DummyStage Serializer -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct PatchedDummyStageRequest { - #[serde(rename = "name", skip_serializing_if = "Option::is_none")] - pub name: Option, - #[serde(rename = "throw_error", skip_serializing_if = "Option::is_none")] - pub throw_error: Option, -} - -impl PatchedDummyStageRequest { - /// DummyStage Serializer - pub fn new() -> PatchedDummyStageRequest { - PatchedDummyStageRequest { - name: None, - throw_error: None, - } - } -} diff --git a/packages/client-rust/src/models/patched_duo_device_request.rs b/packages/client-rust/src/models/patched_duo_device_request.rs deleted file mode 100644 index 7a96be6697..0000000000 --- a/packages/client-rust/src/models/patched_duo_device_request.rs +++ /dev/null @@ -1,26 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// PatchedDuoDeviceRequest : Serializer for Duo authenticator devices -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct PatchedDuoDeviceRequest { - /// The human-readable name of this device. - #[serde(rename = "name", skip_serializing_if = "Option::is_none")] - pub name: Option, -} - -impl PatchedDuoDeviceRequest { - /// Serializer for Duo authenticator devices - pub fn new() -> PatchedDuoDeviceRequest { - PatchedDuoDeviceRequest { name: None } - } -} diff --git a/packages/client-rust/src/models/patched_email_device_request.rs b/packages/client-rust/src/models/patched_email_device_request.rs deleted file mode 100644 index fe5bbc9d33..0000000000 --- a/packages/client-rust/src/models/patched_email_device_request.rs +++ /dev/null @@ -1,26 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// PatchedEmailDeviceRequest : Serializer for email authenticator devices -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct PatchedEmailDeviceRequest { - /// The human-readable name of this device. - #[serde(rename = "name", skip_serializing_if = "Option::is_none")] - pub name: Option, -} - -impl PatchedEmailDeviceRequest { - /// Serializer for email authenticator devices - pub fn new() -> PatchedEmailDeviceRequest { - PatchedEmailDeviceRequest { name: None } - } -} diff --git a/packages/client-rust/src/models/patched_email_stage_request.rs b/packages/client-rust/src/models/patched_email_stage_request.rs deleted file mode 100644 index aad526b827..0000000000 --- a/packages/client-rust/src/models/patched_email_stage_request.rs +++ /dev/null @@ -1,91 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// PatchedEmailStageRequest : EmailStage Serializer -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct PatchedEmailStageRequest { - #[serde(rename = "name", skip_serializing_if = "Option::is_none")] - pub name: Option, - /// When enabled, global Email connection settings will be used and connection settings below - /// will be ignored. - #[serde( - rename = "use_global_settings", - skip_serializing_if = "Option::is_none" - )] - pub use_global_settings: Option, - #[serde(rename = "host", skip_serializing_if = "Option::is_none")] - pub host: Option, - #[serde(rename = "port", skip_serializing_if = "Option::is_none")] - pub port: Option, - #[serde(rename = "username", skip_serializing_if = "Option::is_none")] - pub username: Option, - #[serde(rename = "password", skip_serializing_if = "Option::is_none")] - pub password: Option, - #[serde(rename = "use_tls", skip_serializing_if = "Option::is_none")] - pub use_tls: Option, - #[serde(rename = "use_ssl", skip_serializing_if = "Option::is_none")] - pub use_ssl: Option, - #[serde(rename = "timeout", skip_serializing_if = "Option::is_none")] - pub timeout: Option, - #[serde(rename = "from_address", skip_serializing_if = "Option::is_none")] - pub from_address: Option, - /// Time the token sent is valid (Format: hours=3,minutes=17,seconds=300). - #[serde(rename = "token_expiry", skip_serializing_if = "Option::is_none")] - pub token_expiry: Option, - #[serde(rename = "subject", skip_serializing_if = "Option::is_none")] - pub subject: Option, - #[serde(rename = "template", skip_serializing_if = "Option::is_none")] - pub template: Option, - /// Activate users upon completion of stage. - #[serde( - rename = "activate_user_on_success", - skip_serializing_if = "Option::is_none" - )] - pub activate_user_on_success: Option, - #[serde( - rename = "recovery_max_attempts", - skip_serializing_if = "Option::is_none" - )] - pub recovery_max_attempts: Option, - /// 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). - #[serde( - rename = "recovery_cache_timeout", - skip_serializing_if = "Option::is_none" - )] - pub recovery_cache_timeout: Option, -} - -impl PatchedEmailStageRequest { - /// EmailStage Serializer - pub fn new() -> PatchedEmailStageRequest { - PatchedEmailStageRequest { - name: None, - use_global_settings: None, - host: None, - port: None, - username: None, - password: None, - use_tls: None, - use_ssl: None, - timeout: None, - from_address: None, - token_expiry: None, - subject: None, - template: None, - activate_user_on_success: None, - recovery_max_attempts: None, - recovery_cache_timeout: None, - } - } -} diff --git a/packages/client-rust/src/models/patched_endpoint_device_request.rs b/packages/client-rust/src/models/patched_endpoint_device_request.rs deleted file mode 100644 index f2cf330fd4..0000000000 --- a/packages/client-rust/src/models/patched_endpoint_device_request.rs +++ /dev/null @@ -1,53 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct PatchedEndpointDeviceRequest { - #[serde(rename = "device_uuid", skip_serializing_if = "Option::is_none")] - pub device_uuid: Option, - #[serde(rename = "name", skip_serializing_if = "Option::is_none")] - pub name: Option, - #[serde( - rename = "access_group", - default, - with = "::serde_with::rust::double_option", - skip_serializing_if = "Option::is_none" - )] - pub access_group: Option>, - #[serde(rename = "access_group_obj", skip_serializing_if = "Option::is_none")] - pub access_group_obj: Option, - #[serde(rename = "expiring", skip_serializing_if = "Option::is_none")] - pub expiring: Option, - #[serde( - rename = "expires", - default, - with = "::serde_with::rust::double_option", - skip_serializing_if = "Option::is_none" - )] - pub expires: Option>, - #[serde(rename = "attributes", skip_serializing_if = "Option::is_none")] - pub attributes: Option>, -} - -impl PatchedEndpointDeviceRequest { - pub fn new() -> PatchedEndpointDeviceRequest { - PatchedEndpointDeviceRequest { - device_uuid: None, - name: None, - access_group: None, - access_group_obj: None, - expiring: None, - expires: None, - attributes: None, - } - } -} diff --git a/packages/client-rust/src/models/patched_endpoint_request.rs b/packages/client-rust/src/models/patched_endpoint_request.rs deleted file mode 100644 index 9db491b868..0000000000 --- a/packages/client-rust/src/models/patched_endpoint_request.rs +++ /dev/null @@ -1,51 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// PatchedEndpointRequest : Endpoint Serializer -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct PatchedEndpointRequest { - #[serde(rename = "name", skip_serializing_if = "Option::is_none")] - pub name: Option, - #[serde(rename = "provider", skip_serializing_if = "Option::is_none")] - pub provider: Option, - #[serde(rename = "protocol", skip_serializing_if = "Option::is_none")] - pub protocol: Option, - #[serde(rename = "host", skip_serializing_if = "Option::is_none")] - pub host: Option, - #[serde(rename = "settings", skip_serializing_if = "Option::is_none")] - pub settings: Option>, - #[serde(rename = "property_mappings", skip_serializing_if = "Option::is_none")] - pub property_mappings: Option>, - #[serde(rename = "auth_mode", skip_serializing_if = "Option::is_none")] - pub auth_mode: Option, - #[serde( - rename = "maximum_connections", - skip_serializing_if = "Option::is_none" - )] - pub maximum_connections: Option, -} - -impl PatchedEndpointRequest { - /// Endpoint Serializer - pub fn new() -> PatchedEndpointRequest { - PatchedEndpointRequest { - name: None, - provider: None, - protocol: None, - host: None, - settings: None, - property_mappings: None, - auth_mode: None, - maximum_connections: None, - } - } -} diff --git a/packages/client-rust/src/models/patched_endpoint_stage_request.rs b/packages/client-rust/src/models/patched_endpoint_stage_request.rs deleted file mode 100644 index b989c5a45c..0000000000 --- a/packages/client-rust/src/models/patched_endpoint_stage_request.rs +++ /dev/null @@ -1,33 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// PatchedEndpointStageRequest : EndpointStage Serializer -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct PatchedEndpointStageRequest { - #[serde(rename = "name", skip_serializing_if = "Option::is_none")] - pub name: Option, - #[serde(rename = "connector", skip_serializing_if = "Option::is_none")] - pub connector: Option, - #[serde(rename = "mode", skip_serializing_if = "Option::is_none")] - pub mode: Option, -} - -impl PatchedEndpointStageRequest { - /// EndpointStage Serializer - pub fn new() -> PatchedEndpointStageRequest { - PatchedEndpointStageRequest { - name: None, - connector: None, - mode: None, - } - } -} diff --git a/packages/client-rust/src/models/patched_enrollment_token_request.rs b/packages/client-rust/src/models/patched_enrollment_token_request.rs deleted file mode 100644 index 202405d953..0000000000 --- a/packages/client-rust/src/models/patched_enrollment_token_request.rs +++ /dev/null @@ -1,47 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct PatchedEnrollmentTokenRequest { - #[serde( - rename = "device_group", - default, - with = "::serde_with::rust::double_option", - skip_serializing_if = "Option::is_none" - )] - pub device_group: Option>, - #[serde(rename = "connector", skip_serializing_if = "Option::is_none")] - pub connector: Option, - #[serde(rename = "name", skip_serializing_if = "Option::is_none")] - pub name: Option, - #[serde(rename = "expiring", skip_serializing_if = "Option::is_none")] - pub expiring: Option, - #[serde( - rename = "expires", - default, - with = "::serde_with::rust::double_option", - skip_serializing_if = "Option::is_none" - )] - pub expires: Option>, -} - -impl PatchedEnrollmentTokenRequest { - pub fn new() -> PatchedEnrollmentTokenRequest { - PatchedEnrollmentTokenRequest { - device_group: None, - connector: None, - name: None, - expiring: None, - expires: None, - } - } -} diff --git a/packages/client-rust/src/models/patched_event_matcher_policy_request.rs b/packages/client-rust/src/models/patched_event_matcher_policy_request.rs deleted file mode 100644 index c77202db26..0000000000 --- a/packages/client-rust/src/models/patched_event_matcher_policy_request.rs +++ /dev/null @@ -1,71 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// PatchedEventMatcherPolicyRequest : Event Matcher Policy Serializer -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct PatchedEventMatcherPolicyRequest { - #[serde(rename = "name", skip_serializing_if = "Option::is_none")] - pub name: Option, - /// When this option is enabled, all executions of this policy will be logged. By default, only - /// execution errors are logged. - #[serde(rename = "execution_logging", skip_serializing_if = "Option::is_none")] - pub execution_logging: Option, - /// Match created events with this action type. When left empty, all action types will be - /// matched. - #[serde( - rename = "action", - default, - with = "::serde_with::rust::double_option", - skip_serializing_if = "Option::is_none" - )] - pub action: Option>, - /// Matches Event's Client IP (strict matching, for network matching use an Expression Policy) - #[serde( - rename = "client_ip", - default, - with = "::serde_with::rust::double_option", - skip_serializing_if = "Option::is_none" - )] - pub client_ip: Option>, - /// Match events created by selected application. When left empty, all applications are - /// matched. - #[serde( - rename = "app", - default, - with = "::serde_with::rust::double_option", - skip_serializing_if = "Option::is_none" - )] - pub app: Option>, - /// 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. - #[serde( - rename = "model", - default, - with = "::serde_with::rust::double_option", - skip_serializing_if = "Option::is_none" - )] - pub model: Option>, -} - -impl PatchedEventMatcherPolicyRequest { - /// Event Matcher Policy Serializer - pub fn new() -> PatchedEventMatcherPolicyRequest { - PatchedEventMatcherPolicyRequest { - name: None, - execution_logging: None, - action: None, - client_ip: None, - app: None, - model: None, - } - } -} diff --git a/packages/client-rust/src/models/patched_event_request.rs b/packages/client-rust/src/models/patched_event_request.rs deleted file mode 100644 index febea710bc..0000000000 --- a/packages/client-rust/src/models/patched_event_request.rs +++ /dev/null @@ -1,50 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// PatchedEventRequest : Event Serializer -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct PatchedEventRequest { - #[serde(rename = "user", skip_serializing_if = "Option::is_none")] - pub user: Option>, - #[serde(rename = "action", skip_serializing_if = "Option::is_none")] - pub action: Option, - #[serde(rename = "app", skip_serializing_if = "Option::is_none")] - pub app: Option, - #[serde(rename = "context", skip_serializing_if = "Option::is_none")] - pub context: Option>, - #[serde( - rename = "client_ip", - default, - with = "::serde_with::rust::double_option", - skip_serializing_if = "Option::is_none" - )] - pub client_ip: Option>, - #[serde(rename = "expires", skip_serializing_if = "Option::is_none")] - pub expires: Option, - #[serde(rename = "brand", skip_serializing_if = "Option::is_none")] - pub brand: Option>, -} - -impl PatchedEventRequest { - /// Event Serializer - pub fn new() -> PatchedEventRequest { - PatchedEventRequest { - user: None, - action: None, - app: None, - context: None, - client_ip: None, - expires: None, - brand: None, - } - } -} diff --git a/packages/client-rust/src/models/patched_expression_policy_request.rs b/packages/client-rust/src/models/patched_expression_policy_request.rs deleted file mode 100644 index 96bc7ae1f5..0000000000 --- a/packages/client-rust/src/models/patched_expression_policy_request.rs +++ /dev/null @@ -1,35 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// PatchedExpressionPolicyRequest : Group Membership Policy Serializer -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct PatchedExpressionPolicyRequest { - #[serde(rename = "name", skip_serializing_if = "Option::is_none")] - pub name: Option, - /// When this option is enabled, all executions of this policy will be logged. By default, only - /// execution errors are logged. - #[serde(rename = "execution_logging", skip_serializing_if = "Option::is_none")] - pub execution_logging: Option, - #[serde(rename = "expression", skip_serializing_if = "Option::is_none")] - pub expression: Option, -} - -impl PatchedExpressionPolicyRequest { - /// Group Membership Policy Serializer - pub fn new() -> PatchedExpressionPolicyRequest { - PatchedExpressionPolicyRequest { - name: None, - execution_logging: None, - expression: None, - } - } -} diff --git a/packages/client-rust/src/models/patched_fleet_connector_request.rs b/packages/client-rust/src/models/patched_fleet_connector_request.rs deleted file mode 100644 index f72e0e2bec..0000000000 --- a/packages/client-rust/src/models/patched_fleet_connector_request.rs +++ /dev/null @@ -1,58 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// PatchedFleetConnectorRequest : FleetConnector Serializer -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct PatchedFleetConnectorRequest { - #[serde(rename = "connector_uuid", skip_serializing_if = "Option::is_none")] - pub connector_uuid: Option, - #[serde(rename = "name", skip_serializing_if = "Option::is_none")] - pub name: Option, - #[serde(rename = "enabled", skip_serializing_if = "Option::is_none")] - pub enabled: Option, - #[serde(rename = "url", skip_serializing_if = "Option::is_none")] - pub url: Option, - #[serde(rename = "token", skip_serializing_if = "Option::is_none")] - pub token: Option, - /// Configure additional headers to be sent. Mapping should return a dictionary of key-value - /// pairs - #[serde( - rename = "headers_mapping", - default, - with = "::serde_with::rust::double_option", - skip_serializing_if = "Option::is_none" - )] - pub headers_mapping: Option>, - #[serde(rename = "map_users", skip_serializing_if = "Option::is_none")] - pub map_users: Option, - #[serde( - rename = "map_teams_access_group", - skip_serializing_if = "Option::is_none" - )] - pub map_teams_access_group: Option, -} - -impl PatchedFleetConnectorRequest { - /// FleetConnector Serializer - pub fn new() -> PatchedFleetConnectorRequest { - PatchedFleetConnectorRequest { - connector_uuid: None, - name: None, - enabled: None, - url: None, - token: None, - headers_mapping: None, - map_users: None, - map_teams_access_group: None, - } - } -} diff --git a/packages/client-rust/src/models/patched_flow_request.rs b/packages/client-rust/src/models/patched_flow_request.rs deleted file mode 100644 index 312fdf62fe..0000000000 --- a/packages/client-rust/src/models/patched_flow_request.rs +++ /dev/null @@ -1,63 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// PatchedFlowRequest : Flow Serializer -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct PatchedFlowRequest { - #[serde(rename = "name", skip_serializing_if = "Option::is_none")] - pub name: Option, - /// Visible in the URL. - #[serde(rename = "slug", skip_serializing_if = "Option::is_none")] - pub slug: Option, - /// Shown as the Title in Flow pages. - #[serde(rename = "title", skip_serializing_if = "Option::is_none")] - pub title: Option, - /// Decides what this Flow is used for. For example, the Authentication flow is redirect to - /// when an un-authenticated user visits authentik. - #[serde(rename = "designation", skip_serializing_if = "Option::is_none")] - pub designation: Option, - /// Background shown during execution - #[serde(rename = "background", skip_serializing_if = "Option::is_none")] - pub background: Option, - #[serde(rename = "policy_engine_mode", skip_serializing_if = "Option::is_none")] - pub policy_engine_mode: Option, - /// Enable compatibility mode, increases compatibility with password managers on mobile - /// devices. - #[serde(rename = "compatibility_mode", skip_serializing_if = "Option::is_none")] - pub compatibility_mode: Option, - #[serde(rename = "layout", skip_serializing_if = "Option::is_none")] - pub layout: Option, - /// Configure what should happen when a flow denies access to a user. - #[serde(rename = "denied_action", skip_serializing_if = "Option::is_none")] - pub denied_action: Option, - /// Required level of authentication and authorization to access a flow. - #[serde(rename = "authentication", skip_serializing_if = "Option::is_none")] - pub authentication: Option, -} - -impl PatchedFlowRequest { - /// Flow Serializer - pub fn new() -> PatchedFlowRequest { - PatchedFlowRequest { - name: None, - slug: None, - title: None, - designation: None, - background: None, - policy_engine_mode: None, - compatibility_mode: None, - layout: None, - denied_action: None, - authentication: None, - } - } -} diff --git a/packages/client-rust/src/models/patched_flow_stage_binding_request.rs b/packages/client-rust/src/models/patched_flow_stage_binding_request.rs deleted file mode 100644 index b4d8f89900..0000000000 --- a/packages/client-rust/src/models/patched_flow_stage_binding_request.rs +++ /dev/null @@ -1,57 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// PatchedFlowStageBindingRequest : FlowStageBinding Serializer -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct PatchedFlowStageBindingRequest { - #[serde(rename = "target", skip_serializing_if = "Option::is_none")] - pub target: Option, - #[serde(rename = "stage", skip_serializing_if = "Option::is_none")] - pub stage: Option, - /// Evaluate policies during the Flow planning process. - #[serde(rename = "evaluate_on_plan", skip_serializing_if = "Option::is_none")] - pub evaluate_on_plan: Option, - /// Evaluate policies when the Stage is presented to the user. - #[serde( - rename = "re_evaluate_policies", - skip_serializing_if = "Option::is_none" - )] - pub re_evaluate_policies: Option, - #[serde(rename = "order", skip_serializing_if = "Option::is_none")] - pub order: Option, - #[serde(rename = "policy_engine_mode", skip_serializing_if = "Option::is_none")] - pub policy_engine_mode: Option, - /// 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. - #[serde( - rename = "invalid_response_action", - skip_serializing_if = "Option::is_none" - )] - pub invalid_response_action: Option, -} - -impl PatchedFlowStageBindingRequest { - /// FlowStageBinding Serializer - pub fn new() -> PatchedFlowStageBindingRequest { - PatchedFlowStageBindingRequest { - target: None, - stage: None, - evaluate_on_plan: None, - re_evaluate_policies: None, - order: None, - policy_engine_mode: None, - invalid_response_action: None, - } - } -} diff --git a/packages/client-rust/src/models/patched_geo_ip_policy_request.rs b/packages/client-rust/src/models/patched_geo_ip_policy_request.rs deleted file mode 100644 index 2bd63c5f5f..0000000000 --- a/packages/client-rust/src/models/patched_geo_ip_policy_request.rs +++ /dev/null @@ -1,74 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// PatchedGeoIpPolicyRequest : GeoIP Policy Serializer -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct PatchedGeoIpPolicyRequest { - #[serde(rename = "name", skip_serializing_if = "Option::is_none")] - pub name: Option, - /// When this option is enabled, all executions of this policy will be logged. By default, only - /// execution errors are logged. - #[serde(rename = "execution_logging", skip_serializing_if = "Option::is_none")] - pub execution_logging: Option, - #[serde(rename = "asns", skip_serializing_if = "Option::is_none")] - pub asns: Option>, - #[serde(rename = "countries", skip_serializing_if = "Option::is_none")] - pub countries: Option>, - #[serde( - rename = "check_history_distance", - skip_serializing_if = "Option::is_none" - )] - pub check_history_distance: Option, - #[serde( - rename = "history_max_distance_km", - skip_serializing_if = "Option::is_none" - )] - pub history_max_distance_km: Option, - #[serde( - rename = "distance_tolerance_km", - skip_serializing_if = "Option::is_none" - )] - pub distance_tolerance_km: Option, - #[serde( - rename = "history_login_count", - skip_serializing_if = "Option::is_none" - )] - pub history_login_count: Option, - #[serde( - rename = "check_impossible_travel", - skip_serializing_if = "Option::is_none" - )] - pub check_impossible_travel: Option, - #[serde( - rename = "impossible_tolerance_km", - skip_serializing_if = "Option::is_none" - )] - pub impossible_tolerance_km: Option, -} - -impl PatchedGeoIpPolicyRequest { - /// GeoIP Policy Serializer - pub fn new() -> PatchedGeoIpPolicyRequest { - PatchedGeoIpPolicyRequest { - name: None, - execution_logging: None, - asns: None, - countries: None, - check_history_distance: None, - history_max_distance_km: None, - distance_tolerance_km: None, - history_login_count: None, - check_impossible_travel: None, - impossible_tolerance_km: None, - } - } -} diff --git a/packages/client-rust/src/models/patched_google_chrome_connector_request.rs b/packages/client-rust/src/models/patched_google_chrome_connector_request.rs deleted file mode 100644 index 3e4fccf6c6..0000000000 --- a/packages/client-rust/src/models/patched_google_chrome_connector_request.rs +++ /dev/null @@ -1,36 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// PatchedGoogleChromeConnectorRequest : GoogleChromeConnector Serializer -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct PatchedGoogleChromeConnectorRequest { - #[serde(rename = "connector_uuid", skip_serializing_if = "Option::is_none")] - pub connector_uuid: Option, - #[serde(rename = "name", skip_serializing_if = "Option::is_none")] - pub name: Option, - #[serde(rename = "enabled", skip_serializing_if = "Option::is_none")] - pub enabled: Option, - #[serde(rename = "credentials", skip_serializing_if = "Option::is_none")] - pub credentials: Option>, -} - -impl PatchedGoogleChromeConnectorRequest { - /// GoogleChromeConnector Serializer - pub fn new() -> PatchedGoogleChromeConnectorRequest { - PatchedGoogleChromeConnectorRequest { - connector_uuid: None, - name: None, - enabled: None, - credentials: None, - } - } -} diff --git a/packages/client-rust/src/models/patched_google_endpoint_device_request.rs b/packages/client-rust/src/models/patched_google_endpoint_device_request.rs deleted file mode 100644 index 14175a3067..0000000000 --- a/packages/client-rust/src/models/patched_google_endpoint_device_request.rs +++ /dev/null @@ -1,31 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// PatchedGoogleEndpointDeviceRequest : Serializer for Endpoint authenticator devices -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct PatchedGoogleEndpointDeviceRequest { - #[serde(rename = "pk", skip_serializing_if = "Option::is_none")] - pub pk: Option, - /// The human-readable name of this device. - #[serde(rename = "name", skip_serializing_if = "Option::is_none")] - pub name: Option, -} - -impl PatchedGoogleEndpointDeviceRequest { - /// Serializer for Endpoint authenticator devices - pub fn new() -> PatchedGoogleEndpointDeviceRequest { - PatchedGoogleEndpointDeviceRequest { - pk: None, - name: None, - } - } -} diff --git a/packages/client-rust/src/models/patched_google_workspace_provider_mapping_request.rs b/packages/client-rust/src/models/patched_google_workspace_provider_mapping_request.rs deleted file mode 100644 index 6f4ad697a4..0000000000 --- a/packages/client-rust/src/models/patched_google_workspace_provider_mapping_request.rs +++ /dev/null @@ -1,41 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// PatchedGoogleWorkspaceProviderMappingRequest : GoogleWorkspaceProviderMapping Serializer -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct PatchedGoogleWorkspaceProviderMappingRequest { - /// 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. - #[serde( - rename = "managed", - default, - with = "::serde_with::rust::double_option", - skip_serializing_if = "Option::is_none" - )] - pub managed: Option>, - #[serde(rename = "name", skip_serializing_if = "Option::is_none")] - pub name: Option, - #[serde(rename = "expression", skip_serializing_if = "Option::is_none")] - pub expression: Option, -} - -impl PatchedGoogleWorkspaceProviderMappingRequest { - /// GoogleWorkspaceProviderMapping Serializer - pub fn new() -> PatchedGoogleWorkspaceProviderMappingRequest { - PatchedGoogleWorkspaceProviderMappingRequest { - managed: None, - name: None, - expression: None, - } - } -} diff --git a/packages/client-rust/src/models/patched_google_workspace_provider_request.rs b/packages/client-rust/src/models/patched_google_workspace_provider_request.rs deleted file mode 100644 index 74716ec082..0000000000 --- a/packages/client-rust/src/models/patched_google_workspace_provider_request.rs +++ /dev/null @@ -1,87 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// PatchedGoogleWorkspaceProviderRequest : GoogleWorkspaceProvider Serializer -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct PatchedGoogleWorkspaceProviderRequest { - #[serde(rename = "name", skip_serializing_if = "Option::is_none")] - pub name: Option, - #[serde(rename = "property_mappings", skip_serializing_if = "Option::is_none")] - pub property_mappings: Option>, - /// Property mappings used for group creation/updating. - #[serde( - rename = "property_mappings_group", - skip_serializing_if = "Option::is_none" - )] - pub property_mappings_group: Option>, - #[serde(rename = "delegated_subject", skip_serializing_if = "Option::is_none")] - pub delegated_subject: Option, - #[serde(rename = "credentials", skip_serializing_if = "Option::is_none")] - pub credentials: Option>, - #[serde(rename = "scopes", skip_serializing_if = "Option::is_none")] - pub scopes: Option, - #[serde( - rename = "exclude_users_service_account", - skip_serializing_if = "Option::is_none" - )] - pub exclude_users_service_account: Option, - #[serde( - rename = "filter_group", - default, - with = "::serde_with::rust::double_option", - skip_serializing_if = "Option::is_none" - )] - pub filter_group: Option>, - #[serde(rename = "user_delete_action", skip_serializing_if = "Option::is_none")] - pub user_delete_action: Option, - #[serde( - rename = "group_delete_action", - skip_serializing_if = "Option::is_none" - )] - pub group_delete_action: Option, - #[serde( - rename = "default_group_email_domain", - skip_serializing_if = "Option::is_none" - )] - pub default_group_email_domain: Option, - /// Controls the number of objects synced in a single task - #[serde(rename = "sync_page_size", skip_serializing_if = "Option::is_none")] - pub sync_page_size: Option, - /// Timeout for synchronization of a single page - #[serde(rename = "sync_page_timeout", skip_serializing_if = "Option::is_none")] - pub sync_page_timeout: Option, - /// When enabled, provider will not modify or create objects in the remote system. - #[serde(rename = "dry_run", skip_serializing_if = "Option::is_none")] - pub dry_run: Option, -} - -impl PatchedGoogleWorkspaceProviderRequest { - /// GoogleWorkspaceProvider Serializer - pub fn new() -> PatchedGoogleWorkspaceProviderRequest { - PatchedGoogleWorkspaceProviderRequest { - name: None, - property_mappings: None, - property_mappings_group: None, - delegated_subject: None, - credentials: None, - scopes: None, - exclude_users_service_account: None, - filter_group: None, - user_delete_action: None, - group_delete_action: None, - default_group_email_domain: None, - sync_page_size: None, - sync_page_timeout: None, - dry_run: None, - } - } -} diff --git a/packages/client-rust/src/models/patched_group_kerberos_source_connection_request.rs b/packages/client-rust/src/models/patched_group_kerberos_source_connection_request.rs deleted file mode 100644 index 2d1020bcb3..0000000000 --- a/packages/client-rust/src/models/patched_group_kerberos_source_connection_request.rs +++ /dev/null @@ -1,33 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// PatchedGroupKerberosSourceConnectionRequest : Group Source Connection -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct PatchedGroupKerberosSourceConnectionRequest { - #[serde(rename = "group", skip_serializing_if = "Option::is_none")] - pub group: Option, - #[serde(rename = "source", skip_serializing_if = "Option::is_none")] - pub source: Option, - #[serde(rename = "identifier", skip_serializing_if = "Option::is_none")] - pub identifier: Option, -} - -impl PatchedGroupKerberosSourceConnectionRequest { - /// Group Source Connection - pub fn new() -> PatchedGroupKerberosSourceConnectionRequest { - PatchedGroupKerberosSourceConnectionRequest { - group: None, - source: None, - identifier: None, - } - } -} diff --git a/packages/client-rust/src/models/patched_group_ldap_source_connection_request.rs b/packages/client-rust/src/models/patched_group_ldap_source_connection_request.rs deleted file mode 100644 index a90e4ee142..0000000000 --- a/packages/client-rust/src/models/patched_group_ldap_source_connection_request.rs +++ /dev/null @@ -1,33 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// PatchedGroupLdapSourceConnectionRequest : Group Source Connection -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct PatchedGroupLdapSourceConnectionRequest { - #[serde(rename = "group", skip_serializing_if = "Option::is_none")] - pub group: Option, - #[serde(rename = "source", skip_serializing_if = "Option::is_none")] - pub source: Option, - #[serde(rename = "identifier", skip_serializing_if = "Option::is_none")] - pub identifier: Option, -} - -impl PatchedGroupLdapSourceConnectionRequest { - /// Group Source Connection - pub fn new() -> PatchedGroupLdapSourceConnectionRequest { - PatchedGroupLdapSourceConnectionRequest { - group: None, - source: None, - identifier: None, - } - } -} diff --git a/packages/client-rust/src/models/patched_group_o_auth_source_connection_request.rs b/packages/client-rust/src/models/patched_group_o_auth_source_connection_request.rs deleted file mode 100644 index f85046521d..0000000000 --- a/packages/client-rust/src/models/patched_group_o_auth_source_connection_request.rs +++ /dev/null @@ -1,33 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// PatchedGroupOAuthSourceConnectionRequest : Group Source Connection -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct PatchedGroupOAuthSourceConnectionRequest { - #[serde(rename = "group", skip_serializing_if = "Option::is_none")] - pub group: Option, - #[serde(rename = "source", skip_serializing_if = "Option::is_none")] - pub source: Option, - #[serde(rename = "identifier", skip_serializing_if = "Option::is_none")] - pub identifier: Option, -} - -impl PatchedGroupOAuthSourceConnectionRequest { - /// Group Source Connection - pub fn new() -> PatchedGroupOAuthSourceConnectionRequest { - PatchedGroupOAuthSourceConnectionRequest { - group: None, - source: None, - identifier: None, - } - } -} diff --git a/packages/client-rust/src/models/patched_group_plex_source_connection_request.rs b/packages/client-rust/src/models/patched_group_plex_source_connection_request.rs deleted file mode 100644 index 1eeb3bb50d..0000000000 --- a/packages/client-rust/src/models/patched_group_plex_source_connection_request.rs +++ /dev/null @@ -1,33 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// PatchedGroupPlexSourceConnectionRequest : Group Source Connection -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct PatchedGroupPlexSourceConnectionRequest { - #[serde(rename = "group", skip_serializing_if = "Option::is_none")] - pub group: Option, - #[serde(rename = "source", skip_serializing_if = "Option::is_none")] - pub source: Option, - #[serde(rename = "identifier", skip_serializing_if = "Option::is_none")] - pub identifier: Option, -} - -impl PatchedGroupPlexSourceConnectionRequest { - /// Group Source Connection - pub fn new() -> PatchedGroupPlexSourceConnectionRequest { - PatchedGroupPlexSourceConnectionRequest { - group: None, - source: None, - identifier: None, - } - } -} diff --git a/packages/client-rust/src/models/patched_group_request.rs b/packages/client-rust/src/models/patched_group_request.rs deleted file mode 100644 index ef03433263..0000000000 --- a/packages/client-rust/src/models/patched_group_request.rs +++ /dev/null @@ -1,43 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// PatchedGroupRequest : Group Serializer -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct PatchedGroupRequest { - #[serde(rename = "name", skip_serializing_if = "Option::is_none")] - pub name: Option, - /// Users added to this group will be superusers. - #[serde(rename = "is_superuser", skip_serializing_if = "Option::is_none")] - pub is_superuser: Option, - #[serde(rename = "parents", skip_serializing_if = "Option::is_none")] - pub parents: Option>, - #[serde(rename = "users", skip_serializing_if = "Option::is_none")] - pub users: Option>, - #[serde(rename = "attributes", skip_serializing_if = "Option::is_none")] - pub attributes: Option>, - #[serde(rename = "roles", skip_serializing_if = "Option::is_none")] - pub roles: Option>, -} - -impl PatchedGroupRequest { - /// Group Serializer - pub fn new() -> PatchedGroupRequest { - PatchedGroupRequest { - name: None, - is_superuser: None, - parents: None, - users: None, - attributes: None, - roles: None, - } - } -} diff --git a/packages/client-rust/src/models/patched_group_saml_source_connection_request.rs b/packages/client-rust/src/models/patched_group_saml_source_connection_request.rs deleted file mode 100644 index 67ac8bcac9..0000000000 --- a/packages/client-rust/src/models/patched_group_saml_source_connection_request.rs +++ /dev/null @@ -1,33 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// PatchedGroupSamlSourceConnectionRequest : Group Source Connection -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct PatchedGroupSamlSourceConnectionRequest { - #[serde(rename = "group", skip_serializing_if = "Option::is_none")] - pub group: Option, - #[serde(rename = "source", skip_serializing_if = "Option::is_none")] - pub source: Option, - #[serde(rename = "identifier", skip_serializing_if = "Option::is_none")] - pub identifier: Option, -} - -impl PatchedGroupSamlSourceConnectionRequest { - /// Group Source Connection - pub fn new() -> PatchedGroupSamlSourceConnectionRequest { - PatchedGroupSamlSourceConnectionRequest { - group: None, - source: None, - identifier: None, - } - } -} diff --git a/packages/client-rust/src/models/patched_group_source_connection_request.rs b/packages/client-rust/src/models/patched_group_source_connection_request.rs deleted file mode 100644 index c32db429c2..0000000000 --- a/packages/client-rust/src/models/patched_group_source_connection_request.rs +++ /dev/null @@ -1,33 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// PatchedGroupSourceConnectionRequest : Group Source Connection -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct PatchedGroupSourceConnectionRequest { - #[serde(rename = "group", skip_serializing_if = "Option::is_none")] - pub group: Option, - #[serde(rename = "source", skip_serializing_if = "Option::is_none")] - pub source: Option, - #[serde(rename = "identifier", skip_serializing_if = "Option::is_none")] - pub identifier: Option, -} - -impl PatchedGroupSourceConnectionRequest { - /// Group Source Connection - pub fn new() -> PatchedGroupSourceConnectionRequest { - PatchedGroupSourceConnectionRequest { - group: None, - source: None, - identifier: None, - } - } -} diff --git a/packages/client-rust/src/models/patched_group_telegram_source_connection_request.rs b/packages/client-rust/src/models/patched_group_telegram_source_connection_request.rs deleted file mode 100644 index 81f88d59ff..0000000000 --- a/packages/client-rust/src/models/patched_group_telegram_source_connection_request.rs +++ /dev/null @@ -1,33 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// PatchedGroupTelegramSourceConnectionRequest : Group Source Connection -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct PatchedGroupTelegramSourceConnectionRequest { - #[serde(rename = "group", skip_serializing_if = "Option::is_none")] - pub group: Option, - #[serde(rename = "source", skip_serializing_if = "Option::is_none")] - pub source: Option, - #[serde(rename = "identifier", skip_serializing_if = "Option::is_none")] - pub identifier: Option, -} - -impl PatchedGroupTelegramSourceConnectionRequest { - /// Group Source Connection - pub fn new() -> PatchedGroupTelegramSourceConnectionRequest { - PatchedGroupTelegramSourceConnectionRequest { - group: None, - source: None, - identifier: None, - } - } -} diff --git a/packages/client-rust/src/models/patched_identification_stage_request.rs b/packages/client-rust/src/models/patched_identification_stage_request.rs deleted file mode 100644 index 8f7b35e8ab..0000000000 --- a/packages/client-rust/src/models/patched_identification_stage_request.rs +++ /dev/null @@ -1,118 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// PatchedIdentificationStageRequest : IdentificationStage Serializer -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct PatchedIdentificationStageRequest { - #[serde(rename = "name", skip_serializing_if = "Option::is_none")] - pub name: Option, - /// Fields of the user object to match against. (Hold shift to select multiple options) - #[serde(rename = "user_fields", skip_serializing_if = "Option::is_none")] - pub user_fields: Option>, - /// When set, shows a password field, instead of showing the password field as separate step. - #[serde( - rename = "password_stage", - default, - with = "::serde_with::rust::double_option", - skip_serializing_if = "Option::is_none" - )] - pub password_stage: Option>, - /// When set, adds functionality exactly like a Captcha stage, but baked into the - /// Identification stage. - #[serde( - rename = "captcha_stage", - default, - with = "::serde_with::rust::double_option", - skip_serializing_if = "Option::is_none" - )] - pub captcha_stage: Option>, - /// When enabled, user fields are matched regardless of their casing. - #[serde( - rename = "case_insensitive_matching", - skip_serializing_if = "Option::is_none" - )] - pub case_insensitive_matching: Option, - /// 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 - #[serde(rename = "show_matched_user", skip_serializing_if = "Option::is_none")] - pub show_matched_user: Option, - /// Optional enrollment flow, which is linked at the bottom of the page. - #[serde( - rename = "enrollment_flow", - default, - with = "::serde_with::rust::double_option", - skip_serializing_if = "Option::is_none" - )] - pub enrollment_flow: Option>, - /// Optional recovery flow, which is linked at the bottom of the page. - #[serde( - rename = "recovery_flow", - default, - with = "::serde_with::rust::double_option", - skip_serializing_if = "Option::is_none" - )] - pub recovery_flow: Option>, - /// Optional passwordless flow, which is linked at the bottom of the page. - #[serde( - rename = "passwordless_flow", - default, - with = "::serde_with::rust::double_option", - skip_serializing_if = "Option::is_none" - )] - pub passwordless_flow: Option>, - /// Specify which sources should be shown. - #[serde(rename = "sources", skip_serializing_if = "Option::is_none")] - pub sources: Option>, - #[serde(rename = "show_source_labels", skip_serializing_if = "Option::is_none")] - pub show_source_labels: Option, - /// When enabled, the stage will succeed and continue even when incorrect user info is entered. - #[serde( - rename = "pretend_user_exists", - skip_serializing_if = "Option::is_none" - )] - pub pretend_user_exists: Option, - /// Show the user the 'Remember me on this device' toggle, allowing repeat users to skip - /// straight to entering their password. - #[serde(rename = "enable_remember_me", skip_serializing_if = "Option::is_none")] - pub enable_remember_me: Option, - /// When set, and conditional WebAuthn is available, allow the user to use their passkey as a - /// first factor. - #[serde( - rename = "webauthn_stage", - default, - with = "::serde_with::rust::double_option", - skip_serializing_if = "Option::is_none" - )] - pub webauthn_stage: Option>, -} - -impl PatchedIdentificationStageRequest { - /// IdentificationStage Serializer - pub fn new() -> PatchedIdentificationStageRequest { - PatchedIdentificationStageRequest { - name: None, - user_fields: None, - password_stage: None, - captcha_stage: None, - case_insensitive_matching: None, - show_matched_user: None, - enrollment_flow: None, - recovery_flow: None, - passwordless_flow: None, - sources: None, - show_source_labels: None, - pretend_user_exists: None, - enable_remember_me: None, - webauthn_stage: None, - } - } -} diff --git a/packages/client-rust/src/models/patched_initial_permissions_request.rs b/packages/client-rust/src/models/patched_initial_permissions_request.rs deleted file mode 100644 index 57812b6754..0000000000 --- a/packages/client-rust/src/models/patched_initial_permissions_request.rs +++ /dev/null @@ -1,33 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// PatchedInitialPermissionsRequest : InitialPermissions serializer -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct PatchedInitialPermissionsRequest { - #[serde(rename = "name", skip_serializing_if = "Option::is_none")] - pub name: Option, - #[serde(rename = "role", skip_serializing_if = "Option::is_none")] - pub role: Option, - #[serde(rename = "permissions", skip_serializing_if = "Option::is_none")] - pub permissions: Option>, -} - -impl PatchedInitialPermissionsRequest { - /// InitialPermissions serializer - pub fn new() -> PatchedInitialPermissionsRequest { - PatchedInitialPermissionsRequest { - name: None, - role: None, - permissions: None, - } - } -} diff --git a/packages/client-rust/src/models/patched_invitation_request.rs b/packages/client-rust/src/models/patched_invitation_request.rs deleted file mode 100644 index 7bf691201c..0000000000 --- a/packages/client-rust/src/models/patched_invitation_request.rs +++ /dev/null @@ -1,51 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// PatchedInvitationRequest : Invitation Serializer -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct PatchedInvitationRequest { - #[serde(rename = "name", skip_serializing_if = "Option::is_none")] - pub name: Option, - #[serde( - rename = "expires", - default, - with = "::serde_with::rust::double_option", - skip_serializing_if = "Option::is_none" - )] - pub expires: Option>, - #[serde(rename = "fixed_data", skip_serializing_if = "Option::is_none")] - pub fixed_data: Option>, - /// When enabled, the invitation will be deleted after usage. - #[serde(rename = "single_use", skip_serializing_if = "Option::is_none")] - pub single_use: Option, - /// When set, only the configured flow can use this invitation. - #[serde( - rename = "flow", - default, - with = "::serde_with::rust::double_option", - skip_serializing_if = "Option::is_none" - )] - pub flow: Option>, -} - -impl PatchedInvitationRequest { - /// Invitation Serializer - pub fn new() -> PatchedInvitationRequest { - PatchedInvitationRequest { - name: None, - expires: None, - fixed_data: None, - single_use: None, - flow: None, - } - } -} diff --git a/packages/client-rust/src/models/patched_invitation_stage_request.rs b/packages/client-rust/src/models/patched_invitation_stage_request.rs deleted file mode 100644 index 9a83b2ab79..0000000000 --- a/packages/client-rust/src/models/patched_invitation_stage_request.rs +++ /dev/null @@ -1,35 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// PatchedInvitationStageRequest : InvitationStage Serializer -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct PatchedInvitationStageRequest { - #[serde(rename = "name", skip_serializing_if = "Option::is_none")] - pub name: Option, - /// 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. - #[serde( - rename = "continue_flow_without_invitation", - skip_serializing_if = "Option::is_none" - )] - pub continue_flow_without_invitation: Option, -} - -impl PatchedInvitationStageRequest { - /// InvitationStage Serializer - pub fn new() -> PatchedInvitationStageRequest { - PatchedInvitationStageRequest { - name: None, - continue_flow_without_invitation: None, - } - } -} diff --git a/packages/client-rust/src/models/patched_kerberos_source_property_mapping_request.rs b/packages/client-rust/src/models/patched_kerberos_source_property_mapping_request.rs deleted file mode 100644 index 10cc57e319..0000000000 --- a/packages/client-rust/src/models/patched_kerberos_source_property_mapping_request.rs +++ /dev/null @@ -1,41 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// PatchedKerberosSourcePropertyMappingRequest : Kerberos PropertyMapping Serializer -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct PatchedKerberosSourcePropertyMappingRequest { - /// 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. - #[serde( - rename = "managed", - default, - with = "::serde_with::rust::double_option", - skip_serializing_if = "Option::is_none" - )] - pub managed: Option>, - #[serde(rename = "name", skip_serializing_if = "Option::is_none")] - pub name: Option, - #[serde(rename = "expression", skip_serializing_if = "Option::is_none")] - pub expression: Option, -} - -impl PatchedKerberosSourcePropertyMappingRequest { - /// Kerberos PropertyMapping Serializer - pub fn new() -> PatchedKerberosSourcePropertyMappingRequest { - PatchedKerberosSourcePropertyMappingRequest { - managed: None, - name: None, - expression: None, - } - } -} diff --git a/packages/client-rust/src/models/patched_kerberos_source_request.rs b/packages/client-rust/src/models/patched_kerberos_source_request.rs deleted file mode 100644 index c09fa1fed4..0000000000 --- a/packages/client-rust/src/models/patched_kerberos_source_request.rs +++ /dev/null @@ -1,158 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// PatchedKerberosSourceRequest : Kerberos Source Serializer -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct PatchedKerberosSourceRequest { - /// Source's display Name. - #[serde(rename = "name", skip_serializing_if = "Option::is_none")] - pub name: Option, - /// Internal source name, used in URLs. - #[serde(rename = "slug", skip_serializing_if = "Option::is_none")] - pub slug: Option, - #[serde(rename = "enabled", skip_serializing_if = "Option::is_none")] - pub enabled: Option, - /// When enabled, this source will be displayed as a prominent button on the login page, - /// instead of a small icon. - #[serde(rename = "promoted", skip_serializing_if = "Option::is_none")] - pub promoted: Option, - /// Flow to use when authenticating existing users. - #[serde( - rename = "authentication_flow", - default, - with = "::serde_with::rust::double_option", - skip_serializing_if = "Option::is_none" - )] - pub authentication_flow: Option>, - /// Flow to use when enrolling new users. - #[serde( - rename = "enrollment_flow", - default, - with = "::serde_with::rust::double_option", - skip_serializing_if = "Option::is_none" - )] - pub enrollment_flow: Option>, - #[serde( - rename = "user_property_mappings", - skip_serializing_if = "Option::is_none" - )] - pub user_property_mappings: Option>, - #[serde( - rename = "group_property_mappings", - skip_serializing_if = "Option::is_none" - )] - pub group_property_mappings: Option>, - #[serde(rename = "policy_engine_mode", skip_serializing_if = "Option::is_none")] - pub policy_engine_mode: Option, - /// How the source determines if an existing user should be authenticated or a new user - /// enrolled. - #[serde(rename = "user_matching_mode", skip_serializing_if = "Option::is_none")] - pub user_matching_mode: Option, - #[serde(rename = "user_path_template", skip_serializing_if = "Option::is_none")] - pub user_path_template: Option, - #[serde(rename = "icon", skip_serializing_if = "Option::is_none")] - pub icon: Option, - /// How the source determines if an existing group should be used or a new group created. - #[serde( - rename = "group_matching_mode", - skip_serializing_if = "Option::is_none" - )] - pub group_matching_mode: Option, - /// Kerberos realm - #[serde(rename = "realm", skip_serializing_if = "Option::is_none")] - pub realm: Option, - /// Custom krb5.conf to use. Uses the system one by default - #[serde(rename = "krb5_conf", skip_serializing_if = "Option::is_none")] - pub krb5_conf: Option, - /// KAdmin server type - #[serde(rename = "kadmin_type", skip_serializing_if = "Option::is_none")] - pub kadmin_type: Option, - /// Sync users from Kerberos into authentik - #[serde(rename = "sync_users", skip_serializing_if = "Option::is_none")] - pub sync_users: Option, - /// When a user changes their password, sync it back to Kerberos - #[serde( - rename = "sync_users_password", - skip_serializing_if = "Option::is_none" - )] - pub sync_users_password: Option, - /// Principal to authenticate to kadmin for sync. - #[serde(rename = "sync_principal", skip_serializing_if = "Option::is_none")] - pub sync_principal: Option, - /// Password to authenticate to kadmin for sync - #[serde(rename = "sync_password", skip_serializing_if = "Option::is_none")] - pub sync_password: Option, - /// Keytab to authenticate to kadmin for sync. Must be base64-encoded or in the form - /// TYPE:residual - #[serde(rename = "sync_keytab", skip_serializing_if = "Option::is_none")] - pub sync_keytab: Option, - /// Credentials cache to authenticate to kadmin for sync. Must be in the form TYPE:residual - #[serde(rename = "sync_ccache", skip_serializing_if = "Option::is_none")] - pub sync_ccache: Option, - /// Force the use of a specific server name for SPNEGO. Must be in the form HTTP@hostname - #[serde(rename = "spnego_server_name", skip_serializing_if = "Option::is_none")] - pub spnego_server_name: Option, - /// SPNEGO keytab base64-encoded or path to keytab in the form FILE:path - #[serde(rename = "spnego_keytab", skip_serializing_if = "Option::is_none")] - pub spnego_keytab: Option, - /// Credential cache to use for SPNEGO in form type:residual - #[serde(rename = "spnego_ccache", skip_serializing_if = "Option::is_none")] - pub spnego_ccache: Option, - /// If enabled, the authentik-stored password will be updated upon login with the Kerberos - /// password backend - #[serde( - rename = "password_login_update_internal_password", - skip_serializing_if = "Option::is_none" - )] - pub password_login_update_internal_password: Option, - /// When to trigger sync for outgoing providers - #[serde( - rename = "sync_outgoing_trigger_mode", - skip_serializing_if = "Option::is_none" - )] - pub sync_outgoing_trigger_mode: Option, -} - -impl PatchedKerberosSourceRequest { - /// Kerberos Source Serializer - pub fn new() -> PatchedKerberosSourceRequest { - PatchedKerberosSourceRequest { - name: None, - slug: None, - enabled: None, - promoted: None, - authentication_flow: None, - enrollment_flow: None, - user_property_mappings: None, - group_property_mappings: None, - policy_engine_mode: None, - user_matching_mode: None, - user_path_template: None, - icon: None, - group_matching_mode: None, - realm: None, - krb5_conf: None, - kadmin_type: None, - sync_users: None, - sync_users_password: None, - sync_principal: None, - sync_password: None, - sync_keytab: None, - sync_ccache: None, - spnego_server_name: None, - spnego_keytab: None, - spnego_ccache: None, - password_login_update_internal_password: None, - sync_outgoing_trigger_mode: None, - } - } -} diff --git a/packages/client-rust/src/models/patched_kubernetes_service_connection_request.rs b/packages/client-rust/src/models/patched_kubernetes_service_connection_request.rs deleted file mode 100644 index 89af73c466..0000000000 --- a/packages/client-rust/src/models/patched_kubernetes_service_connection_request.rs +++ /dev/null @@ -1,40 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// PatchedKubernetesServiceConnectionRequest : KubernetesServiceConnection Serializer -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct PatchedKubernetesServiceConnectionRequest { - #[serde(rename = "name", skip_serializing_if = "Option::is_none")] - pub name: Option, - /// If enabled, use the local connection. Required Docker socket/Kubernetes Integration - #[serde(rename = "local", skip_serializing_if = "Option::is_none")] - pub local: Option, - /// Paste your kubeconfig here. authentik will automatically use the currently selected - /// context. - #[serde(rename = "kubeconfig", skip_serializing_if = "Option::is_none")] - pub kubeconfig: Option>, - /// Verify SSL Certificates of the Kubernetes API endpoint - #[serde(rename = "verify_ssl", skip_serializing_if = "Option::is_none")] - pub verify_ssl: Option, -} - -impl PatchedKubernetesServiceConnectionRequest { - /// KubernetesServiceConnection Serializer - pub fn new() -> PatchedKubernetesServiceConnectionRequest { - PatchedKubernetesServiceConnectionRequest { - name: None, - local: None, - kubeconfig: None, - verify_ssl: None, - } - } -} diff --git a/packages/client-rust/src/models/patched_ldap_provider_request.rs b/packages/client-rust/src/models/patched_ldap_provider_request.rs deleted file mode 100644 index 518db95410..0000000000 --- a/packages/client-rust/src/models/patched_ldap_provider_request.rs +++ /dev/null @@ -1,88 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// PatchedLdapProviderRequest : LDAPProvider Serializer -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct PatchedLdapProviderRequest { - #[serde(rename = "name", skip_serializing_if = "Option::is_none")] - pub name: Option, - /// Flow used for authentication when the associated application is accessed by an - /// un-authenticated user. - #[serde( - rename = "authentication_flow", - default, - with = "::serde_with::rust::double_option", - skip_serializing_if = "Option::is_none" - )] - pub authentication_flow: Option>, - /// Flow used when authorizing this provider. - #[serde(rename = "authorization_flow", skip_serializing_if = "Option::is_none")] - pub authorization_flow: Option, - /// Flow used ending the session from a provider. - #[serde(rename = "invalidation_flow", skip_serializing_if = "Option::is_none")] - pub invalidation_flow: Option, - #[serde(rename = "property_mappings", skip_serializing_if = "Option::is_none")] - pub property_mappings: Option>, - /// DN under which objects are accessible. - #[serde(rename = "base_dn", skip_serializing_if = "Option::is_none")] - pub base_dn: Option, - #[serde( - rename = "certificate", - default, - with = "::serde_with::rust::double_option", - skip_serializing_if = "Option::is_none" - )] - pub certificate: Option>, - #[serde(rename = "tls_server_name", skip_serializing_if = "Option::is_none")] - pub tls_server_name: Option, - /// 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 - #[serde(rename = "uid_start_number", skip_serializing_if = "Option::is_none")] - pub uid_start_number: Option, - /// 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 - #[serde(rename = "gid_start_number", skip_serializing_if = "Option::is_none")] - pub gid_start_number: Option, - #[serde(rename = "search_mode", skip_serializing_if = "Option::is_none")] - pub search_mode: Option, - #[serde(rename = "bind_mode", skip_serializing_if = "Option::is_none")] - pub bind_mode: Option, - /// 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. - #[serde(rename = "mfa_support", skip_serializing_if = "Option::is_none")] - pub mfa_support: Option, -} - -impl PatchedLdapProviderRequest { - /// LDAPProvider Serializer - pub fn new() -> PatchedLdapProviderRequest { - PatchedLdapProviderRequest { - name: None, - authentication_flow: None, - authorization_flow: None, - invalidation_flow: None, - property_mappings: None, - base_dn: None, - certificate: None, - tls_server_name: None, - uid_start_number: None, - gid_start_number: None, - search_mode: None, - bind_mode: None, - mfa_support: None, - } - } -} diff --git a/packages/client-rust/src/models/patched_ldap_source_property_mapping_request.rs b/packages/client-rust/src/models/patched_ldap_source_property_mapping_request.rs deleted file mode 100644 index b1a1f0dff4..0000000000 --- a/packages/client-rust/src/models/patched_ldap_source_property_mapping_request.rs +++ /dev/null @@ -1,41 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// PatchedLdapSourcePropertyMappingRequest : LDAP PropertyMapping Serializer -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct PatchedLdapSourcePropertyMappingRequest { - /// 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. - #[serde( - rename = "managed", - default, - with = "::serde_with::rust::double_option", - skip_serializing_if = "Option::is_none" - )] - pub managed: Option>, - #[serde(rename = "name", skip_serializing_if = "Option::is_none")] - pub name: Option, - #[serde(rename = "expression", skip_serializing_if = "Option::is_none")] - pub expression: Option, -} - -impl PatchedLdapSourcePropertyMappingRequest { - /// LDAP PropertyMapping Serializer - pub fn new() -> PatchedLdapSourcePropertyMappingRequest { - PatchedLdapSourcePropertyMappingRequest { - managed: None, - name: None, - expression: None, - } - } -} diff --git a/packages/client-rust/src/models/patched_ldap_source_request.rs b/packages/client-rust/src/models/patched_ldap_source_request.rs deleted file mode 100644 index 64dd23a4d6..0000000000 --- a/packages/client-rust/src/models/patched_ldap_source_request.rs +++ /dev/null @@ -1,215 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// PatchedLdapSourceRequest : LDAP Source Serializer -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct PatchedLdapSourceRequest { - /// Source's display Name. - #[serde(rename = "name", skip_serializing_if = "Option::is_none")] - pub name: Option, - /// Internal source name, used in URLs. - #[serde(rename = "slug", skip_serializing_if = "Option::is_none")] - pub slug: Option, - #[serde(rename = "enabled", skip_serializing_if = "Option::is_none")] - pub enabled: Option, - /// When enabled, this source will be displayed as a prominent button on the login page, - /// instead of a small icon. - #[serde(rename = "promoted", skip_serializing_if = "Option::is_none")] - pub promoted: Option, - /// Flow to use when authenticating existing users. - #[serde( - rename = "authentication_flow", - default, - with = "::serde_with::rust::double_option", - skip_serializing_if = "Option::is_none" - )] - pub authentication_flow: Option>, - /// Flow to use when enrolling new users. - #[serde( - rename = "enrollment_flow", - default, - with = "::serde_with::rust::double_option", - skip_serializing_if = "Option::is_none" - )] - pub enrollment_flow: Option>, - #[serde( - rename = "user_property_mappings", - skip_serializing_if = "Option::is_none" - )] - pub user_property_mappings: Option>, - #[serde( - rename = "group_property_mappings", - skip_serializing_if = "Option::is_none" - )] - pub group_property_mappings: Option>, - #[serde(rename = "policy_engine_mode", skip_serializing_if = "Option::is_none")] - pub policy_engine_mode: Option, - /// How the source determines if an existing user should be authenticated or a new user - /// enrolled. - #[serde(rename = "user_matching_mode", skip_serializing_if = "Option::is_none")] - pub user_matching_mode: Option, - #[serde(rename = "user_path_template", skip_serializing_if = "Option::is_none")] - pub user_path_template: Option, - #[serde(rename = "icon", skip_serializing_if = "Option::is_none")] - pub icon: Option, - #[serde(rename = "server_uri", skip_serializing_if = "Option::is_none")] - pub server_uri: Option, - /// Optionally verify the LDAP Server's Certificate against the CA Chain in this keypair. - #[serde( - rename = "peer_certificate", - default, - with = "::serde_with::rust::double_option", - skip_serializing_if = "Option::is_none" - )] - pub peer_certificate: Option>, - /// Client certificate to authenticate against the LDAP Server's Certificate. - #[serde( - rename = "client_certificate", - default, - with = "::serde_with::rust::double_option", - skip_serializing_if = "Option::is_none" - )] - pub client_certificate: Option>, - #[serde(rename = "bind_cn", skip_serializing_if = "Option::is_none")] - pub bind_cn: Option, - #[serde(rename = "bind_password", skip_serializing_if = "Option::is_none")] - pub bind_password: Option, - #[serde(rename = "start_tls", skip_serializing_if = "Option::is_none")] - pub start_tls: Option, - #[serde(rename = "sni", skip_serializing_if = "Option::is_none")] - pub sni: Option, - #[serde(rename = "base_dn", skip_serializing_if = "Option::is_none")] - pub base_dn: Option, - /// Prepended to Base DN for User-queries. - #[serde(rename = "additional_user_dn", skip_serializing_if = "Option::is_none")] - pub additional_user_dn: Option, - /// Prepended to Base DN for Group-queries. - #[serde( - rename = "additional_group_dn", - skip_serializing_if = "Option::is_none" - )] - pub additional_group_dn: Option, - /// Consider Objects matching this filter to be Users. - #[serde(rename = "user_object_filter", skip_serializing_if = "Option::is_none")] - pub user_object_filter: Option, - /// Consider Objects matching this filter to be Groups. - #[serde( - rename = "group_object_filter", - skip_serializing_if = "Option::is_none" - )] - pub group_object_filter: Option, - /// Field which contains members of a group. - #[serde( - rename = "group_membership_field", - skip_serializing_if = "Option::is_none" - )] - pub group_membership_field: Option, - /// Attribute which matches the value of `group_membership_field`. - #[serde( - rename = "user_membership_attribute", - skip_serializing_if = "Option::is_none" - )] - pub user_membership_attribute: Option, - /// Field which contains a unique Identifier. - #[serde( - rename = "object_uniqueness_field", - skip_serializing_if = "Option::is_none" - )] - pub object_uniqueness_field: Option, - /// Update internal authentik password when login succeeds with LDAP - #[serde( - rename = "password_login_update_internal_password", - skip_serializing_if = "Option::is_none" - )] - pub password_login_update_internal_password: Option, - #[serde(rename = "sync_users", skip_serializing_if = "Option::is_none")] - pub sync_users: Option, - /// When a user changes their password, sync it back to LDAP. This can only be enabled on a - /// single LDAP source. - #[serde( - rename = "sync_users_password", - skip_serializing_if = "Option::is_none" - )] - pub sync_users_password: Option, - #[serde(rename = "sync_groups", skip_serializing_if = "Option::is_none")] - pub sync_groups: Option, - #[serde( - rename = "sync_parent_group", - default, - with = "::serde_with::rust::double_option", - skip_serializing_if = "Option::is_none" - )] - pub sync_parent_group: Option>, - /// 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 - #[serde( - rename = "lookup_groups_from_user", - skip_serializing_if = "Option::is_none" - )] - pub lookup_groups_from_user: Option, - /// Delete authentik users and groups which were previously supplied by this source, but are - /// now missing from it. - #[serde( - rename = "delete_not_found_objects", - skip_serializing_if = "Option::is_none" - )] - pub delete_not_found_objects: Option, - /// When to trigger sync for outgoing providers - #[serde( - rename = "sync_outgoing_trigger_mode", - skip_serializing_if = "Option::is_none" - )] - pub sync_outgoing_trigger_mode: Option, -} - -impl PatchedLdapSourceRequest { - /// LDAP Source Serializer - pub fn new() -> PatchedLdapSourceRequest { - PatchedLdapSourceRequest { - name: None, - slug: None, - enabled: None, - promoted: None, - authentication_flow: None, - enrollment_flow: None, - user_property_mappings: None, - group_property_mappings: None, - policy_engine_mode: None, - user_matching_mode: None, - user_path_template: None, - icon: None, - server_uri: None, - peer_certificate: None, - client_certificate: None, - bind_cn: None, - bind_password: None, - start_tls: None, - sni: None, - base_dn: None, - additional_user_dn: None, - additional_group_dn: None, - user_object_filter: None, - group_object_filter: None, - group_membership_field: None, - user_membership_attribute: None, - object_uniqueness_field: None, - password_login_update_internal_password: None, - sync_users: None, - sync_users_password: None, - sync_groups: None, - sync_parent_group: None, - lookup_groups_from_user: None, - delete_not_found_objects: None, - sync_outgoing_trigger_mode: None, - } - } -} diff --git a/packages/client-rust/src/models/patched_license_request.rs b/packages/client-rust/src/models/patched_license_request.rs deleted file mode 100644 index 903443e6c8..0000000000 --- a/packages/client-rust/src/models/patched_license_request.rs +++ /dev/null @@ -1,25 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// PatchedLicenseRequest : License Serializer -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct PatchedLicenseRequest { - #[serde(rename = "key", skip_serializing_if = "Option::is_none")] - pub key: Option, -} - -impl PatchedLicenseRequest { - /// License Serializer - pub fn new() -> PatchedLicenseRequest { - PatchedLicenseRequest { key: None } - } -} diff --git a/packages/client-rust/src/models/patched_lifecycle_rule_request.rs b/packages/client-rust/src/models/patched_lifecycle_rule_request.rs deleted file mode 100644 index 68b6dd1cc7..0000000000 --- a/packages/client-rust/src/models/patched_lifecycle_rule_request.rs +++ /dev/null @@ -1,68 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// PatchedLifecycleRuleRequest : Mixin to validate that a valid enterprise license exists before -/// allowing to save the object -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct PatchedLifecycleRuleRequest { - #[serde(rename = "name", skip_serializing_if = "Option::is_none")] - pub name: Option, - #[serde(rename = "content_type", skip_serializing_if = "Option::is_none")] - pub content_type: Option, - #[serde( - rename = "object_id", - default, - with = "::serde_with::rust::double_option", - skip_serializing_if = "Option::is_none" - )] - pub object_id: Option>, - #[serde(rename = "interval", skip_serializing_if = "Option::is_none")] - pub interval: Option, - #[serde(rename = "grace_period", skip_serializing_if = "Option::is_none")] - pub grace_period: Option, - #[serde(rename = "reviewer_groups", skip_serializing_if = "Option::is_none")] - pub reviewer_groups: Option>, - #[serde(rename = "min_reviewers", skip_serializing_if = "Option::is_none")] - pub min_reviewers: Option, - #[serde( - rename = "min_reviewers_is_per_group", - skip_serializing_if = "Option::is_none" - )] - pub min_reviewers_is_per_group: Option, - #[serde(rename = "reviewers", skip_serializing_if = "Option::is_none")] - pub reviewers: Option>, - /// Select which transports should be used to notify the reviewers. If none are selected, the - /// notification will only be shown in the authentik UI. - #[serde( - rename = "notification_transports", - skip_serializing_if = "Option::is_none" - )] - pub notification_transports: Option>, -} - -impl PatchedLifecycleRuleRequest { - /// Mixin to validate that a valid enterprise license exists before allowing to save the object - pub fn new() -> PatchedLifecycleRuleRequest { - PatchedLifecycleRuleRequest { - name: None, - content_type: None, - object_id: None, - interval: None, - grace_period: None, - reviewer_groups: None, - min_reviewers: None, - min_reviewers_is_per_group: None, - reviewers: None, - notification_transports: None, - } - } -} diff --git a/packages/client-rust/src/models/patched_microsoft_entra_provider_mapping_request.rs b/packages/client-rust/src/models/patched_microsoft_entra_provider_mapping_request.rs deleted file mode 100644 index 40f895127b..0000000000 --- a/packages/client-rust/src/models/patched_microsoft_entra_provider_mapping_request.rs +++ /dev/null @@ -1,41 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// PatchedMicrosoftEntraProviderMappingRequest : MicrosoftEntraProviderMapping Serializer -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct PatchedMicrosoftEntraProviderMappingRequest { - /// 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. - #[serde( - rename = "managed", - default, - with = "::serde_with::rust::double_option", - skip_serializing_if = "Option::is_none" - )] - pub managed: Option>, - #[serde(rename = "name", skip_serializing_if = "Option::is_none")] - pub name: Option, - #[serde(rename = "expression", skip_serializing_if = "Option::is_none")] - pub expression: Option, -} - -impl PatchedMicrosoftEntraProviderMappingRequest { - /// MicrosoftEntraProviderMapping Serializer - pub fn new() -> PatchedMicrosoftEntraProviderMappingRequest { - PatchedMicrosoftEntraProviderMappingRequest { - managed: None, - name: None, - expression: None, - } - } -} diff --git a/packages/client-rust/src/models/patched_microsoft_entra_provider_request.rs b/packages/client-rust/src/models/patched_microsoft_entra_provider_request.rs deleted file mode 100644 index 1eefaa5014..0000000000 --- a/packages/client-rust/src/models/patched_microsoft_entra_provider_request.rs +++ /dev/null @@ -1,81 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// PatchedMicrosoftEntraProviderRequest : MicrosoftEntraProvider Serializer -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct PatchedMicrosoftEntraProviderRequest { - #[serde(rename = "name", skip_serializing_if = "Option::is_none")] - pub name: Option, - #[serde(rename = "property_mappings", skip_serializing_if = "Option::is_none")] - pub property_mappings: Option>, - /// Property mappings used for group creation/updating. - #[serde( - rename = "property_mappings_group", - skip_serializing_if = "Option::is_none" - )] - pub property_mappings_group: Option>, - #[serde(rename = "client_id", skip_serializing_if = "Option::is_none")] - pub client_id: Option, - #[serde(rename = "client_secret", skip_serializing_if = "Option::is_none")] - pub client_secret: Option, - #[serde(rename = "tenant_id", skip_serializing_if = "Option::is_none")] - pub tenant_id: Option, - #[serde( - rename = "exclude_users_service_account", - skip_serializing_if = "Option::is_none" - )] - pub exclude_users_service_account: Option, - #[serde( - rename = "filter_group", - default, - with = "::serde_with::rust::double_option", - skip_serializing_if = "Option::is_none" - )] - pub filter_group: Option>, - #[serde(rename = "user_delete_action", skip_serializing_if = "Option::is_none")] - pub user_delete_action: Option, - #[serde( - rename = "group_delete_action", - skip_serializing_if = "Option::is_none" - )] - pub group_delete_action: Option, - /// Controls the number of objects synced in a single task - #[serde(rename = "sync_page_size", skip_serializing_if = "Option::is_none")] - pub sync_page_size: Option, - /// Timeout for synchronization of a single page - #[serde(rename = "sync_page_timeout", skip_serializing_if = "Option::is_none")] - pub sync_page_timeout: Option, - /// When enabled, provider will not modify or create objects in the remote system. - #[serde(rename = "dry_run", skip_serializing_if = "Option::is_none")] - pub dry_run: Option, -} - -impl PatchedMicrosoftEntraProviderRequest { - /// MicrosoftEntraProvider Serializer - pub fn new() -> PatchedMicrosoftEntraProviderRequest { - PatchedMicrosoftEntraProviderRequest { - name: None, - property_mappings: None, - property_mappings_group: None, - client_id: None, - client_secret: None, - tenant_id: None, - exclude_users_service_account: None, - filter_group: None, - user_delete_action: None, - group_delete_action: None, - sync_page_size: None, - sync_page_timeout: None, - dry_run: None, - } - } -} diff --git a/packages/client-rust/src/models/patched_mutual_tls_stage_request.rs b/packages/client-rust/src/models/patched_mutual_tls_stage_request.rs deleted file mode 100644 index b2bad7ff62..0000000000 --- a/packages/client-rust/src/models/patched_mutual_tls_stage_request.rs +++ /dev/null @@ -1,44 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// PatchedMutualTlsStageRequest : MutualTLSStage Serializer -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct PatchedMutualTlsStageRequest { - #[serde(rename = "name", skip_serializing_if = "Option::is_none")] - pub name: Option, - #[serde(rename = "mode", skip_serializing_if = "Option::is_none")] - pub mode: Option, - /// Configure certificate authorities to validate the certificate against. This option has a - /// higher priority than the `client_certificate` option on `Brand`. - #[serde( - rename = "certificate_authorities", - skip_serializing_if = "Option::is_none" - )] - pub certificate_authorities: Option>, - #[serde(rename = "cert_attribute", skip_serializing_if = "Option::is_none")] - pub cert_attribute: Option, - #[serde(rename = "user_attribute", skip_serializing_if = "Option::is_none")] - pub user_attribute: Option, -} - -impl PatchedMutualTlsStageRequest { - /// MutualTLSStage Serializer - pub fn new() -> PatchedMutualTlsStageRequest { - PatchedMutualTlsStageRequest { - name: None, - mode: None, - certificate_authorities: None, - cert_attribute: None, - user_attribute: None, - } - } -} diff --git a/packages/client-rust/src/models/patched_notification_request.rs b/packages/client-rust/src/models/patched_notification_request.rs deleted file mode 100644 index f1703c0de3..0000000000 --- a/packages/client-rust/src/models/patched_notification_request.rs +++ /dev/null @@ -1,46 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// PatchedNotificationRequest : Notification Serializer -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct PatchedNotificationRequest { - #[serde( - rename = "hyperlink", - default, - with = "::serde_with::rust::double_option", - skip_serializing_if = "Option::is_none" - )] - pub hyperlink: Option>, - #[serde( - rename = "hyperlink_label", - default, - with = "::serde_with::rust::double_option", - skip_serializing_if = "Option::is_none" - )] - pub hyperlink_label: Option>, - #[serde(rename = "event", skip_serializing_if = "Option::is_none")] - pub event: Option, - #[serde(rename = "seen", skip_serializing_if = "Option::is_none")] - pub seen: Option, -} - -impl PatchedNotificationRequest { - /// Notification Serializer - pub fn new() -> PatchedNotificationRequest { - PatchedNotificationRequest { - hyperlink: None, - hyperlink_label: None, - event: None, - seen: None, - } - } -} diff --git a/packages/client-rust/src/models/patched_notification_rule_request.rs b/packages/client-rust/src/models/patched_notification_rule_request.rs deleted file mode 100644 index 351937d769..0000000000 --- a/packages/client-rust/src/models/patched_notification_rule_request.rs +++ /dev/null @@ -1,54 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// PatchedNotificationRuleRequest : NotificationRule Serializer -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct PatchedNotificationRuleRequest { - #[serde(rename = "name", skip_serializing_if = "Option::is_none")] - pub name: Option, - /// Select which transports should be used to notify the user. If none are selected, the - /// notification will only be shown in the authentik UI. - #[serde(rename = "transports", skip_serializing_if = "Option::is_none")] - pub transports: Option>, - /// Controls which severity level the created notifications will have. - #[serde(rename = "severity", skip_serializing_if = "Option::is_none")] - pub severity: Option, - /// Define which group of users this notification should be sent and shown to. If left empty, - /// Notification won't ben sent. - #[serde( - rename = "destination_group", - default, - with = "::serde_with::rust::double_option", - skip_serializing_if = "Option::is_none" - )] - pub destination_group: Option>, - /// When enabled, notification will be sent to user the user that triggered the event.When - /// destination_group is configured, notification is sent to both. - #[serde( - rename = "destination_event_user", - skip_serializing_if = "Option::is_none" - )] - pub destination_event_user: Option, -} - -impl PatchedNotificationRuleRequest { - /// NotificationRule Serializer - pub fn new() -> PatchedNotificationRuleRequest { - PatchedNotificationRuleRequest { - name: None, - transports: None, - severity: None, - destination_group: None, - destination_event_user: None, - } - } -} diff --git a/packages/client-rust/src/models/patched_notification_transport_request.rs b/packages/client-rust/src/models/patched_notification_transport_request.rs deleted file mode 100644 index 429e15181e..0000000000 --- a/packages/client-rust/src/models/patched_notification_transport_request.rs +++ /dev/null @@ -1,75 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// PatchedNotificationTransportRequest : NotificationTransport Serializer -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct PatchedNotificationTransportRequest { - #[serde(rename = "name", skip_serializing_if = "Option::is_none")] - pub name: Option, - #[serde(rename = "mode", skip_serializing_if = "Option::is_none")] - pub mode: Option, - #[serde(rename = "webhook_url", skip_serializing_if = "Option::is_none")] - pub webhook_url: Option, - /// When set, the selected ceritifcate is used to validate the certificate of the webhook - /// server. - #[serde( - rename = "webhook_ca", - default, - with = "::serde_with::rust::double_option", - skip_serializing_if = "Option::is_none" - )] - pub webhook_ca: Option>, - /// Customize the body of the request. Mapping should return data that is JSON-serializable. - #[serde( - rename = "webhook_mapping_body", - default, - with = "::serde_with::rust::double_option", - skip_serializing_if = "Option::is_none" - )] - pub webhook_mapping_body: Option>, - /// Configure additional headers to be sent. Mapping should return a dictionary of key-value - /// pairs - #[serde( - rename = "webhook_mapping_headers", - default, - with = "::serde_with::rust::double_option", - skip_serializing_if = "Option::is_none" - )] - pub webhook_mapping_headers: Option>, - #[serde( - rename = "email_subject_prefix", - skip_serializing_if = "Option::is_none" - )] - pub email_subject_prefix: Option, - #[serde(rename = "email_template", skip_serializing_if = "Option::is_none")] - pub email_template: Option, - /// Only send notification once, for example when sending a webhook into a chat channel. - #[serde(rename = "send_once", skip_serializing_if = "Option::is_none")] - pub send_once: Option, -} - -impl PatchedNotificationTransportRequest { - /// NotificationTransport Serializer - pub fn new() -> PatchedNotificationTransportRequest { - PatchedNotificationTransportRequest { - name: None, - mode: None, - webhook_url: None, - webhook_ca: None, - webhook_mapping_body: None, - webhook_mapping_headers: None, - email_subject_prefix: None, - email_template: None, - send_once: None, - } - } -} diff --git a/packages/client-rust/src/models/patched_notification_webhook_mapping_request.rs b/packages/client-rust/src/models/patched_notification_webhook_mapping_request.rs deleted file mode 100644 index 9cc6beacab..0000000000 --- a/packages/client-rust/src/models/patched_notification_webhook_mapping_request.rs +++ /dev/null @@ -1,30 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// PatchedNotificationWebhookMappingRequest : NotificationWebhookMapping Serializer -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct PatchedNotificationWebhookMappingRequest { - #[serde(rename = "name", skip_serializing_if = "Option::is_none")] - pub name: Option, - #[serde(rename = "expression", skip_serializing_if = "Option::is_none")] - pub expression: Option, -} - -impl PatchedNotificationWebhookMappingRequest { - /// NotificationWebhookMapping Serializer - pub fn new() -> PatchedNotificationWebhookMappingRequest { - PatchedNotificationWebhookMappingRequest { - name: None, - expression: None, - } - } -} diff --git a/packages/client-rust/src/models/patched_o_auth2_provider_request.rs b/packages/client-rust/src/models/patched_o_auth2_provider_request.rs deleted file mode 100644 index a94dff1047..0000000000 --- a/packages/client-rust/src/models/patched_o_auth2_provider_request.rs +++ /dev/null @@ -1,149 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// PatchedOAuth2ProviderRequest : OAuth2Provider Serializer -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct PatchedOAuth2ProviderRequest { - #[serde(rename = "name", skip_serializing_if = "Option::is_none")] - pub name: Option, - /// Flow used for authentication when the associated application is accessed by an - /// un-authenticated user. - #[serde( - rename = "authentication_flow", - default, - with = "::serde_with::rust::double_option", - skip_serializing_if = "Option::is_none" - )] - pub authentication_flow: Option>, - /// Flow used when authorizing this provider. - #[serde(rename = "authorization_flow", skip_serializing_if = "Option::is_none")] - pub authorization_flow: Option, - /// Flow used ending the session from a provider. - #[serde(rename = "invalidation_flow", skip_serializing_if = "Option::is_none")] - pub invalidation_flow: Option, - #[serde(rename = "property_mappings", skip_serializing_if = "Option::is_none")] - pub property_mappings: Option>, - /// Confidential clients are capable of maintaining the confidentiality of their credentials. - /// Public clients are incapable - #[serde(rename = "client_type", skip_serializing_if = "Option::is_none")] - pub client_type: Option, - #[serde(rename = "client_id", skip_serializing_if = "Option::is_none")] - pub client_id: Option, - #[serde(rename = "client_secret", skip_serializing_if = "Option::is_none")] - pub client_secret: Option, - /// Access codes not valid on or after current time + this value (Format: - /// hours=1;minutes=2;seconds=3). - #[serde( - rename = "access_code_validity", - skip_serializing_if = "Option::is_none" - )] - pub access_code_validity: Option, - /// Tokens not valid on or after current time + this value (Format: - /// hours=1;minutes=2;seconds=3). - #[serde( - rename = "access_token_validity", - skip_serializing_if = "Option::is_none" - )] - pub access_token_validity: Option, - /// Tokens not valid on or after current time + this value (Format: - /// hours=1;minutes=2;seconds=3). - #[serde( - rename = "refresh_token_validity", - skip_serializing_if = "Option::is_none" - )] - pub refresh_token_validity: Option, - /// 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). - #[serde( - rename = "refresh_token_threshold", - skip_serializing_if = "Option::is_none" - )] - pub refresh_token_threshold: Option, - /// Include User claims from scopes in the id_token, for applications that don't access the - /// userinfo endpoint. - #[serde( - rename = "include_claims_in_id_token", - skip_serializing_if = "Option::is_none" - )] - pub include_claims_in_id_token: Option, - /// Key used to sign the tokens. - #[serde( - rename = "signing_key", - default, - with = "::serde_with::rust::double_option", - skip_serializing_if = "Option::is_none" - )] - pub signing_key: Option>, - /// Key used to encrypt the tokens. When set, tokens will be encrypted and returned as JWEs. - #[serde( - rename = "encryption_key", - default, - with = "::serde_with::rust::double_option", - skip_serializing_if = "Option::is_none" - )] - pub encryption_key: Option>, - #[serde(rename = "redirect_uris", skip_serializing_if = "Option::is_none")] - pub redirect_uris: Option>, - #[serde(rename = "logout_uri", skip_serializing_if = "Option::is_none")] - pub logout_uri: Option, - /// Backchannel logs out with server to server calls. Frontchannel uses iframes in your browser - #[serde(rename = "logout_method", skip_serializing_if = "Option::is_none")] - pub logout_method: Option, - /// Configure what data should be used as unique User Identifier. For most cases, the default - /// should be fine. - #[serde(rename = "sub_mode", skip_serializing_if = "Option::is_none")] - pub sub_mode: Option, - /// Configure how the issuer field of the ID Token should be filled. - #[serde(rename = "issuer_mode", skip_serializing_if = "Option::is_none")] - pub issuer_mode: Option, - #[serde( - rename = "jwt_federation_sources", - skip_serializing_if = "Option::is_none" - )] - pub jwt_federation_sources: Option>, - #[serde( - rename = "jwt_federation_providers", - skip_serializing_if = "Option::is_none" - )] - pub jwt_federation_providers: Option>, -} - -impl PatchedOAuth2ProviderRequest { - /// OAuth2Provider Serializer - pub fn new() -> PatchedOAuth2ProviderRequest { - PatchedOAuth2ProviderRequest { - name: None, - authentication_flow: None, - authorization_flow: None, - invalidation_flow: None, - property_mappings: None, - client_type: None, - client_id: None, - client_secret: None, - access_code_validity: None, - access_token_validity: None, - refresh_token_validity: None, - refresh_token_threshold: None, - include_claims_in_id_token: None, - signing_key: None, - encryption_key: None, - redirect_uris: None, - logout_uri: None, - logout_method: None, - sub_mode: None, - issuer_mode: None, - jwt_federation_sources: None, - jwt_federation_providers: None, - } - } -} diff --git a/packages/client-rust/src/models/patched_o_auth_source_property_mapping_request.rs b/packages/client-rust/src/models/patched_o_auth_source_property_mapping_request.rs deleted file mode 100644 index 5a7eca3542..0000000000 --- a/packages/client-rust/src/models/patched_o_auth_source_property_mapping_request.rs +++ /dev/null @@ -1,41 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// PatchedOAuthSourcePropertyMappingRequest : OAuthSourcePropertyMapping Serializer -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct PatchedOAuthSourcePropertyMappingRequest { - /// 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. - #[serde( - rename = "managed", - default, - with = "::serde_with::rust::double_option", - skip_serializing_if = "Option::is_none" - )] - pub managed: Option>, - #[serde(rename = "name", skip_serializing_if = "Option::is_none")] - pub name: Option, - #[serde(rename = "expression", skip_serializing_if = "Option::is_none")] - pub expression: Option, -} - -impl PatchedOAuthSourcePropertyMappingRequest { - /// OAuthSourcePropertyMapping Serializer - pub fn new() -> PatchedOAuthSourcePropertyMappingRequest { - PatchedOAuthSourcePropertyMappingRequest { - managed: None, - name: None, - expression: None, - } - } -} diff --git a/packages/client-rust/src/models/patched_o_auth_source_request.rs b/packages/client-rust/src/models/patched_o_auth_source_request.rs deleted file mode 100644 index 41f315b9fa..0000000000 --- a/packages/client-rust/src/models/patched_o_auth_source_request.rs +++ /dev/null @@ -1,161 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// PatchedOAuthSourceRequest : OAuth Source Serializer -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct PatchedOAuthSourceRequest { - /// Source's display Name. - #[serde(rename = "name", skip_serializing_if = "Option::is_none")] - pub name: Option, - /// Internal source name, used in URLs. - #[serde(rename = "slug", skip_serializing_if = "Option::is_none")] - pub slug: Option, - #[serde(rename = "enabled", skip_serializing_if = "Option::is_none")] - pub enabled: Option, - /// When enabled, this source will be displayed as a prominent button on the login page, - /// instead of a small icon. - #[serde(rename = "promoted", skip_serializing_if = "Option::is_none")] - pub promoted: Option, - /// Flow to use when authenticating existing users. - #[serde( - rename = "authentication_flow", - default, - with = "::serde_with::rust::double_option", - skip_serializing_if = "Option::is_none" - )] - pub authentication_flow: Option>, - /// Flow to use when enrolling new users. - #[serde( - rename = "enrollment_flow", - default, - with = "::serde_with::rust::double_option", - skip_serializing_if = "Option::is_none" - )] - pub enrollment_flow: Option>, - #[serde( - rename = "user_property_mappings", - skip_serializing_if = "Option::is_none" - )] - pub user_property_mappings: Option>, - #[serde( - rename = "group_property_mappings", - skip_serializing_if = "Option::is_none" - )] - pub group_property_mappings: Option>, - #[serde(rename = "policy_engine_mode", skip_serializing_if = "Option::is_none")] - pub policy_engine_mode: Option, - /// How the source determines if an existing user should be authenticated or a new user - /// enrolled. - #[serde(rename = "user_matching_mode", skip_serializing_if = "Option::is_none")] - pub user_matching_mode: Option, - #[serde(rename = "user_path_template", skip_serializing_if = "Option::is_none")] - pub user_path_template: Option, - #[serde(rename = "icon", skip_serializing_if = "Option::is_none")] - pub icon: Option, - /// How the source determines if an existing group should be used or a new group created. - #[serde( - rename = "group_matching_mode", - skip_serializing_if = "Option::is_none" - )] - pub group_matching_mode: Option, - #[serde(rename = "provider_type", skip_serializing_if = "Option::is_none")] - pub provider_type: Option, - /// URL used to request the initial token. This URL is only required for OAuth 1. - #[serde( - rename = "request_token_url", - default, - with = "::serde_with::rust::double_option", - skip_serializing_if = "Option::is_none" - )] - pub request_token_url: Option>, - /// URL the user is redirect to to conest the flow. - #[serde( - rename = "authorization_url", - default, - with = "::serde_with::rust::double_option", - skip_serializing_if = "Option::is_none" - )] - pub authorization_url: Option>, - /// URL used by authentik to retrieve tokens. - #[serde( - rename = "access_token_url", - default, - with = "::serde_with::rust::double_option", - skip_serializing_if = "Option::is_none" - )] - pub access_token_url: Option>, - /// URL used by authentik to get user information. - #[serde( - rename = "profile_url", - default, - with = "::serde_with::rust::double_option", - skip_serializing_if = "Option::is_none" - )] - pub profile_url: Option>, - #[serde(rename = "pkce", skip_serializing_if = "Option::is_none")] - pub pkce: Option, - #[serde(rename = "consumer_key", skip_serializing_if = "Option::is_none")] - pub consumer_key: Option, - #[serde(rename = "consumer_secret", skip_serializing_if = "Option::is_none")] - pub consumer_secret: Option, - #[serde(rename = "additional_scopes", skip_serializing_if = "Option::is_none")] - pub additional_scopes: Option, - #[serde( - rename = "oidc_well_known_url", - skip_serializing_if = "Option::is_none" - )] - pub oidc_well_known_url: Option, - #[serde(rename = "oidc_jwks_url", skip_serializing_if = "Option::is_none")] - pub oidc_jwks_url: Option, - #[serde(rename = "oidc_jwks", skip_serializing_if = "Option::is_none")] - pub oidc_jwks: Option>, - /// How to perform authentication during an authorization_code token request flow - #[serde( - rename = "authorization_code_auth_method", - skip_serializing_if = "Option::is_none" - )] - pub authorization_code_auth_method: Option, -} - -impl PatchedOAuthSourceRequest { - /// OAuth Source Serializer - pub fn new() -> PatchedOAuthSourceRequest { - PatchedOAuthSourceRequest { - name: None, - slug: None, - enabled: None, - promoted: None, - authentication_flow: None, - enrollment_flow: None, - user_property_mappings: None, - group_property_mappings: None, - policy_engine_mode: None, - user_matching_mode: None, - user_path_template: None, - icon: None, - group_matching_mode: None, - provider_type: None, - request_token_url: None, - authorization_url: None, - access_token_url: None, - profile_url: None, - pkce: None, - consumer_key: None, - consumer_secret: None, - additional_scopes: None, - oidc_well_known_url: None, - oidc_jwks_url: None, - oidc_jwks: None, - authorization_code_auth_method: None, - } - } -} diff --git a/packages/client-rust/src/models/patched_outpost_request.rs b/packages/client-rust/src/models/patched_outpost_request.rs deleted file mode 100644 index 730e82699a..0000000000 --- a/packages/client-rust/src/models/patched_outpost_request.rs +++ /dev/null @@ -1,57 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// PatchedOutpostRequest : Outpost Serializer -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct PatchedOutpostRequest { - #[serde(rename = "name", skip_serializing_if = "Option::is_none")] - pub name: Option, - #[serde(rename = "type", skip_serializing_if = "Option::is_none")] - pub r#type: Option, - #[serde(rename = "providers", skip_serializing_if = "Option::is_none")] - pub providers: Option>, - /// Select Service-Connection authentik should use to manage this outpost. Leave empty if - /// authentik should not handle the deployment. - #[serde( - rename = "service_connection", - default, - with = "::serde_with::rust::double_option", - skip_serializing_if = "Option::is_none" - )] - pub service_connection: Option>, - #[serde(rename = "config", skip_serializing_if = "Option::is_none")] - pub config: Option>, - /// 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. - #[serde( - rename = "managed", - default, - with = "::serde_with::rust::double_option", - skip_serializing_if = "Option::is_none" - )] - pub managed: Option>, -} - -impl PatchedOutpostRequest { - /// Outpost Serializer - pub fn new() -> PatchedOutpostRequest { - PatchedOutpostRequest { - name: None, - r#type: None, - providers: None, - service_connection: None, - config: None, - managed: None, - } - } -} diff --git a/packages/client-rust/src/models/patched_password_expiry_policy_request.rs b/packages/client-rust/src/models/patched_password_expiry_policy_request.rs deleted file mode 100644 index 3f44b5ebdd..0000000000 --- a/packages/client-rust/src/models/patched_password_expiry_policy_request.rs +++ /dev/null @@ -1,38 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// PatchedPasswordExpiryPolicyRequest : Password Expiry Policy Serializer -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct PatchedPasswordExpiryPolicyRequest { - #[serde(rename = "name", skip_serializing_if = "Option::is_none")] - pub name: Option, - /// When this option is enabled, all executions of this policy will be logged. By default, only - /// execution errors are logged. - #[serde(rename = "execution_logging", skip_serializing_if = "Option::is_none")] - pub execution_logging: Option, - #[serde(rename = "days", skip_serializing_if = "Option::is_none")] - pub days: Option, - #[serde(rename = "deny_only", skip_serializing_if = "Option::is_none")] - pub deny_only: Option, -} - -impl PatchedPasswordExpiryPolicyRequest { - /// Password Expiry Policy Serializer - pub fn new() -> PatchedPasswordExpiryPolicyRequest { - PatchedPasswordExpiryPolicyRequest { - name: None, - execution_logging: None, - days: None, - deny_only: None, - } - } -} diff --git a/packages/client-rust/src/models/patched_password_policy_request.rs b/packages/client-rust/src/models/patched_password_policy_request.rs deleted file mode 100644 index 9f41bc03ef..0000000000 --- a/packages/client-rust/src/models/patched_password_policy_request.rs +++ /dev/null @@ -1,80 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// PatchedPasswordPolicyRequest : Password Policy Serializer -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct PatchedPasswordPolicyRequest { - #[serde(rename = "name", skip_serializing_if = "Option::is_none")] - pub name: Option, - /// When this option is enabled, all executions of this policy will be logged. By default, only - /// execution errors are logged. - #[serde(rename = "execution_logging", skip_serializing_if = "Option::is_none")] - pub execution_logging: Option, - /// Field key to check, field keys defined in Prompt stages are available. - #[serde(rename = "password_field", skip_serializing_if = "Option::is_none")] - pub password_field: Option, - #[serde(rename = "amount_digits", skip_serializing_if = "Option::is_none")] - pub amount_digits: Option, - #[serde(rename = "amount_uppercase", skip_serializing_if = "Option::is_none")] - pub amount_uppercase: Option, - #[serde(rename = "amount_lowercase", skip_serializing_if = "Option::is_none")] - pub amount_lowercase: Option, - #[serde(rename = "amount_symbols", skip_serializing_if = "Option::is_none")] - pub amount_symbols: Option, - #[serde(rename = "length_min", skip_serializing_if = "Option::is_none")] - pub length_min: Option, - #[serde(rename = "symbol_charset", skip_serializing_if = "Option::is_none")] - pub symbol_charset: Option, - #[serde(rename = "error_message", skip_serializing_if = "Option::is_none")] - pub error_message: Option, - #[serde(rename = "check_static_rules", skip_serializing_if = "Option::is_none")] - pub check_static_rules: Option, - #[serde( - rename = "check_have_i_been_pwned", - skip_serializing_if = "Option::is_none" - )] - pub check_have_i_been_pwned: Option, - #[serde(rename = "check_zxcvbn", skip_serializing_if = "Option::is_none")] - pub check_zxcvbn: Option, - /// How many times the password hash is allowed to be on haveibeenpwned - #[serde(rename = "hibp_allowed_count", skip_serializing_if = "Option::is_none")] - pub hibp_allowed_count: Option, - /// If the zxcvbn score is equal or less than this value, the policy will fail. - #[serde( - rename = "zxcvbn_score_threshold", - skip_serializing_if = "Option::is_none" - )] - pub zxcvbn_score_threshold: Option, -} - -impl PatchedPasswordPolicyRequest { - /// Password Policy Serializer - pub fn new() -> PatchedPasswordPolicyRequest { - PatchedPasswordPolicyRequest { - name: None, - execution_logging: None, - password_field: None, - amount_digits: None, - amount_uppercase: None, - amount_lowercase: None, - amount_symbols: None, - length_min: None, - symbol_charset: None, - error_message: None, - check_static_rules: None, - check_have_i_been_pwned: None, - check_zxcvbn: None, - hibp_allowed_count: None, - zxcvbn_score_threshold: None, - } - } -} diff --git a/packages/client-rust/src/models/patched_password_stage_request.rs b/packages/client-rust/src/models/patched_password_stage_request.rs deleted file mode 100644 index eaf43c8f09..0000000000 --- a/packages/client-rust/src/models/patched_password_stage_request.rs +++ /dev/null @@ -1,56 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// PatchedPasswordStageRequest : PasswordStage Serializer -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct PatchedPasswordStageRequest { - #[serde(rename = "name", skip_serializing_if = "Option::is_none")] - pub name: Option, - /// Selection of backends to test the password against. - #[serde(rename = "backends", skip_serializing_if = "Option::is_none")] - pub backends: Option>, - /// Flow used by an authenticated user to configure this Stage. If empty, user will not be able - /// to configure this stage. - #[serde( - rename = "configure_flow", - default, - with = "::serde_with::rust::double_option", - skip_serializing_if = "Option::is_none" - )] - pub configure_flow: Option>, - /// 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. - #[serde( - rename = "failed_attempts_before_cancel", - skip_serializing_if = "Option::is_none" - )] - pub failed_attempts_before_cancel: Option, - /// When enabled, provides a 'show password' button with the password input field. - #[serde( - rename = "allow_show_password", - skip_serializing_if = "Option::is_none" - )] - pub allow_show_password: Option, -} - -impl PatchedPasswordStageRequest { - /// PasswordStage Serializer - pub fn new() -> PatchedPasswordStageRequest { - PatchedPasswordStageRequest { - name: None, - backends: None, - configure_flow: None, - failed_attempts_before_cancel: None, - allow_show_password: None, - } - } -} diff --git a/packages/client-rust/src/models/patched_permission_assign_request.rs b/packages/client-rust/src/models/patched_permission_assign_request.rs deleted file mode 100644 index 35b36b9236..0000000000 --- a/packages/client-rust/src/models/patched_permission_assign_request.rs +++ /dev/null @@ -1,33 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// PatchedPermissionAssignRequest : Request to assign a new permission -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct PatchedPermissionAssignRequest { - #[serde(rename = "permissions", skip_serializing_if = "Option::is_none")] - pub permissions: Option>, - #[serde(rename = "model", skip_serializing_if = "Option::is_none")] - pub model: Option, - #[serde(rename = "object_pk", skip_serializing_if = "Option::is_none")] - pub object_pk: Option, -} - -impl PatchedPermissionAssignRequest { - /// Request to assign a new permission - pub fn new() -> PatchedPermissionAssignRequest { - PatchedPermissionAssignRequest { - permissions: None, - model: None, - object_pk: None, - } - } -} diff --git a/packages/client-rust/src/models/patched_plex_source_property_mapping_request.rs b/packages/client-rust/src/models/patched_plex_source_property_mapping_request.rs deleted file mode 100644 index b92847c5b9..0000000000 --- a/packages/client-rust/src/models/patched_plex_source_property_mapping_request.rs +++ /dev/null @@ -1,41 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// PatchedPlexSourcePropertyMappingRequest : PlexSourcePropertyMapping Serializer -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct PatchedPlexSourcePropertyMappingRequest { - /// 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. - #[serde( - rename = "managed", - default, - with = "::serde_with::rust::double_option", - skip_serializing_if = "Option::is_none" - )] - pub managed: Option>, - #[serde(rename = "name", skip_serializing_if = "Option::is_none")] - pub name: Option, - #[serde(rename = "expression", skip_serializing_if = "Option::is_none")] - pub expression: Option, -} - -impl PatchedPlexSourcePropertyMappingRequest { - /// PlexSourcePropertyMapping Serializer - pub fn new() -> PatchedPlexSourcePropertyMappingRequest { - PatchedPlexSourcePropertyMappingRequest { - managed: None, - name: None, - expression: None, - } - } -} diff --git a/packages/client-rust/src/models/patched_plex_source_request.rs b/packages/client-rust/src/models/patched_plex_source_request.rs deleted file mode 100644 index 4cbb102c92..0000000000 --- a/packages/client-rust/src/models/patched_plex_source_request.rs +++ /dev/null @@ -1,108 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// PatchedPlexSourceRequest : Plex Source Serializer -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct PatchedPlexSourceRequest { - /// Source's display Name. - #[serde(rename = "name", skip_serializing_if = "Option::is_none")] - pub name: Option, - /// Internal source name, used in URLs. - #[serde(rename = "slug", skip_serializing_if = "Option::is_none")] - pub slug: Option, - #[serde(rename = "enabled", skip_serializing_if = "Option::is_none")] - pub enabled: Option, - /// When enabled, this source will be displayed as a prominent button on the login page, - /// instead of a small icon. - #[serde(rename = "promoted", skip_serializing_if = "Option::is_none")] - pub promoted: Option, - /// Flow to use when authenticating existing users. - #[serde( - rename = "authentication_flow", - default, - with = "::serde_with::rust::double_option", - skip_serializing_if = "Option::is_none" - )] - pub authentication_flow: Option>, - /// Flow to use when enrolling new users. - #[serde( - rename = "enrollment_flow", - default, - with = "::serde_with::rust::double_option", - skip_serializing_if = "Option::is_none" - )] - pub enrollment_flow: Option>, - #[serde( - rename = "user_property_mappings", - skip_serializing_if = "Option::is_none" - )] - pub user_property_mappings: Option>, - #[serde( - rename = "group_property_mappings", - skip_serializing_if = "Option::is_none" - )] - pub group_property_mappings: Option>, - #[serde(rename = "policy_engine_mode", skip_serializing_if = "Option::is_none")] - pub policy_engine_mode: Option, - /// How the source determines if an existing user should be authenticated or a new user - /// enrolled. - #[serde(rename = "user_matching_mode", skip_serializing_if = "Option::is_none")] - pub user_matching_mode: Option, - #[serde(rename = "user_path_template", skip_serializing_if = "Option::is_none")] - pub user_path_template: Option, - #[serde(rename = "icon", skip_serializing_if = "Option::is_none")] - pub icon: Option, - /// How the source determines if an existing group should be used or a new group created. - #[serde( - rename = "group_matching_mode", - skip_serializing_if = "Option::is_none" - )] - pub group_matching_mode: Option, - /// Client identifier used to talk to Plex. - #[serde(rename = "client_id", skip_serializing_if = "Option::is_none")] - pub client_id: Option, - /// Which servers a user has to be a member of to be granted access. Empty list allows every - /// server. - #[serde(rename = "allowed_servers", skip_serializing_if = "Option::is_none")] - pub allowed_servers: Option>, - /// Allow friends to authenticate, even if you don't share a server. - #[serde(rename = "allow_friends", skip_serializing_if = "Option::is_none")] - pub allow_friends: Option, - /// Plex token used to check friends - #[serde(rename = "plex_token", skip_serializing_if = "Option::is_none")] - pub plex_token: Option, -} - -impl PatchedPlexSourceRequest { - /// Plex Source Serializer - pub fn new() -> PatchedPlexSourceRequest { - PatchedPlexSourceRequest { - name: None, - slug: None, - enabled: None, - promoted: None, - authentication_flow: None, - enrollment_flow: None, - user_property_mappings: None, - group_property_mappings: None, - policy_engine_mode: None, - user_matching_mode: None, - user_path_template: None, - icon: None, - group_matching_mode: None, - client_id: None, - allowed_servers: None, - allow_friends: None, - plex_token: None, - } - } -} diff --git a/packages/client-rust/src/models/patched_policy_binding_request.rs b/packages/client-rust/src/models/patched_policy_binding_request.rs deleted file mode 100644 index 810ec50e66..0000000000 --- a/packages/client-rust/src/models/patched_policy_binding_request.rs +++ /dev/null @@ -1,69 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// PatchedPolicyBindingRequest : PolicyBinding Serializer -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct PatchedPolicyBindingRequest { - #[serde( - rename = "policy", - default, - with = "::serde_with::rust::double_option", - skip_serializing_if = "Option::is_none" - )] - pub policy: Option>, - #[serde( - rename = "group", - default, - with = "::serde_with::rust::double_option", - skip_serializing_if = "Option::is_none" - )] - pub group: Option>, - #[serde( - rename = "user", - default, - with = "::serde_with::rust::double_option", - skip_serializing_if = "Option::is_none" - )] - pub user: Option>, - #[serde(rename = "target", skip_serializing_if = "Option::is_none")] - pub target: Option, - /// Negates the outcome of the policy. Messages are unaffected. - #[serde(rename = "negate", skip_serializing_if = "Option::is_none")] - pub negate: Option, - #[serde(rename = "enabled", skip_serializing_if = "Option::is_none")] - pub enabled: Option, - #[serde(rename = "order", skip_serializing_if = "Option::is_none")] - pub order: Option, - /// Timeout after which Policy execution is terminated. - #[serde(rename = "timeout", skip_serializing_if = "Option::is_none")] - pub timeout: Option, - /// Result if the Policy execution fails. - #[serde(rename = "failure_result", skip_serializing_if = "Option::is_none")] - pub failure_result: Option, -} - -impl PatchedPolicyBindingRequest { - /// PolicyBinding Serializer - pub fn new() -> PatchedPolicyBindingRequest { - PatchedPolicyBindingRequest { - policy: None, - group: None, - user: None, - target: None, - negate: None, - enabled: None, - order: None, - timeout: None, - failure_result: None, - } - } -} diff --git a/packages/client-rust/src/models/patched_prompt_request.rs b/packages/client-rust/src/models/patched_prompt_request.rs deleted file mode 100644 index cb9a61a8fb..0000000000 --- a/packages/client-rust/src/models/patched_prompt_request.rs +++ /dev/null @@ -1,69 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// PatchedPromptRequest : Prompt Serializer -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct PatchedPromptRequest { - #[serde(rename = "name", skip_serializing_if = "Option::is_none")] - pub name: Option, - /// Name of the form field, also used to store the value - #[serde(rename = "field_key", skip_serializing_if = "Option::is_none")] - pub field_key: Option, - #[serde(rename = "label", skip_serializing_if = "Option::is_none")] - pub label: Option, - #[serde(rename = "type", skip_serializing_if = "Option::is_none")] - pub r#type: Option, - #[serde(rename = "required", skip_serializing_if = "Option::is_none")] - pub required: Option, - /// 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. - #[serde(rename = "placeholder", skip_serializing_if = "Option::is_none")] - pub placeholder: Option, - /// 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. - #[serde(rename = "initial_value", skip_serializing_if = "Option::is_none")] - pub initial_value: Option, - #[serde(rename = "order", skip_serializing_if = "Option::is_none")] - pub order: Option, - #[serde(rename = "sub_text", skip_serializing_if = "Option::is_none")] - pub sub_text: Option, - #[serde( - rename = "placeholder_expression", - skip_serializing_if = "Option::is_none" - )] - pub placeholder_expression: Option, - #[serde( - rename = "initial_value_expression", - skip_serializing_if = "Option::is_none" - )] - pub initial_value_expression: Option, -} - -impl PatchedPromptRequest { - /// Prompt Serializer - pub fn new() -> PatchedPromptRequest { - PatchedPromptRequest { - name: None, - field_key: None, - label: None, - r#type: None, - required: None, - placeholder: None, - initial_value: None, - order: None, - sub_text: None, - placeholder_expression: None, - initial_value_expression: None, - } - } -} diff --git a/packages/client-rust/src/models/patched_prompt_stage_request.rs b/packages/client-rust/src/models/patched_prompt_stage_request.rs deleted file mode 100644 index 8a3049af1e..0000000000 --- a/packages/client-rust/src/models/patched_prompt_stage_request.rs +++ /dev/null @@ -1,36 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// PatchedPromptStageRequest : PromptStage Serializer -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct PatchedPromptStageRequest { - #[serde(rename = "name", skip_serializing_if = "Option::is_none")] - pub name: Option, - #[serde(rename = "fields", skip_serializing_if = "Option::is_none")] - pub fields: Option>, - #[serde( - rename = "validation_policies", - skip_serializing_if = "Option::is_none" - )] - pub validation_policies: Option>, -} - -impl PatchedPromptStageRequest { - /// PromptStage Serializer - pub fn new() -> PatchedPromptStageRequest { - PatchedPromptStageRequest { - name: None, - fields: None, - validation_policies: None, - } - } -} diff --git a/packages/client-rust/src/models/patched_proxy_provider_request.rs b/packages/client-rust/src/models/patched_proxy_provider_request.rs deleted file mode 100644 index 43b0aefe67..0000000000 --- a/packages/client-rust/src/models/patched_proxy_provider_request.rs +++ /dev/null @@ -1,137 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// PatchedProxyProviderRequest : ProxyProvider Serializer -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct PatchedProxyProviderRequest { - #[serde(rename = "name", skip_serializing_if = "Option::is_none")] - pub name: Option, - /// Flow used for authentication when the associated application is accessed by an - /// un-authenticated user. - #[serde( - rename = "authentication_flow", - default, - with = "::serde_with::rust::double_option", - skip_serializing_if = "Option::is_none" - )] - pub authentication_flow: Option>, - /// Flow used when authorizing this provider. - #[serde(rename = "authorization_flow", skip_serializing_if = "Option::is_none")] - pub authorization_flow: Option, - /// Flow used ending the session from a provider. - #[serde(rename = "invalidation_flow", skip_serializing_if = "Option::is_none")] - pub invalidation_flow: Option, - #[serde(rename = "property_mappings", skip_serializing_if = "Option::is_none")] - pub property_mappings: Option>, - #[serde(rename = "internal_host", skip_serializing_if = "Option::is_none")] - pub internal_host: Option, - #[serde(rename = "external_host", skip_serializing_if = "Option::is_none")] - pub external_host: Option, - /// Validate SSL Certificates of upstream servers - #[serde( - rename = "internal_host_ssl_validation", - skip_serializing_if = "Option::is_none" - )] - pub internal_host_ssl_validation: Option, - #[serde( - rename = "certificate", - default, - with = "::serde_with::rust::double_option", - skip_serializing_if = "Option::is_none" - )] - pub certificate: Option>, - /// Regular expressions for which authentication is not required. Each new line is interpreted - /// as a new Regular Expression. - #[serde(rename = "skip_path_regex", skip_serializing_if = "Option::is_none")] - pub skip_path_regex: Option, - /// Set a custom HTTP-Basic Authentication header based on values from authentik. - #[serde(rename = "basic_auth_enabled", skip_serializing_if = "Option::is_none")] - pub basic_auth_enabled: Option, - /// User/Group Attribute used for the password part of the HTTP-Basic Header. - #[serde( - rename = "basic_auth_password_attribute", - skip_serializing_if = "Option::is_none" - )] - pub basic_auth_password_attribute: Option, - /// User/Group Attribute used for the user part of the HTTP-Basic Header. If not set, the - /// user's Email address is used. - #[serde( - rename = "basic_auth_user_attribute", - skip_serializing_if = "Option::is_none" - )] - pub basic_auth_user_attribute: Option, - /// Enable support for forwardAuth in traefik and nginx auth_request. Exclusive with - /// internal_host. - #[serde(rename = "mode", skip_serializing_if = "Option::is_none")] - pub mode: Option, - /// When enabled, this provider will intercept the authorization header and authenticate - /// requests based on its value. - #[serde( - rename = "intercept_header_auth", - skip_serializing_if = "Option::is_none" - )] - pub intercept_header_auth: Option, - #[serde(rename = "cookie_domain", skip_serializing_if = "Option::is_none")] - pub cookie_domain: Option, - #[serde( - rename = "jwt_federation_sources", - skip_serializing_if = "Option::is_none" - )] - pub jwt_federation_sources: Option>, - #[serde( - rename = "jwt_federation_providers", - skip_serializing_if = "Option::is_none" - )] - pub jwt_federation_providers: Option>, - /// Tokens not valid on or after current time + this value (Format: - /// hours=1;minutes=2;seconds=3). - #[serde( - rename = "access_token_validity", - skip_serializing_if = "Option::is_none" - )] - pub access_token_validity: Option, - /// Tokens not valid on or after current time + this value (Format: - /// hours=1;minutes=2;seconds=3). - #[serde( - rename = "refresh_token_validity", - skip_serializing_if = "Option::is_none" - )] - pub refresh_token_validity: Option, -} - -impl PatchedProxyProviderRequest { - /// ProxyProvider Serializer - pub fn new() -> PatchedProxyProviderRequest { - PatchedProxyProviderRequest { - name: None, - authentication_flow: None, - authorization_flow: None, - invalidation_flow: None, - property_mappings: None, - internal_host: None, - external_host: None, - internal_host_ssl_validation: None, - certificate: None, - skip_path_regex: None, - basic_auth_enabled: None, - basic_auth_password_attribute: None, - basic_auth_user_attribute: None, - mode: None, - intercept_header_auth: None, - cookie_domain: None, - jwt_federation_sources: None, - jwt_federation_providers: None, - access_token_validity: None, - refresh_token_validity: None, - } - } -} diff --git a/packages/client-rust/src/models/patched_rac_property_mapping_request.rs b/packages/client-rust/src/models/patched_rac_property_mapping_request.rs deleted file mode 100644 index 312ad51978..0000000000 --- a/packages/client-rust/src/models/patched_rac_property_mapping_request.rs +++ /dev/null @@ -1,44 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// PatchedRacPropertyMappingRequest : RACPropertyMapping Serializer -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct PatchedRacPropertyMappingRequest { - /// 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. - #[serde( - rename = "managed", - default, - with = "::serde_with::rust::double_option", - skip_serializing_if = "Option::is_none" - )] - pub managed: Option>, - #[serde(rename = "name", skip_serializing_if = "Option::is_none")] - pub name: Option, - #[serde(rename = "expression", skip_serializing_if = "Option::is_none")] - pub expression: Option, - #[serde(rename = "static_settings", skip_serializing_if = "Option::is_none")] - pub static_settings: Option>, -} - -impl PatchedRacPropertyMappingRequest { - /// RACPropertyMapping Serializer - pub fn new() -> PatchedRacPropertyMappingRequest { - PatchedRacPropertyMappingRequest { - managed: None, - name: None, - expression: None, - static_settings: None, - } - } -} diff --git a/packages/client-rust/src/models/patched_rac_provider_request.rs b/packages/client-rust/src/models/patched_rac_provider_request.rs deleted file mode 100644 index 15e71e79af..0000000000 --- a/packages/client-rust/src/models/patched_rac_provider_request.rs +++ /dev/null @@ -1,59 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// PatchedRacProviderRequest : RACProvider Serializer -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct PatchedRacProviderRequest { - #[serde(rename = "name", skip_serializing_if = "Option::is_none")] - pub name: Option, - /// Flow used for authentication when the associated application is accessed by an - /// un-authenticated user. - #[serde( - rename = "authentication_flow", - default, - with = "::serde_with::rust::double_option", - skip_serializing_if = "Option::is_none" - )] - pub authentication_flow: Option>, - /// Flow used when authorizing this provider. - #[serde(rename = "authorization_flow", skip_serializing_if = "Option::is_none")] - pub authorization_flow: Option, - #[serde(rename = "property_mappings", skip_serializing_if = "Option::is_none")] - pub property_mappings: Option>, - #[serde(rename = "settings", skip_serializing_if = "Option::is_none")] - pub settings: Option>, - /// 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) - #[serde(rename = "connection_expiry", skip_serializing_if = "Option::is_none")] - pub connection_expiry: Option, - /// When set to true, connection tokens will be deleted upon disconnect. - #[serde( - rename = "delete_token_on_disconnect", - skip_serializing_if = "Option::is_none" - )] - pub delete_token_on_disconnect: Option, -} - -impl PatchedRacProviderRequest { - /// RACProvider Serializer - pub fn new() -> PatchedRacProviderRequest { - PatchedRacProviderRequest { - name: None, - authentication_flow: None, - authorization_flow: None, - property_mappings: None, - settings: None, - connection_expiry: None, - delete_token_on_disconnect: None, - } - } -} diff --git a/packages/client-rust/src/models/patched_radius_provider_property_mapping_request.rs b/packages/client-rust/src/models/patched_radius_provider_property_mapping_request.rs deleted file mode 100644 index a424d67cd9..0000000000 --- a/packages/client-rust/src/models/patched_radius_provider_property_mapping_request.rs +++ /dev/null @@ -1,41 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// PatchedRadiusProviderPropertyMappingRequest : RadiusProviderPropertyMapping Serializer -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct PatchedRadiusProviderPropertyMappingRequest { - /// 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. - #[serde( - rename = "managed", - default, - with = "::serde_with::rust::double_option", - skip_serializing_if = "Option::is_none" - )] - pub managed: Option>, - #[serde(rename = "name", skip_serializing_if = "Option::is_none")] - pub name: Option, - #[serde(rename = "expression", skip_serializing_if = "Option::is_none")] - pub expression: Option, -} - -impl PatchedRadiusProviderPropertyMappingRequest { - /// RadiusProviderPropertyMapping Serializer - pub fn new() -> PatchedRadiusProviderPropertyMappingRequest { - PatchedRadiusProviderPropertyMappingRequest { - managed: None, - name: None, - expression: None, - } - } -} diff --git a/packages/client-rust/src/models/patched_radius_provider_request.rs b/packages/client-rust/src/models/patched_radius_provider_request.rs deleted file mode 100644 index 9792d208d7..0000000000 --- a/packages/client-rust/src/models/patched_radius_provider_request.rs +++ /dev/null @@ -1,72 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// PatchedRadiusProviderRequest : RadiusProvider Serializer -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct PatchedRadiusProviderRequest { - #[serde(rename = "name", skip_serializing_if = "Option::is_none")] - pub name: Option, - /// Flow used for authentication when the associated application is accessed by an - /// un-authenticated user. - #[serde( - rename = "authentication_flow", - default, - with = "::serde_with::rust::double_option", - skip_serializing_if = "Option::is_none" - )] - pub authentication_flow: Option>, - /// Flow used when authorizing this provider. - #[serde(rename = "authorization_flow", skip_serializing_if = "Option::is_none")] - pub authorization_flow: Option, - /// Flow used ending the session from a provider. - #[serde(rename = "invalidation_flow", skip_serializing_if = "Option::is_none")] - pub invalidation_flow: Option, - #[serde(rename = "property_mappings", skip_serializing_if = "Option::is_none")] - pub property_mappings: Option>, - /// 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. - #[serde(rename = "client_networks", skip_serializing_if = "Option::is_none")] - pub client_networks: Option, - /// Shared secret between clients and server to hash packets. - #[serde(rename = "shared_secret", skip_serializing_if = "Option::is_none")] - pub shared_secret: Option, - /// 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. - #[serde(rename = "mfa_support", skip_serializing_if = "Option::is_none")] - pub mfa_support: Option, - #[serde( - rename = "certificate", - default, - with = "::serde_with::rust::double_option", - skip_serializing_if = "Option::is_none" - )] - pub certificate: Option>, -} - -impl PatchedRadiusProviderRequest { - /// RadiusProvider Serializer - pub fn new() -> PatchedRadiusProviderRequest { - PatchedRadiusProviderRequest { - name: None, - authentication_flow: None, - authorization_flow: None, - invalidation_flow: None, - property_mappings: None, - client_networks: None, - shared_secret: None, - mfa_support: None, - certificate: None, - } - } -} diff --git a/packages/client-rust/src/models/patched_redirect_stage_request.rs b/packages/client-rust/src/models/patched_redirect_stage_request.rs deleted file mode 100644 index 5970afc85b..0000000000 --- a/packages/client-rust/src/models/patched_redirect_stage_request.rs +++ /dev/null @@ -1,44 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// PatchedRedirectStageRequest : RedirectStage Serializer -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct PatchedRedirectStageRequest { - #[serde(rename = "name", skip_serializing_if = "Option::is_none")] - pub name: Option, - #[serde(rename = "keep_context", skip_serializing_if = "Option::is_none")] - pub keep_context: Option, - #[serde(rename = "mode", skip_serializing_if = "Option::is_none")] - pub mode: Option, - #[serde(rename = "target_static", skip_serializing_if = "Option::is_none")] - pub target_static: Option, - #[serde( - rename = "target_flow", - default, - with = "::serde_with::rust::double_option", - skip_serializing_if = "Option::is_none" - )] - pub target_flow: Option>, -} - -impl PatchedRedirectStageRequest { - /// RedirectStage Serializer - pub fn new() -> PatchedRedirectStageRequest { - PatchedRedirectStageRequest { - name: None, - keep_context: None, - mode: None, - target_static: None, - target_flow: None, - } - } -} diff --git a/packages/client-rust/src/models/patched_reputation_policy_request.rs b/packages/client-rust/src/models/patched_reputation_policy_request.rs deleted file mode 100644 index 050859e7a5..0000000000 --- a/packages/client-rust/src/models/patched_reputation_policy_request.rs +++ /dev/null @@ -1,41 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// PatchedReputationPolicyRequest : Reputation Policy Serializer -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct PatchedReputationPolicyRequest { - #[serde(rename = "name", skip_serializing_if = "Option::is_none")] - pub name: Option, - /// When this option is enabled, all executions of this policy will be logged. By default, only - /// execution errors are logged. - #[serde(rename = "execution_logging", skip_serializing_if = "Option::is_none")] - pub execution_logging: Option, - #[serde(rename = "check_ip", skip_serializing_if = "Option::is_none")] - pub check_ip: Option, - #[serde(rename = "check_username", skip_serializing_if = "Option::is_none")] - pub check_username: Option, - #[serde(rename = "threshold", skip_serializing_if = "Option::is_none")] - pub threshold: Option, -} - -impl PatchedReputationPolicyRequest { - /// Reputation Policy Serializer - pub fn new() -> PatchedReputationPolicyRequest { - PatchedReputationPolicyRequest { - name: None, - execution_logging: None, - check_ip: None, - check_username: None, - threshold: None, - } - } -} diff --git a/packages/client-rust/src/models/patched_role_request.rs b/packages/client-rust/src/models/patched_role_request.rs deleted file mode 100644 index c09c97ae75..0000000000 --- a/packages/client-rust/src/models/patched_role_request.rs +++ /dev/null @@ -1,25 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// PatchedRoleRequest : Role serializer -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct PatchedRoleRequest { - #[serde(rename = "name", skip_serializing_if = "Option::is_none")] - pub name: Option, -} - -impl PatchedRoleRequest { - /// Role serializer - pub fn new() -> PatchedRoleRequest { - PatchedRoleRequest { name: None } - } -} diff --git a/packages/client-rust/src/models/patched_saml_property_mapping_request.rs b/packages/client-rust/src/models/patched_saml_property_mapping_request.rs deleted file mode 100644 index 8480ba87f8..0000000000 --- a/packages/client-rust/src/models/patched_saml_property_mapping_request.rs +++ /dev/null @@ -1,52 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// PatchedSamlPropertyMappingRequest : SAMLPropertyMapping Serializer -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct PatchedSamlPropertyMappingRequest { - /// 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. - #[serde( - rename = "managed", - default, - with = "::serde_with::rust::double_option", - skip_serializing_if = "Option::is_none" - )] - pub managed: Option>, - #[serde(rename = "name", skip_serializing_if = "Option::is_none")] - pub name: Option, - #[serde(rename = "expression", skip_serializing_if = "Option::is_none")] - pub expression: Option, - #[serde(rename = "saml_name", skip_serializing_if = "Option::is_none")] - pub saml_name: Option, - #[serde( - rename = "friendly_name", - default, - with = "::serde_with::rust::double_option", - skip_serializing_if = "Option::is_none" - )] - pub friendly_name: Option>, -} - -impl PatchedSamlPropertyMappingRequest { - /// SAMLPropertyMapping Serializer - pub fn new() -> PatchedSamlPropertyMappingRequest { - PatchedSamlPropertyMappingRequest { - managed: None, - name: None, - expression: None, - saml_name: None, - friendly_name: None, - } - } -} diff --git a/packages/client-rust/src/models/patched_saml_provider_request.rs b/packages/client-rust/src/models/patched_saml_provider_request.rs deleted file mode 100644 index 80cacea2e7..0000000000 --- a/packages/client-rust/src/models/patched_saml_provider_request.rs +++ /dev/null @@ -1,193 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// PatchedSamlProviderRequest : SAMLProvider Serializer -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct PatchedSamlProviderRequest { - #[serde(rename = "name", skip_serializing_if = "Option::is_none")] - pub name: Option, - /// Flow used for authentication when the associated application is accessed by an - /// un-authenticated user. - #[serde( - rename = "authentication_flow", - default, - with = "::serde_with::rust::double_option", - skip_serializing_if = "Option::is_none" - )] - pub authentication_flow: Option>, - /// Flow used when authorizing this provider. - #[serde(rename = "authorization_flow", skip_serializing_if = "Option::is_none")] - pub authorization_flow: Option, - /// Flow used ending the session from a provider. - #[serde(rename = "invalidation_flow", skip_serializing_if = "Option::is_none")] - pub invalidation_flow: Option, - #[serde(rename = "property_mappings", skip_serializing_if = "Option::is_none")] - pub property_mappings: Option>, - #[serde(rename = "acs_url", skip_serializing_if = "Option::is_none")] - pub acs_url: Option, - /// Single Logout Service URL where the logout response should be sent. - #[serde(rename = "sls_url", skip_serializing_if = "Option::is_none")] - pub sls_url: Option, - /// Value of the audience restriction field of the assertion. When left empty, no audience - /// restriction will be added. - #[serde(rename = "audience", skip_serializing_if = "Option::is_none")] - pub audience: Option, - /// Also known as EntityID - #[serde(rename = "issuer", skip_serializing_if = "Option::is_none")] - pub issuer: Option, - /// Assertion valid not before current time + this value (Format: - /// hours=-1;minutes=-2;seconds=-3). - #[serde( - rename = "assertion_valid_not_before", - skip_serializing_if = "Option::is_none" - )] - pub assertion_valid_not_before: Option, - /// Assertion not valid on or after current time + this value (Format: - /// hours=1;minutes=2;seconds=3). - #[serde( - rename = "assertion_valid_not_on_or_after", - skip_serializing_if = "Option::is_none" - )] - pub assertion_valid_not_on_or_after: Option, - /// Session not valid on or after current time + this value (Format: - /// hours=1;minutes=2;seconds=3). - #[serde( - rename = "session_valid_not_on_or_after", - skip_serializing_if = "Option::is_none" - )] - pub session_valid_not_on_or_after: Option, - /// Configure how the NameID value will be created. When left empty, the NameIDPolicy of the - /// incoming request will be considered - #[serde( - rename = "name_id_mapping", - default, - with = "::serde_with::rust::double_option", - skip_serializing_if = "Option::is_none" - )] - pub name_id_mapping: Option>, - /// 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. - #[serde( - rename = "authn_context_class_ref_mapping", - default, - with = "::serde_with::rust::double_option", - skip_serializing_if = "Option::is_none" - )] - pub authn_context_class_ref_mapping: Option>, - #[serde(rename = "digest_algorithm", skip_serializing_if = "Option::is_none")] - pub digest_algorithm: Option, - #[serde( - rename = "signature_algorithm", - skip_serializing_if = "Option::is_none" - )] - pub signature_algorithm: Option, - /// Keypair used to sign outgoing Responses going to the Service Provider. - #[serde( - rename = "signing_kp", - default, - with = "::serde_with::rust::double_option", - skip_serializing_if = "Option::is_none" - )] - pub signing_kp: Option>, - /// When selected, incoming assertion's Signatures will be validated against this certificate. - /// To allow unsigned Requests, leave on default. - #[serde( - rename = "verification_kp", - default, - with = "::serde_with::rust::double_option", - skip_serializing_if = "Option::is_none" - )] - pub verification_kp: Option>, - /// 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. - #[serde( - rename = "encryption_kp", - default, - with = "::serde_with::rust::double_option", - skip_serializing_if = "Option::is_none" - )] - pub encryption_kp: Option>, - #[serde(rename = "sign_assertion", skip_serializing_if = "Option::is_none")] - pub sign_assertion: Option, - #[serde(rename = "sign_response", skip_serializing_if = "Option::is_none")] - pub sign_response: Option, - #[serde( - rename = "sign_logout_request", - skip_serializing_if = "Option::is_none" - )] - pub sign_logout_request: Option, - #[serde( - rename = "sign_logout_response", - skip_serializing_if = "Option::is_none" - )] - pub sign_logout_response: Option, - /// This determines how authentik sends the response back to the Service Provider. - #[serde(rename = "sp_binding", skip_serializing_if = "Option::is_none")] - pub sp_binding: Option, - /// This determines how authentik sends the logout response back to the Service Provider. - #[serde(rename = "sls_binding", skip_serializing_if = "Option::is_none")] - pub sls_binding: Option, - /// 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). - #[serde(rename = "logout_method", skip_serializing_if = "Option::is_none")] - pub logout_method: Option, - /// Default relay_state value for IDP-initiated logins - #[serde( - rename = "default_relay_state", - skip_serializing_if = "Option::is_none" - )] - pub default_relay_state: Option, - #[serde( - rename = "default_name_id_policy", - skip_serializing_if = "Option::is_none" - )] - pub default_name_id_policy: Option, -} - -impl PatchedSamlProviderRequest { - /// SAMLProvider Serializer - pub fn new() -> PatchedSamlProviderRequest { - PatchedSamlProviderRequest { - name: None, - authentication_flow: None, - authorization_flow: None, - invalidation_flow: None, - property_mappings: None, - acs_url: None, - sls_url: None, - audience: None, - issuer: None, - assertion_valid_not_before: None, - assertion_valid_not_on_or_after: None, - session_valid_not_on_or_after: None, - name_id_mapping: None, - authn_context_class_ref_mapping: None, - digest_algorithm: None, - signature_algorithm: None, - signing_kp: None, - verification_kp: None, - encryption_kp: None, - sign_assertion: None, - sign_response: None, - sign_logout_request: None, - sign_logout_response: None, - sp_binding: None, - sls_binding: None, - logout_method: None, - default_relay_state: None, - default_name_id_policy: None, - } - } -} diff --git a/packages/client-rust/src/models/patched_saml_source_property_mapping_request.rs b/packages/client-rust/src/models/patched_saml_source_property_mapping_request.rs deleted file mode 100644 index 95d330929c..0000000000 --- a/packages/client-rust/src/models/patched_saml_source_property_mapping_request.rs +++ /dev/null @@ -1,41 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// PatchedSamlSourcePropertyMappingRequest : SAMLSourcePropertyMapping Serializer -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct PatchedSamlSourcePropertyMappingRequest { - /// 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. - #[serde( - rename = "managed", - default, - with = "::serde_with::rust::double_option", - skip_serializing_if = "Option::is_none" - )] - pub managed: Option>, - #[serde(rename = "name", skip_serializing_if = "Option::is_none")] - pub name: Option, - #[serde(rename = "expression", skip_serializing_if = "Option::is_none")] - pub expression: Option, -} - -impl PatchedSamlSourcePropertyMappingRequest { - /// SAMLSourcePropertyMapping Serializer - pub fn new() -> PatchedSamlSourcePropertyMappingRequest { - PatchedSamlSourcePropertyMappingRequest { - managed: None, - name: None, - expression: None, - } - } -} diff --git a/packages/client-rust/src/models/patched_saml_source_request.rs b/packages/client-rust/src/models/patched_saml_source_request.rs deleted file mode 100644 index cb5ccfee2f..0000000000 --- a/packages/client-rust/src/models/patched_saml_source_request.rs +++ /dev/null @@ -1,187 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// PatchedSamlSourceRequest : SAMLSource Serializer -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct PatchedSamlSourceRequest { - /// Source's display Name. - #[serde(rename = "name", skip_serializing_if = "Option::is_none")] - pub name: Option, - /// Internal source name, used in URLs. - #[serde(rename = "slug", skip_serializing_if = "Option::is_none")] - pub slug: Option, - #[serde(rename = "enabled", skip_serializing_if = "Option::is_none")] - pub enabled: Option, - /// When enabled, this source will be displayed as a prominent button on the login page, - /// instead of a small icon. - #[serde(rename = "promoted", skip_serializing_if = "Option::is_none")] - pub promoted: Option, - /// Flow to use when authenticating existing users. - #[serde( - rename = "authentication_flow", - default, - with = "::serde_with::rust::double_option", - skip_serializing_if = "Option::is_none" - )] - pub authentication_flow: Option>, - /// Flow to use when enrolling new users. - #[serde( - rename = "enrollment_flow", - default, - with = "::serde_with::rust::double_option", - skip_serializing_if = "Option::is_none" - )] - pub enrollment_flow: Option>, - #[serde( - rename = "user_property_mappings", - skip_serializing_if = "Option::is_none" - )] - pub user_property_mappings: Option>, - #[serde( - rename = "group_property_mappings", - skip_serializing_if = "Option::is_none" - )] - pub group_property_mappings: Option>, - #[serde(rename = "policy_engine_mode", skip_serializing_if = "Option::is_none")] - pub policy_engine_mode: Option, - /// How the source determines if an existing user should be authenticated or a new user - /// enrolled. - #[serde(rename = "user_matching_mode", skip_serializing_if = "Option::is_none")] - pub user_matching_mode: Option, - #[serde(rename = "user_path_template", skip_serializing_if = "Option::is_none")] - pub user_path_template: Option, - #[serde(rename = "icon", skip_serializing_if = "Option::is_none")] - pub icon: Option, - /// How the source determines if an existing group should be used or a new group created. - #[serde( - rename = "group_matching_mode", - skip_serializing_if = "Option::is_none" - )] - pub group_matching_mode: Option, - /// Flow used before authentication. - #[serde( - rename = "pre_authentication_flow", - skip_serializing_if = "Option::is_none" - )] - pub pre_authentication_flow: Option, - /// Also known as Entity ID. Defaults the Metadata URL. - #[serde(rename = "issuer", skip_serializing_if = "Option::is_none")] - pub issuer: Option, - /// URL that the initial Login request is sent to. - #[serde(rename = "sso_url", skip_serializing_if = "Option::is_none")] - pub sso_url: Option, - /// Optional URL if your IDP supports Single-Logout. - #[serde( - rename = "slo_url", - default, - with = "::serde_with::rust::double_option", - skip_serializing_if = "Option::is_none" - )] - pub slo_url: Option>, - /// Allows authentication flows initiated by the IdP. This can be a security risk, as no - /// validation of the request ID is done. - #[serde( - rename = "allow_idp_initiated", - skip_serializing_if = "Option::is_none" - )] - pub allow_idp_initiated: Option, - /// When enabled, the IdP will re-authenticate the user even if a session exists. - #[serde(rename = "force_authn", skip_serializing_if = "Option::is_none")] - pub force_authn: Option, - /// NameID Policy sent to the IdP. Can be unset, in which case no Policy is sent. - #[serde(rename = "name_id_policy", skip_serializing_if = "Option::is_none")] - pub name_id_policy: Option, - #[serde(rename = "binding_type", skip_serializing_if = "Option::is_none")] - pub binding_type: Option, - /// When selected, incoming assertion's Signatures will be validated against this certificate. - /// To allow unsigned Requests, leave on default. - #[serde( - rename = "verification_kp", - default, - with = "::serde_with::rust::double_option", - skip_serializing_if = "Option::is_none" - )] - pub verification_kp: Option>, - /// Keypair used to sign outgoing Responses going to the Identity Provider. - #[serde( - rename = "signing_kp", - default, - with = "::serde_with::rust::double_option", - skip_serializing_if = "Option::is_none" - )] - pub signing_kp: Option>, - #[serde(rename = "digest_algorithm", skip_serializing_if = "Option::is_none")] - pub digest_algorithm: Option, - #[serde( - rename = "signature_algorithm", - skip_serializing_if = "Option::is_none" - )] - pub signature_algorithm: Option, - /// 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). - #[serde( - rename = "temporary_user_delete_after", - skip_serializing_if = "Option::is_none" - )] - pub temporary_user_delete_after: Option, - /// 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. - #[serde( - rename = "encryption_kp", - default, - with = "::serde_with::rust::double_option", - skip_serializing_if = "Option::is_none" - )] - pub encryption_kp: Option>, - #[serde(rename = "signed_assertion", skip_serializing_if = "Option::is_none")] - pub signed_assertion: Option, - #[serde(rename = "signed_response", skip_serializing_if = "Option::is_none")] - pub signed_response: Option, -} - -impl PatchedSamlSourceRequest { - /// SAMLSource Serializer - pub fn new() -> PatchedSamlSourceRequest { - PatchedSamlSourceRequest { - name: None, - slug: None, - enabled: None, - promoted: None, - authentication_flow: None, - enrollment_flow: None, - user_property_mappings: None, - group_property_mappings: None, - policy_engine_mode: None, - user_matching_mode: None, - user_path_template: None, - icon: None, - group_matching_mode: None, - pre_authentication_flow: None, - issuer: None, - sso_url: None, - slo_url: None, - allow_idp_initiated: None, - force_authn: None, - name_id_policy: None, - binding_type: None, - verification_kp: None, - signing_kp: None, - digest_algorithm: None, - signature_algorithm: None, - temporary_user_delete_after: None, - encryption_kp: None, - signed_assertion: None, - signed_response: None, - } - } -} diff --git a/packages/client-rust/src/models/patched_schedule_request.rs b/packages/client-rust/src/models/patched_schedule_request.rs deleted file mode 100644 index 0ef3646b3d..0000000000 --- a/packages/client-rust/src/models/patched_schedule_request.rs +++ /dev/null @@ -1,38 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct PatchedScheduleRequest { - #[serde( - rename = "rel_obj_id", - default, - with = "::serde_with::rust::double_option", - skip_serializing_if = "Option::is_none" - )] - pub rel_obj_id: Option>, - /// When to schedule tasks - #[serde(rename = "crontab", skip_serializing_if = "Option::is_none")] - pub crontab: Option, - /// Pause this schedule - #[serde(rename = "paused", skip_serializing_if = "Option::is_none")] - pub paused: Option, -} - -impl PatchedScheduleRequest { - pub fn new() -> PatchedScheduleRequest { - PatchedScheduleRequest { - rel_obj_id: None, - crontab: None, - paused: None, - } - } -} diff --git a/packages/client-rust/src/models/patched_scim_mapping_request.rs b/packages/client-rust/src/models/patched_scim_mapping_request.rs deleted file mode 100644 index 43b9219fc2..0000000000 --- a/packages/client-rust/src/models/patched_scim_mapping_request.rs +++ /dev/null @@ -1,41 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// PatchedScimMappingRequest : SCIMMapping Serializer -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct PatchedScimMappingRequest { - /// 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. - #[serde( - rename = "managed", - default, - with = "::serde_with::rust::double_option", - skip_serializing_if = "Option::is_none" - )] - pub managed: Option>, - #[serde(rename = "name", skip_serializing_if = "Option::is_none")] - pub name: Option, - #[serde(rename = "expression", skip_serializing_if = "Option::is_none")] - pub expression: Option, -} - -impl PatchedScimMappingRequest { - /// SCIMMapping Serializer - pub fn new() -> PatchedScimMappingRequest { - PatchedScimMappingRequest { - managed: None, - name: None, - expression: None, - } - } -} diff --git a/packages/client-rust/src/models/patched_scim_provider_request.rs b/packages/client-rust/src/models/patched_scim_provider_request.rs deleted file mode 100644 index 7ff56c219d..0000000000 --- a/packages/client-rust/src/models/patched_scim_provider_request.rs +++ /dev/null @@ -1,100 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// PatchedScimProviderRequest : SCIMProvider Serializer -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct PatchedScimProviderRequest { - #[serde(rename = "name", skip_serializing_if = "Option::is_none")] - pub name: Option, - #[serde(rename = "property_mappings", skip_serializing_if = "Option::is_none")] - pub property_mappings: Option>, - /// Property mappings used for group creation/updating. - #[serde( - rename = "property_mappings_group", - skip_serializing_if = "Option::is_none" - )] - pub property_mappings_group: Option>, - /// Base URL to SCIM requests, usually ends in /v2 - #[serde(rename = "url", skip_serializing_if = "Option::is_none")] - pub url: Option, - #[serde( - rename = "verify_certificates", - skip_serializing_if = "Option::is_none" - )] - pub verify_certificates: Option, - /// Authentication token - #[serde(rename = "token", skip_serializing_if = "Option::is_none")] - pub token: Option, - #[serde(rename = "auth_mode", skip_serializing_if = "Option::is_none")] - pub auth_mode: Option, - /// OAuth Source used for authentication - #[serde( - rename = "auth_oauth", - default, - with = "::serde_with::rust::double_option", - skip_serializing_if = "Option::is_none" - )] - pub auth_oauth: Option>, - /// Additional OAuth parameters, such as grant_type - #[serde(rename = "auth_oauth_params", skip_serializing_if = "Option::is_none")] - pub auth_oauth_params: Option>, - /// Alter authentik behavior for vendor-specific SCIM implementations. - #[serde(rename = "compatibility_mode", skip_serializing_if = "Option::is_none")] - pub compatibility_mode: Option, - /// Cache duration for ServiceProviderConfig responses. Set minutes=0 to disable. - #[serde( - rename = "service_provider_config_cache_timeout", - skip_serializing_if = "Option::is_none" - )] - pub service_provider_config_cache_timeout: Option, - #[serde( - rename = "exclude_users_service_account", - skip_serializing_if = "Option::is_none" - )] - pub exclude_users_service_account: Option, - /// Controls the number of objects synced in a single task - #[serde(rename = "sync_page_size", skip_serializing_if = "Option::is_none")] - pub sync_page_size: Option, - /// Timeout for synchronization of a single page - #[serde(rename = "sync_page_timeout", skip_serializing_if = "Option::is_none")] - pub sync_page_timeout: Option, - /// Group filters used to define sync-scope for groups. - #[serde(rename = "group_filters", skip_serializing_if = "Option::is_none")] - pub group_filters: Option>, - /// When enabled, provider will not modify or create objects in the remote system. - #[serde(rename = "dry_run", skip_serializing_if = "Option::is_none")] - pub dry_run: Option, -} - -impl PatchedScimProviderRequest { - /// SCIMProvider Serializer - pub fn new() -> PatchedScimProviderRequest { - PatchedScimProviderRequest { - name: None, - property_mappings: None, - property_mappings_group: None, - url: None, - verify_certificates: None, - token: None, - auth_mode: None, - auth_oauth: None, - auth_oauth_params: None, - compatibility_mode: None, - service_provider_config_cache_timeout: None, - exclude_users_service_account: None, - sync_page_size: None, - sync_page_timeout: None, - group_filters: None, - dry_run: None, - } - } -} diff --git a/packages/client-rust/src/models/patched_scim_source_group_request.rs b/packages/client-rust/src/models/patched_scim_source_group_request.rs deleted file mode 100644 index 10b1bb17a1..0000000000 --- a/packages/client-rust/src/models/patched_scim_source_group_request.rs +++ /dev/null @@ -1,39 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// PatchedScimSourceGroupRequest : SCIMSourceGroup Serializer -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct PatchedScimSourceGroupRequest { - #[serde(rename = "id", skip_serializing_if = "Option::is_none")] - pub id: Option, - #[serde(rename = "external_id", skip_serializing_if = "Option::is_none")] - pub external_id: Option, - #[serde(rename = "group", skip_serializing_if = "Option::is_none")] - pub group: Option, - #[serde(rename = "source", skip_serializing_if = "Option::is_none")] - pub source: Option, - #[serde(rename = "attributes", skip_serializing_if = "Option::is_none")] - pub attributes: Option>, -} - -impl PatchedScimSourceGroupRequest { - /// SCIMSourceGroup Serializer - pub fn new() -> PatchedScimSourceGroupRequest { - PatchedScimSourceGroupRequest { - id: None, - external_id: None, - group: None, - source: None, - attributes: None, - } - } -} diff --git a/packages/client-rust/src/models/patched_scim_source_property_mapping_request.rs b/packages/client-rust/src/models/patched_scim_source_property_mapping_request.rs deleted file mode 100644 index 89db56c847..0000000000 --- a/packages/client-rust/src/models/patched_scim_source_property_mapping_request.rs +++ /dev/null @@ -1,41 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// PatchedScimSourcePropertyMappingRequest : SCIMSourcePropertyMapping Serializer -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct PatchedScimSourcePropertyMappingRequest { - /// 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. - #[serde( - rename = "managed", - default, - with = "::serde_with::rust::double_option", - skip_serializing_if = "Option::is_none" - )] - pub managed: Option>, - #[serde(rename = "name", skip_serializing_if = "Option::is_none")] - pub name: Option, - #[serde(rename = "expression", skip_serializing_if = "Option::is_none")] - pub expression: Option, -} - -impl PatchedScimSourcePropertyMappingRequest { - /// SCIMSourcePropertyMapping Serializer - pub fn new() -> PatchedScimSourcePropertyMappingRequest { - PatchedScimSourcePropertyMappingRequest { - managed: None, - name: None, - expression: None, - } - } -} diff --git a/packages/client-rust/src/models/patched_scim_source_request.rs b/packages/client-rust/src/models/patched_scim_source_request.rs deleted file mode 100644 index cc3171a89a..0000000000 --- a/packages/client-rust/src/models/patched_scim_source_request.rs +++ /dev/null @@ -1,50 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// PatchedScimSourceRequest : SCIMSource Serializer -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct PatchedScimSourceRequest { - /// Source's display Name. - #[serde(rename = "name", skip_serializing_if = "Option::is_none")] - pub name: Option, - /// Internal source name, used in URLs. - #[serde(rename = "slug", skip_serializing_if = "Option::is_none")] - pub slug: Option, - #[serde(rename = "enabled", skip_serializing_if = "Option::is_none")] - pub enabled: Option, - #[serde( - rename = "user_property_mappings", - skip_serializing_if = "Option::is_none" - )] - pub user_property_mappings: Option>, - #[serde( - rename = "group_property_mappings", - skip_serializing_if = "Option::is_none" - )] - pub group_property_mappings: Option>, - #[serde(rename = "user_path_template", skip_serializing_if = "Option::is_none")] - pub user_path_template: Option, -} - -impl PatchedScimSourceRequest { - /// SCIMSource Serializer - pub fn new() -> PatchedScimSourceRequest { - PatchedScimSourceRequest { - name: None, - slug: None, - enabled: None, - user_property_mappings: None, - group_property_mappings: None, - user_path_template: None, - } - } -} diff --git a/packages/client-rust/src/models/patched_scim_source_user_request.rs b/packages/client-rust/src/models/patched_scim_source_user_request.rs deleted file mode 100644 index dcf5f4f861..0000000000 --- a/packages/client-rust/src/models/patched_scim_source_user_request.rs +++ /dev/null @@ -1,39 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// PatchedScimSourceUserRequest : SCIMSourceUser Serializer -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct PatchedScimSourceUserRequest { - #[serde(rename = "id", skip_serializing_if = "Option::is_none")] - pub id: Option, - #[serde(rename = "external_id", skip_serializing_if = "Option::is_none")] - pub external_id: Option, - #[serde(rename = "user", skip_serializing_if = "Option::is_none")] - pub user: Option, - #[serde(rename = "source", skip_serializing_if = "Option::is_none")] - pub source: Option, - #[serde(rename = "attributes", skip_serializing_if = "Option::is_none")] - pub attributes: Option>, -} - -impl PatchedScimSourceUserRequest { - /// SCIMSourceUser Serializer - pub fn new() -> PatchedScimSourceUserRequest { - PatchedScimSourceUserRequest { - id: None, - external_id: None, - user: None, - source: None, - attributes: None, - } - } -} diff --git a/packages/client-rust/src/models/patched_scope_mapping_request.rs b/packages/client-rust/src/models/patched_scope_mapping_request.rs deleted file mode 100644 index aa914b12ea..0000000000 --- a/packages/client-rust/src/models/patched_scope_mapping_request.rs +++ /dev/null @@ -1,49 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// PatchedScopeMappingRequest : ScopeMapping Serializer -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct PatchedScopeMappingRequest { - /// 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. - #[serde( - rename = "managed", - default, - with = "::serde_with::rust::double_option", - skip_serializing_if = "Option::is_none" - )] - pub managed: Option>, - #[serde(rename = "name", skip_serializing_if = "Option::is_none")] - pub name: Option, - #[serde(rename = "expression", skip_serializing_if = "Option::is_none")] - pub expression: Option, - /// Scope name requested by the client - #[serde(rename = "scope_name", skip_serializing_if = "Option::is_none")] - pub scope_name: Option, - /// Description shown to the user when consenting. If left empty, the user won't be informed. - #[serde(rename = "description", skip_serializing_if = "Option::is_none")] - pub description: Option, -} - -impl PatchedScopeMappingRequest { - /// ScopeMapping Serializer - pub fn new() -> PatchedScopeMappingRequest { - PatchedScopeMappingRequest { - managed: None, - name: None, - expression: None, - scope_name: None, - description: None, - } - } -} diff --git a/packages/client-rust/src/models/patched_settings_request.rs b/packages/client-rust/src/models/patched_settings_request.rs deleted file mode 100644 index 4dbae7d8a5..0000000000 --- a/packages/client-rust/src/models/patched_settings_request.rs +++ /dev/null @@ -1,121 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// PatchedSettingsRequest : Settings Serializer -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct PatchedSettingsRequest { - /// Configure how authentik should show avatars for users. - #[serde(rename = "avatars", skip_serializing_if = "Option::is_none")] - pub avatars: Option, - /// Enable the ability for users to change their name. - #[serde( - rename = "default_user_change_name", - skip_serializing_if = "Option::is_none" - )] - pub default_user_change_name: Option, - /// Enable the ability for users to change their email address. - #[serde( - rename = "default_user_change_email", - skip_serializing_if = "Option::is_none" - )] - pub default_user_change_email: Option, - /// Enable the ability for users to change their username. - #[serde( - rename = "default_user_change_username", - skip_serializing_if = "Option::is_none" - )] - pub default_user_change_username: Option, - /// Events will be deleted after this duration.(Format: weeks=3;days=2;hours=3,seconds=2). - #[serde(rename = "event_retention", skip_serializing_if = "Option::is_none")] - pub event_retention: Option, - /// Reputation cannot decrease lower than this value. Zero or negative. - #[serde( - rename = "reputation_lower_limit", - skip_serializing_if = "Option::is_none" - )] - pub reputation_lower_limit: Option, - /// Reputation cannot increase higher than this value. Zero or positive. - #[serde( - rename = "reputation_upper_limit", - skip_serializing_if = "Option::is_none" - )] - pub reputation_upper_limit: Option, - #[serde( - rename = "footer_links", - default, - with = "::serde_with::rust::double_option", - skip_serializing_if = "Option::is_none" - )] - pub footer_links: Option>, - /// When enabled, all the events caused by a user will be deleted upon the user's deletion. - #[serde(rename = "gdpr_compliance", skip_serializing_if = "Option::is_none")] - pub gdpr_compliance: Option, - /// Globally enable/disable impersonation. - #[serde(rename = "impersonation", skip_serializing_if = "Option::is_none")] - pub impersonation: Option, - /// Require administrators to provide a reason for impersonating a user. - #[serde( - rename = "impersonation_require_reason", - skip_serializing_if = "Option::is_none" - )] - pub impersonation_require_reason: Option, - /// Default token duration - #[serde( - rename = "default_token_duration", - skip_serializing_if = "Option::is_none" - )] - pub default_token_duration: Option, - /// Default token length - #[serde( - rename = "default_token_length", - skip_serializing_if = "Option::is_none" - )] - pub default_token_length: Option, - /// Default page size for API responses, if no size was requested. - #[serde( - rename = "pagination_default_page_size", - skip_serializing_if = "Option::is_none" - )] - pub pagination_default_page_size: Option, - /// Maximum page size - #[serde( - rename = "pagination_max_page_size", - skip_serializing_if = "Option::is_none" - )] - pub pagination_max_page_size: Option, - #[serde(rename = "flags", skip_serializing_if = "Option::is_none")] - pub flags: Option, -} - -impl PatchedSettingsRequest { - /// Settings Serializer - pub fn new() -> PatchedSettingsRequest { - PatchedSettingsRequest { - avatars: None, - default_user_change_name: None, - default_user_change_email: None, - default_user_change_username: None, - event_retention: None, - reputation_lower_limit: None, - reputation_upper_limit: None, - footer_links: None, - gdpr_compliance: None, - impersonation: None, - impersonation_require_reason: None, - default_token_duration: None, - default_token_length: None, - pagination_default_page_size: None, - pagination_max_page_size: None, - flags: None, - } - } -} diff --git a/packages/client-rust/src/models/patched_settings_request_flags.rs b/packages/client-rust/src/models/patched_settings_request_flags.rs deleted file mode 100644 index 3021d6b028..0000000000 --- a/packages/client-rust/src/models/patched_settings_request_flags.rs +++ /dev/null @@ -1,44 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct PatchedSettingsRequestFlags { - /// Configure if applications without any policy/group/user bindings should be accessible to - /// any user. - #[serde(rename = "core_default_app_access")] - pub core_default_app_access: bool, - /// Include additional information in audit logs, may incur a performance penalty. - #[serde(rename = "enterprise_audit_include_expanded_diff")] - pub enterprise_audit_include_expanded_diff: bool, - /// Upon successful authentication, re-start authentication in other open tabs. - #[serde(rename = "flows_continuous_login")] - pub flows_continuous_login: bool, - /// Refresh other tabs after successful authentication. - #[serde(rename = "flows_refresh_others")] - pub flows_refresh_others: bool, -} - -impl PatchedSettingsRequestFlags { - pub fn new( - core_default_app_access: bool, - enterprise_audit_include_expanded_diff: bool, - flows_continuous_login: bool, - flows_refresh_others: bool, - ) -> PatchedSettingsRequestFlags { - PatchedSettingsRequestFlags { - core_default_app_access, - enterprise_audit_include_expanded_diff, - flows_continuous_login, - flows_refresh_others, - } - } -} diff --git a/packages/client-rust/src/models/patched_sms_device_request.rs b/packages/client-rust/src/models/patched_sms_device_request.rs deleted file mode 100644 index 86af522441..0000000000 --- a/packages/client-rust/src/models/patched_sms_device_request.rs +++ /dev/null @@ -1,26 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// PatchedSmsDeviceRequest : Serializer for sms authenticator devices -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct PatchedSmsDeviceRequest { - /// The human-readable name of this device. - #[serde(rename = "name", skip_serializing_if = "Option::is_none")] - pub name: Option, -} - -impl PatchedSmsDeviceRequest { - /// Serializer for sms authenticator devices - pub fn new() -> PatchedSmsDeviceRequest { - PatchedSmsDeviceRequest { name: None } - } -} diff --git a/packages/client-rust/src/models/patched_source_stage_request.rs b/packages/client-rust/src/models/patched_source_stage_request.rs deleted file mode 100644 index 6c8a386b12..0000000000 --- a/packages/client-rust/src/models/patched_source_stage_request.rs +++ /dev/null @@ -1,35 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// PatchedSourceStageRequest : SourceStage Serializer -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct PatchedSourceStageRequest { - #[serde(rename = "name", skip_serializing_if = "Option::is_none")] - pub name: Option, - #[serde(rename = "source", skip_serializing_if = "Option::is_none")] - pub source: Option, - /// Amount of time a user can take to return from the source to continue the flow (Format: - /// hours=-1;minutes=-2;seconds=-3) - #[serde(rename = "resume_timeout", skip_serializing_if = "Option::is_none")] - pub resume_timeout: Option, -} - -impl PatchedSourceStageRequest { - /// SourceStage Serializer - pub fn new() -> PatchedSourceStageRequest { - PatchedSourceStageRequest { - name: None, - source: None, - resume_timeout: None, - } - } -} diff --git a/packages/client-rust/src/models/patched_ssf_provider_request.rs b/packages/client-rust/src/models/patched_ssf_provider_request.rs deleted file mode 100644 index 2b4971fb03..0000000000 --- a/packages/client-rust/src/models/patched_ssf_provider_request.rs +++ /dev/null @@ -1,46 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// PatchedSsfProviderRequest : SSFProvider Serializer -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct PatchedSsfProviderRequest { - #[serde(rename = "name", skip_serializing_if = "Option::is_none")] - pub name: Option, - /// Key used to sign the SSF Events. - #[serde(rename = "signing_key", skip_serializing_if = "Option::is_none")] - pub signing_key: Option, - #[serde( - rename = "oidc_auth_providers", - skip_serializing_if = "Option::is_none" - )] - pub oidc_auth_providers: Option>, - #[serde(rename = "event_retention", skip_serializing_if = "Option::is_none")] - pub event_retention: Option, - #[serde( - rename = "push_verify_certificates", - skip_serializing_if = "Option::is_none" - )] - pub push_verify_certificates: Option, -} - -impl PatchedSsfProviderRequest { - /// SSFProvider Serializer - pub fn new() -> PatchedSsfProviderRequest { - PatchedSsfProviderRequest { - name: None, - signing_key: None, - oidc_auth_providers: None, - event_retention: None, - push_verify_certificates: None, - } - } -} diff --git a/packages/client-rust/src/models/patched_static_device_request.rs b/packages/client-rust/src/models/patched_static_device_request.rs deleted file mode 100644 index de91dcc98e..0000000000 --- a/packages/client-rust/src/models/patched_static_device_request.rs +++ /dev/null @@ -1,26 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// PatchedStaticDeviceRequest : Serializer for static authenticator devices -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct PatchedStaticDeviceRequest { - /// The human-readable name of this device. - #[serde(rename = "name", skip_serializing_if = "Option::is_none")] - pub name: Option, -} - -impl PatchedStaticDeviceRequest { - /// Serializer for static authenticator devices - pub fn new() -> PatchedStaticDeviceRequest { - PatchedStaticDeviceRequest { name: None } - } -} diff --git a/packages/client-rust/src/models/patched_telegram_source_property_mapping_request.rs b/packages/client-rust/src/models/patched_telegram_source_property_mapping_request.rs deleted file mode 100644 index 1ed78746e4..0000000000 --- a/packages/client-rust/src/models/patched_telegram_source_property_mapping_request.rs +++ /dev/null @@ -1,41 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// PatchedTelegramSourcePropertyMappingRequest : TelegramSourcePropertyMapping Serializer -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct PatchedTelegramSourcePropertyMappingRequest { - /// 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. - #[serde( - rename = "managed", - default, - with = "::serde_with::rust::double_option", - skip_serializing_if = "Option::is_none" - )] - pub managed: Option>, - #[serde(rename = "name", skip_serializing_if = "Option::is_none")] - pub name: Option, - #[serde(rename = "expression", skip_serializing_if = "Option::is_none")] - pub expression: Option, -} - -impl PatchedTelegramSourcePropertyMappingRequest { - /// TelegramSourcePropertyMapping Serializer - pub fn new() -> PatchedTelegramSourcePropertyMappingRequest { - PatchedTelegramSourcePropertyMappingRequest { - managed: None, - name: None, - expression: None, - } - } -} diff --git a/packages/client-rust/src/models/patched_telegram_source_request.rs b/packages/client-rust/src/models/patched_telegram_source_request.rs deleted file mode 100644 index f79e431515..0000000000 --- a/packages/client-rust/src/models/patched_telegram_source_request.rs +++ /dev/null @@ -1,106 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// PatchedTelegramSourceRequest : Source Serializer -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct PatchedTelegramSourceRequest { - /// Source's display Name. - #[serde(rename = "name", skip_serializing_if = "Option::is_none")] - pub name: Option, - /// Internal source name, used in URLs. - #[serde(rename = "slug", skip_serializing_if = "Option::is_none")] - pub slug: Option, - #[serde(rename = "enabled", skip_serializing_if = "Option::is_none")] - pub enabled: Option, - /// When enabled, this source will be displayed as a prominent button on the login page, - /// instead of a small icon. - #[serde(rename = "promoted", skip_serializing_if = "Option::is_none")] - pub promoted: Option, - /// Flow to use when authenticating existing users. - #[serde( - rename = "authentication_flow", - default, - with = "::serde_with::rust::double_option", - skip_serializing_if = "Option::is_none" - )] - pub authentication_flow: Option>, - /// Flow to use when enrolling new users. - #[serde( - rename = "enrollment_flow", - default, - with = "::serde_with::rust::double_option", - skip_serializing_if = "Option::is_none" - )] - pub enrollment_flow: Option>, - #[serde( - rename = "user_property_mappings", - skip_serializing_if = "Option::is_none" - )] - pub user_property_mappings: Option>, - #[serde( - rename = "group_property_mappings", - skip_serializing_if = "Option::is_none" - )] - pub group_property_mappings: Option>, - #[serde(rename = "policy_engine_mode", skip_serializing_if = "Option::is_none")] - pub policy_engine_mode: Option, - /// How the source determines if an existing user should be authenticated or a new user - /// enrolled. - #[serde(rename = "user_matching_mode", skip_serializing_if = "Option::is_none")] - pub user_matching_mode: Option, - #[serde(rename = "user_path_template", skip_serializing_if = "Option::is_none")] - pub user_path_template: Option, - #[serde(rename = "icon", skip_serializing_if = "Option::is_none")] - pub icon: Option, - /// Telegram bot username - #[serde(rename = "bot_username", skip_serializing_if = "Option::is_none")] - pub bot_username: Option, - /// Telegram bot token - #[serde(rename = "bot_token", skip_serializing_if = "Option::is_none")] - pub bot_token: Option, - /// Request access to send messages from your bot. - #[serde( - rename = "request_message_access", - skip_serializing_if = "Option::is_none" - )] - pub request_message_access: Option, - /// Flow used before authentication. - #[serde( - rename = "pre_authentication_flow", - skip_serializing_if = "Option::is_none" - )] - pub pre_authentication_flow: Option, -} - -impl PatchedTelegramSourceRequest { - /// Source Serializer - pub fn new() -> PatchedTelegramSourceRequest { - PatchedTelegramSourceRequest { - name: None, - slug: None, - enabled: None, - promoted: None, - authentication_flow: None, - enrollment_flow: None, - user_property_mappings: None, - group_property_mappings: None, - policy_engine_mode: None, - user_matching_mode: None, - user_path_template: None, - icon: None, - bot_username: None, - bot_token: None, - request_message_access: None, - pre_authentication_flow: None, - } - } -} diff --git a/packages/client-rust/src/models/patched_tenant_request.rs b/packages/client-rust/src/models/patched_tenant_request.rs deleted file mode 100644 index 9f0f0ee22e..0000000000 --- a/packages/client-rust/src/models/patched_tenant_request.rs +++ /dev/null @@ -1,33 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// PatchedTenantRequest : Tenant Serializer -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct PatchedTenantRequest { - #[serde(rename = "schema_name", skip_serializing_if = "Option::is_none")] - pub schema_name: Option, - #[serde(rename = "name", skip_serializing_if = "Option::is_none")] - pub name: Option, - #[serde(rename = "ready", skip_serializing_if = "Option::is_none")] - pub ready: Option, -} - -impl PatchedTenantRequest { - /// Tenant Serializer - pub fn new() -> PatchedTenantRequest { - PatchedTenantRequest { - schema_name: None, - name: None, - ready: None, - } - } -} diff --git a/packages/client-rust/src/models/patched_token_request.rs b/packages/client-rust/src/models/patched_token_request.rs deleted file mode 100644 index 34d780738c..0000000000 --- a/packages/client-rust/src/models/patched_token_request.rs +++ /dev/null @@ -1,58 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// PatchedTokenRequest : Token Serializer -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct PatchedTokenRequest { - /// 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. - #[serde( - rename = "managed", - default, - with = "::serde_with::rust::double_option", - skip_serializing_if = "Option::is_none" - )] - pub managed: Option>, - #[serde(rename = "identifier", skip_serializing_if = "Option::is_none")] - pub identifier: Option, - #[serde(rename = "intent", skip_serializing_if = "Option::is_none")] - pub intent: Option, - #[serde(rename = "user", skip_serializing_if = "Option::is_none")] - pub user: Option, - #[serde(rename = "description", skip_serializing_if = "Option::is_none")] - pub description: Option, - #[serde( - rename = "expires", - default, - with = "::serde_with::rust::double_option", - skip_serializing_if = "Option::is_none" - )] - pub expires: Option>, - #[serde(rename = "expiring", skip_serializing_if = "Option::is_none")] - pub expiring: Option, -} - -impl PatchedTokenRequest { - /// Token Serializer - pub fn new() -> PatchedTokenRequest { - PatchedTokenRequest { - managed: None, - identifier: None, - intent: None, - user: None, - description: None, - expires: None, - expiring: None, - } - } -} diff --git a/packages/client-rust/src/models/patched_totp_device_request.rs b/packages/client-rust/src/models/patched_totp_device_request.rs deleted file mode 100644 index d724a7122c..0000000000 --- a/packages/client-rust/src/models/patched_totp_device_request.rs +++ /dev/null @@ -1,26 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// PatchedTotpDeviceRequest : Serializer for totp authenticator devices -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct PatchedTotpDeviceRequest { - /// The human-readable name of this device. - #[serde(rename = "name", skip_serializing_if = "Option::is_none")] - pub name: Option, -} - -impl PatchedTotpDeviceRequest { - /// Serializer for totp authenticator devices - pub fn new() -> PatchedTotpDeviceRequest { - PatchedTotpDeviceRequest { name: None } - } -} diff --git a/packages/client-rust/src/models/patched_unique_password_policy_request.rs b/packages/client-rust/src/models/patched_unique_password_policy_request.rs deleted file mode 100644 index 2c88cb707b..0000000000 --- a/packages/client-rust/src/models/patched_unique_password_policy_request.rs +++ /dev/null @@ -1,43 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// PatchedUniquePasswordPolicyRequest : Password Uniqueness Policy Serializer -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct PatchedUniquePasswordPolicyRequest { - #[serde(rename = "name", skip_serializing_if = "Option::is_none")] - pub name: Option, - /// When this option is enabled, all executions of this policy will be logged. By default, only - /// execution errors are logged. - #[serde(rename = "execution_logging", skip_serializing_if = "Option::is_none")] - pub execution_logging: Option, - /// Field key to check, field keys defined in Prompt stages are available. - #[serde(rename = "password_field", skip_serializing_if = "Option::is_none")] - pub password_field: Option, - /// Number of passwords to check against. - #[serde( - rename = "num_historical_passwords", - skip_serializing_if = "Option::is_none" - )] - pub num_historical_passwords: Option, -} - -impl PatchedUniquePasswordPolicyRequest { - /// Password Uniqueness Policy Serializer - pub fn new() -> PatchedUniquePasswordPolicyRequest { - PatchedUniquePasswordPolicyRequest { - name: None, - execution_logging: None, - password_field: None, - num_historical_passwords: None, - } - } -} diff --git a/packages/client-rust/src/models/patched_user_delete_stage_request.rs b/packages/client-rust/src/models/patched_user_delete_stage_request.rs deleted file mode 100644 index a7fe826672..0000000000 --- a/packages/client-rust/src/models/patched_user_delete_stage_request.rs +++ /dev/null @@ -1,25 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// PatchedUserDeleteStageRequest : UserDeleteStage Serializer -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct PatchedUserDeleteStageRequest { - #[serde(rename = "name", skip_serializing_if = "Option::is_none")] - pub name: Option, -} - -impl PatchedUserDeleteStageRequest { - /// UserDeleteStage Serializer - pub fn new() -> PatchedUserDeleteStageRequest { - PatchedUserDeleteStageRequest { name: None } - } -} diff --git a/packages/client-rust/src/models/patched_user_kerberos_source_connection_request.rs b/packages/client-rust/src/models/patched_user_kerberos_source_connection_request.rs deleted file mode 100644 index 00b2c1e14e..0000000000 --- a/packages/client-rust/src/models/patched_user_kerberos_source_connection_request.rs +++ /dev/null @@ -1,33 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// PatchedUserKerberosSourceConnectionRequest : User source connection -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct PatchedUserKerberosSourceConnectionRequest { - #[serde(rename = "user", skip_serializing_if = "Option::is_none")] - pub user: Option, - #[serde(rename = "source", skip_serializing_if = "Option::is_none")] - pub source: Option, - #[serde(rename = "identifier", skip_serializing_if = "Option::is_none")] - pub identifier: Option, -} - -impl PatchedUserKerberosSourceConnectionRequest { - /// User source connection - pub fn new() -> PatchedUserKerberosSourceConnectionRequest { - PatchedUserKerberosSourceConnectionRequest { - user: None, - source: None, - identifier: None, - } - } -} diff --git a/packages/client-rust/src/models/patched_user_ldap_source_connection_request.rs b/packages/client-rust/src/models/patched_user_ldap_source_connection_request.rs deleted file mode 100644 index b7cef53a0c..0000000000 --- a/packages/client-rust/src/models/patched_user_ldap_source_connection_request.rs +++ /dev/null @@ -1,33 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// PatchedUserLdapSourceConnectionRequest : User source connection -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct PatchedUserLdapSourceConnectionRequest { - #[serde(rename = "user", skip_serializing_if = "Option::is_none")] - pub user: Option, - #[serde(rename = "source", skip_serializing_if = "Option::is_none")] - pub source: Option, - #[serde(rename = "identifier", skip_serializing_if = "Option::is_none")] - pub identifier: Option, -} - -impl PatchedUserLdapSourceConnectionRequest { - /// User source connection - pub fn new() -> PatchedUserLdapSourceConnectionRequest { - PatchedUserLdapSourceConnectionRequest { - user: None, - source: None, - identifier: None, - } - } -} diff --git a/packages/client-rust/src/models/patched_user_login_stage_request.rs b/packages/client-rust/src/models/patched_user_login_stage_request.rs deleted file mode 100644 index 943c6a612d..0000000000 --- a/packages/client-rust/src/models/patched_user_login_stage_request.rs +++ /dev/null @@ -1,58 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// PatchedUserLoginStageRequest : UserLoginStage Serializer -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct PatchedUserLoginStageRequest { - #[serde(rename = "name", skip_serializing_if = "Option::is_none")] - pub name: Option, - /// 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) - #[serde(rename = "session_duration", skip_serializing_if = "Option::is_none")] - pub session_duration: Option, - /// Terminate all other sessions of the user logging in. - #[serde( - rename = "terminate_other_sessions", - skip_serializing_if = "Option::is_none" - )] - pub terminate_other_sessions: Option, - /// 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) - #[serde(rename = "remember_me_offset", skip_serializing_if = "Option::is_none")] - pub remember_me_offset: Option, - /// Bind sessions created by this stage to the configured network - #[serde(rename = "network_binding", skip_serializing_if = "Option::is_none")] - pub network_binding: Option, - /// Bind sessions created by this stage to the configured GeoIP location - #[serde(rename = "geoip_binding", skip_serializing_if = "Option::is_none")] - pub geoip_binding: Option, - /// 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) - #[serde(rename = "remember_device", skip_serializing_if = "Option::is_none")] - pub remember_device: Option, -} - -impl PatchedUserLoginStageRequest { - /// UserLoginStage Serializer - pub fn new() -> PatchedUserLoginStageRequest { - PatchedUserLoginStageRequest { - name: None, - session_duration: None, - terminate_other_sessions: None, - remember_me_offset: None, - network_binding: None, - geoip_binding: None, - remember_device: None, - } - } -} diff --git a/packages/client-rust/src/models/patched_user_logout_stage_request.rs b/packages/client-rust/src/models/patched_user_logout_stage_request.rs deleted file mode 100644 index d056b85a87..0000000000 --- a/packages/client-rust/src/models/patched_user_logout_stage_request.rs +++ /dev/null @@ -1,25 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// PatchedUserLogoutStageRequest : UserLogoutStage Serializer -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct PatchedUserLogoutStageRequest { - #[serde(rename = "name", skip_serializing_if = "Option::is_none")] - pub name: Option, -} - -impl PatchedUserLogoutStageRequest { - /// UserLogoutStage Serializer - pub fn new() -> PatchedUserLogoutStageRequest { - PatchedUserLogoutStageRequest { name: None } - } -} diff --git a/packages/client-rust/src/models/patched_user_o_auth_source_connection_request.rs b/packages/client-rust/src/models/patched_user_o_auth_source_connection_request.rs deleted file mode 100644 index d55ce43a41..0000000000 --- a/packages/client-rust/src/models/patched_user_o_auth_source_connection_request.rs +++ /dev/null @@ -1,44 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// PatchedUserOAuthSourceConnectionRequest : User source connection -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct PatchedUserOAuthSourceConnectionRequest { - #[serde(rename = "user", skip_serializing_if = "Option::is_none")] - pub user: Option, - #[serde(rename = "source", skip_serializing_if = "Option::is_none")] - pub source: Option, - #[serde(rename = "identifier", skip_serializing_if = "Option::is_none")] - pub identifier: Option, - #[serde( - rename = "access_token", - default, - with = "::serde_with::rust::double_option", - skip_serializing_if = "Option::is_none" - )] - pub access_token: Option>, - #[serde(rename = "expires", skip_serializing_if = "Option::is_none")] - pub expires: Option, -} - -impl PatchedUserOAuthSourceConnectionRequest { - /// User source connection - pub fn new() -> PatchedUserOAuthSourceConnectionRequest { - PatchedUserOAuthSourceConnectionRequest { - user: None, - source: None, - identifier: None, - access_token: None, - expires: None, - } - } -} diff --git a/packages/client-rust/src/models/patched_user_plex_source_connection_request.rs b/packages/client-rust/src/models/patched_user_plex_source_connection_request.rs deleted file mode 100644 index d96eff930d..0000000000 --- a/packages/client-rust/src/models/patched_user_plex_source_connection_request.rs +++ /dev/null @@ -1,36 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// PatchedUserPlexSourceConnectionRequest : User source connection -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct PatchedUserPlexSourceConnectionRequest { - #[serde(rename = "user", skip_serializing_if = "Option::is_none")] - pub user: Option, - #[serde(rename = "source", skip_serializing_if = "Option::is_none")] - pub source: Option, - #[serde(rename = "identifier", skip_serializing_if = "Option::is_none")] - pub identifier: Option, - #[serde(rename = "plex_token", skip_serializing_if = "Option::is_none")] - pub plex_token: Option, -} - -impl PatchedUserPlexSourceConnectionRequest { - /// User source connection - pub fn new() -> PatchedUserPlexSourceConnectionRequest { - PatchedUserPlexSourceConnectionRequest { - user: None, - source: None, - identifier: None, - plex_token: None, - } - } -} diff --git a/packages/client-rust/src/models/patched_user_request.rs b/packages/client-rust/src/models/patched_user_request.rs deleted file mode 100644 index fa9d14e486..0000000000 --- a/packages/client-rust/src/models/patched_user_request.rs +++ /dev/null @@ -1,62 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// PatchedUserRequest : User Serializer -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct PatchedUserRequest { - #[serde(rename = "username", skip_serializing_if = "Option::is_none")] - pub username: Option, - /// User's display name. - #[serde(rename = "name", skip_serializing_if = "Option::is_none")] - pub name: Option, - /// Designates whether this user should be treated as active. Unselect this instead of deleting - /// accounts. - #[serde(rename = "is_active", skip_serializing_if = "Option::is_none")] - pub is_active: Option, - #[serde( - rename = "last_login", - default, - with = "::serde_with::rust::double_option", - skip_serializing_if = "Option::is_none" - )] - pub last_login: Option>, - #[serde(rename = "groups", skip_serializing_if = "Option::is_none")] - pub groups: Option>, - #[serde(rename = "roles", skip_serializing_if = "Option::is_none")] - pub roles: Option>, - #[serde(rename = "email", skip_serializing_if = "Option::is_none")] - pub email: Option, - #[serde(rename = "attributes", skip_serializing_if = "Option::is_none")] - pub attributes: Option>, - #[serde(rename = "path", skip_serializing_if = "Option::is_none")] - pub path: Option, - #[serde(rename = "type", skip_serializing_if = "Option::is_none")] - pub r#type: Option, -} - -impl PatchedUserRequest { - /// User Serializer - pub fn new() -> PatchedUserRequest { - PatchedUserRequest { - username: None, - name: None, - is_active: None, - last_login: None, - groups: None, - roles: None, - email: None, - attributes: None, - path: None, - r#type: None, - } - } -} diff --git a/packages/client-rust/src/models/patched_user_saml_source_connection_request.rs b/packages/client-rust/src/models/patched_user_saml_source_connection_request.rs deleted file mode 100644 index 5cc5df0f2e..0000000000 --- a/packages/client-rust/src/models/patched_user_saml_source_connection_request.rs +++ /dev/null @@ -1,33 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// PatchedUserSamlSourceConnectionRequest : User source connection -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct PatchedUserSamlSourceConnectionRequest { - #[serde(rename = "user", skip_serializing_if = "Option::is_none")] - pub user: Option, - #[serde(rename = "source", skip_serializing_if = "Option::is_none")] - pub source: Option, - #[serde(rename = "identifier", skip_serializing_if = "Option::is_none")] - pub identifier: Option, -} - -impl PatchedUserSamlSourceConnectionRequest { - /// User source connection - pub fn new() -> PatchedUserSamlSourceConnectionRequest { - PatchedUserSamlSourceConnectionRequest { - user: None, - source: None, - identifier: None, - } - } -} diff --git a/packages/client-rust/src/models/patched_user_source_connection_request.rs b/packages/client-rust/src/models/patched_user_source_connection_request.rs deleted file mode 100644 index 34357dffad..0000000000 --- a/packages/client-rust/src/models/patched_user_source_connection_request.rs +++ /dev/null @@ -1,33 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// PatchedUserSourceConnectionRequest : User source connection -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct PatchedUserSourceConnectionRequest { - #[serde(rename = "user", skip_serializing_if = "Option::is_none")] - pub user: Option, - #[serde(rename = "source", skip_serializing_if = "Option::is_none")] - pub source: Option, - #[serde(rename = "identifier", skip_serializing_if = "Option::is_none")] - pub identifier: Option, -} - -impl PatchedUserSourceConnectionRequest { - /// User source connection - pub fn new() -> PatchedUserSourceConnectionRequest { - PatchedUserSourceConnectionRequest { - user: None, - source: None, - identifier: None, - } - } -} diff --git a/packages/client-rust/src/models/patched_user_telegram_source_connection_request.rs b/packages/client-rust/src/models/patched_user_telegram_source_connection_request.rs deleted file mode 100644 index 812561d84b..0000000000 --- a/packages/client-rust/src/models/patched_user_telegram_source_connection_request.rs +++ /dev/null @@ -1,33 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// PatchedUserTelegramSourceConnectionRequest : User source connection -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct PatchedUserTelegramSourceConnectionRequest { - #[serde(rename = "user", skip_serializing_if = "Option::is_none")] - pub user: Option, - #[serde(rename = "source", skip_serializing_if = "Option::is_none")] - pub source: Option, - #[serde(rename = "identifier", skip_serializing_if = "Option::is_none")] - pub identifier: Option, -} - -impl PatchedUserTelegramSourceConnectionRequest { - /// User source connection - pub fn new() -> PatchedUserTelegramSourceConnectionRequest { - PatchedUserTelegramSourceConnectionRequest { - user: None, - source: None, - identifier: None, - } - } -} diff --git a/packages/client-rust/src/models/patched_user_write_stage_request.rs b/packages/client-rust/src/models/patched_user_write_stage_request.rs deleted file mode 100644 index b9b79ce3bc..0000000000 --- a/packages/client-rust/src/models/patched_user_write_stage_request.rs +++ /dev/null @@ -1,52 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// PatchedUserWriteStageRequest : UserWriteStage Serializer -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct PatchedUserWriteStageRequest { - #[serde(rename = "name", skip_serializing_if = "Option::is_none")] - pub name: Option, - #[serde(rename = "user_creation_mode", skip_serializing_if = "Option::is_none")] - pub user_creation_mode: Option, - /// When set, newly created users are inactive and cannot login. - #[serde( - rename = "create_users_as_inactive", - skip_serializing_if = "Option::is_none" - )] - pub create_users_as_inactive: Option, - /// Optionally add newly created users to this group. - #[serde( - rename = "create_users_group", - default, - with = "::serde_with::rust::double_option", - skip_serializing_if = "Option::is_none" - )] - pub create_users_group: Option>, - #[serde(rename = "user_type", skip_serializing_if = "Option::is_none")] - pub user_type: Option, - #[serde(rename = "user_path_template", skip_serializing_if = "Option::is_none")] - pub user_path_template: Option, -} - -impl PatchedUserWriteStageRequest { - /// UserWriteStage Serializer - pub fn new() -> PatchedUserWriteStageRequest { - PatchedUserWriteStageRequest { - name: None, - user_creation_mode: None, - create_users_as_inactive: None, - create_users_group: None, - user_type: None, - user_path_template: None, - } - } -} diff --git a/packages/client-rust/src/models/patched_web_authn_device_request.rs b/packages/client-rust/src/models/patched_web_authn_device_request.rs deleted file mode 100644 index 3590f21352..0000000000 --- a/packages/client-rust/src/models/patched_web_authn_device_request.rs +++ /dev/null @@ -1,25 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// PatchedWebAuthnDeviceRequest : Serializer for WebAuthn authenticator devices -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct PatchedWebAuthnDeviceRequest { - #[serde(rename = "name", skip_serializing_if = "Option::is_none")] - pub name: Option, -} - -impl PatchedWebAuthnDeviceRequest { - /// Serializer for WebAuthn authenticator devices - pub fn new() -> PatchedWebAuthnDeviceRequest { - PatchedWebAuthnDeviceRequest { name: None } - } -} diff --git a/packages/client-rust/src/models/patched_ws_federation_provider_request.rs b/packages/client-rust/src/models/patched_ws_federation_provider_request.rs deleted file mode 100644 index d0a2e5bb6f..0000000000 --- a/packages/client-rust/src/models/patched_ws_federation_provider_request.rs +++ /dev/null @@ -1,142 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// PatchedWsFederationProviderRequest : WSFederationProvider Serializer -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct PatchedWsFederationProviderRequest { - #[serde(rename = "name", skip_serializing_if = "Option::is_none")] - pub name: Option, - /// Flow used for authentication when the associated application is accessed by an - /// un-authenticated user. - #[serde( - rename = "authentication_flow", - default, - with = "::serde_with::rust::double_option", - skip_serializing_if = "Option::is_none" - )] - pub authentication_flow: Option>, - /// Flow used when authorizing this provider. - #[serde(rename = "authorization_flow", skip_serializing_if = "Option::is_none")] - pub authorization_flow: Option, - /// Flow used ending the session from a provider. - #[serde(rename = "invalidation_flow", skip_serializing_if = "Option::is_none")] - pub invalidation_flow: Option, - #[serde(rename = "property_mappings", skip_serializing_if = "Option::is_none")] - pub property_mappings: Option>, - #[serde(rename = "reply_url", skip_serializing_if = "Option::is_none")] - pub reply_url: Option, - #[serde(rename = "wtrealm", skip_serializing_if = "Option::is_none")] - pub wtrealm: Option, - /// Assertion valid not before current time + this value (Format: - /// hours=-1;minutes=-2;seconds=-3). - #[serde( - rename = "assertion_valid_not_before", - skip_serializing_if = "Option::is_none" - )] - pub assertion_valid_not_before: Option, - /// Assertion not valid on or after current time + this value (Format: - /// hours=1;minutes=2;seconds=3). - #[serde( - rename = "assertion_valid_not_on_or_after", - skip_serializing_if = "Option::is_none" - )] - pub assertion_valid_not_on_or_after: Option, - /// Session not valid on or after current time + this value (Format: - /// hours=1;minutes=2;seconds=3). - #[serde( - rename = "session_valid_not_on_or_after", - skip_serializing_if = "Option::is_none" - )] - pub session_valid_not_on_or_after: Option, - /// Configure how the NameID value will be created. When left empty, the NameIDPolicy of the - /// incoming request will be considered - #[serde( - rename = "name_id_mapping", - default, - with = "::serde_with::rust::double_option", - skip_serializing_if = "Option::is_none" - )] - pub name_id_mapping: Option>, - /// 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. - #[serde( - rename = "authn_context_class_ref_mapping", - default, - with = "::serde_with::rust::double_option", - skip_serializing_if = "Option::is_none" - )] - pub authn_context_class_ref_mapping: Option>, - #[serde(rename = "digest_algorithm", skip_serializing_if = "Option::is_none")] - pub digest_algorithm: Option, - #[serde( - rename = "signature_algorithm", - skip_serializing_if = "Option::is_none" - )] - pub signature_algorithm: Option, - /// Keypair used to sign outgoing Responses going to the Service Provider. - #[serde( - rename = "signing_kp", - default, - with = "::serde_with::rust::double_option", - skip_serializing_if = "Option::is_none" - )] - pub signing_kp: Option>, - /// 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. - #[serde( - rename = "encryption_kp", - default, - with = "::serde_with::rust::double_option", - skip_serializing_if = "Option::is_none" - )] - pub encryption_kp: Option>, - #[serde(rename = "sign_assertion", skip_serializing_if = "Option::is_none")] - pub sign_assertion: Option, - #[serde( - rename = "sign_logout_request", - skip_serializing_if = "Option::is_none" - )] - pub sign_logout_request: Option, - #[serde( - rename = "default_name_id_policy", - skip_serializing_if = "Option::is_none" - )] - pub default_name_id_policy: Option, -} - -impl PatchedWsFederationProviderRequest { - /// WSFederationProvider Serializer - pub fn new() -> PatchedWsFederationProviderRequest { - PatchedWsFederationProviderRequest { - name: None, - authentication_flow: None, - authorization_flow: None, - invalidation_flow: None, - property_mappings: None, - reply_url: None, - wtrealm: None, - assertion_valid_not_before: None, - assertion_valid_not_on_or_after: None, - session_valid_not_on_or_after: None, - name_id_mapping: None, - authn_context_class_ref_mapping: None, - digest_algorithm: None, - signature_algorithm: None, - signing_kp: None, - encryption_kp: None, - sign_assertion: None, - sign_logout_request: None, - default_name_id_policy: None, - } - } -} diff --git a/packages/client-rust/src/models/permission.rs b/packages/client-rust/src/models/permission.rs deleted file mode 100644 index 29e3433bd3..0000000000 --- a/packages/client-rust/src/models/permission.rs +++ /dev/null @@ -1,55 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// Permission : Global permission -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct Permission { - #[serde(rename = "id")] - pub id: i32, - #[serde(rename = "name")] - pub name: String, - #[serde(rename = "codename")] - pub codename: String, - #[serde(rename = "model")] - pub model: String, - #[serde(rename = "app_label")] - pub app_label: String, - /// Human-readable app label - #[serde(rename = "app_label_verbose")] - pub app_label_verbose: String, - /// Human-readable model name - #[serde(rename = "model_verbose")] - pub model_verbose: String, -} - -impl Permission { - /// Global permission - pub fn new( - id: i32, - name: String, - codename: String, - model: String, - app_label: String, - app_label_verbose: String, - model_verbose: String, - ) -> Permission { - Permission { - id, - name, - codename, - model, - app_label, - app_label_verbose, - model_verbose, - } - } -} diff --git a/packages/client-rust/src/models/permission_assign_request.rs b/packages/client-rust/src/models/permission_assign_request.rs deleted file mode 100644 index 81e335345a..0000000000 --- a/packages/client-rust/src/models/permission_assign_request.rs +++ /dev/null @@ -1,33 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// PermissionAssignRequest : Request to assign a new permission -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct PermissionAssignRequest { - #[serde(rename = "permissions")] - pub permissions: Vec, - #[serde(rename = "model", skip_serializing_if = "Option::is_none")] - pub model: Option, - #[serde(rename = "object_pk", skip_serializing_if = "Option::is_none")] - pub object_pk: Option, -} - -impl PermissionAssignRequest { - /// Request to assign a new permission - pub fn new(permissions: Vec) -> PermissionAssignRequest { - PermissionAssignRequest { - permissions, - model: None, - object_pk: None, - } - } -} diff --git a/packages/client-rust/src/models/permission_assign_result.rs b/packages/client-rust/src/models/permission_assign_result.rs deleted file mode 100644 index bec2386884..0000000000 --- a/packages/client-rust/src/models/permission_assign_result.rs +++ /dev/null @@ -1,25 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// PermissionAssignResult : Result from assigning permissions to a user/role -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct PermissionAssignResult { - #[serde(rename = "id")] - pub id: String, -} - -impl PermissionAssignResult { - /// Result from assigning permissions to a user/role - pub fn new(id: String) -> PermissionAssignResult { - PermissionAssignResult { id } - } -} diff --git a/packages/client-rust/src/models/pkce_method_enum.rs b/packages/client-rust/src/models/pkce_method_enum.rs deleted file mode 100644 index 09cb7813d0..0000000000 --- a/packages/client-rust/src/models/pkce_method_enum.rs +++ /dev/null @@ -1,38 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// -#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] -pub enum PkceMethodEnum { - #[serde(rename = "none")] - None, - #[serde(rename = "plain")] - Plain, - #[serde(rename = "S256")] - S256, -} - -impl std::fmt::Display for PkceMethodEnum { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - match self { - Self::None => write!(f, "none"), - Self::Plain => write!(f, "plain"), - Self::S256 => write!(f, "S256"), - } - } -} - -impl Default for PkceMethodEnum { - fn default() -> PkceMethodEnum { - Self::None - } -} diff --git a/packages/client-rust/src/models/plex_source.rs b/packages/client-rust/src/models/plex_source.rs deleted file mode 100644 index 8510534402..0000000000 --- a/packages/client-rust/src/models/plex_source.rs +++ /dev/null @@ -1,151 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// PlexSource : Plex Source Serializer -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct PlexSource { - #[serde(rename = "pk")] - pub pk: uuid::Uuid, - /// Source's display Name. - #[serde(rename = "name")] - pub name: String, - /// Internal source name, used in URLs. - #[serde(rename = "slug")] - pub slug: String, - #[serde(rename = "enabled", skip_serializing_if = "Option::is_none")] - pub enabled: Option, - /// When enabled, this source will be displayed as a prominent button on the login page, - /// instead of a small icon. - #[serde(rename = "promoted", skip_serializing_if = "Option::is_none")] - pub promoted: Option, - /// Flow to use when authenticating existing users. - #[serde( - rename = "authentication_flow", - default, - with = "::serde_with::rust::double_option", - skip_serializing_if = "Option::is_none" - )] - pub authentication_flow: Option>, - /// Flow to use when enrolling new users. - #[serde( - rename = "enrollment_flow", - default, - with = "::serde_with::rust::double_option", - skip_serializing_if = "Option::is_none" - )] - pub enrollment_flow: Option>, - #[serde( - rename = "user_property_mappings", - skip_serializing_if = "Option::is_none" - )] - pub user_property_mappings: Option>, - #[serde( - rename = "group_property_mappings", - skip_serializing_if = "Option::is_none" - )] - pub group_property_mappings: Option>, - /// Get object component so that we know how to edit the object - #[serde(rename = "component")] - pub component: String, - /// Return object's verbose_name - #[serde(rename = "verbose_name")] - pub verbose_name: String, - /// Return object's plural verbose_name - #[serde(rename = "verbose_name_plural")] - pub verbose_name_plural: String, - /// Return internal model name - #[serde(rename = "meta_model_name")] - pub meta_model_name: String, - #[serde(rename = "policy_engine_mode", skip_serializing_if = "Option::is_none")] - pub policy_engine_mode: Option, - /// How the source determines if an existing user should be authenticated or a new user - /// enrolled. - #[serde(rename = "user_matching_mode", skip_serializing_if = "Option::is_none")] - pub user_matching_mode: Option, - /// 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. - #[serde(rename = "managed", deserialize_with = "Option::deserialize")] - pub managed: Option, - #[serde(rename = "user_path_template", skip_serializing_if = "Option::is_none")] - pub user_path_template: Option, - #[serde(rename = "icon", skip_serializing_if = "Option::is_none")] - pub icon: Option, - #[serde(rename = "icon_url")] - pub icon_url: String, - #[serde(rename = "icon_themed_urls", deserialize_with = "Option::deserialize")] - pub icon_themed_urls: Option, - /// How the source determines if an existing group should be used or a new group created. - #[serde( - rename = "group_matching_mode", - skip_serializing_if = "Option::is_none" - )] - pub group_matching_mode: Option, - /// Client identifier used to talk to Plex. - #[serde(rename = "client_id", skip_serializing_if = "Option::is_none")] - pub client_id: Option, - /// Which servers a user has to be a member of to be granted access. Empty list allows every - /// server. - #[serde(rename = "allowed_servers", skip_serializing_if = "Option::is_none")] - pub allowed_servers: Option>, - /// Allow friends to authenticate, even if you don't share a server. - #[serde(rename = "allow_friends", skip_serializing_if = "Option::is_none")] - pub allow_friends: Option, - /// Plex token used to check friends - #[serde(rename = "plex_token")] - pub plex_token: String, -} - -impl PlexSource { - /// Plex Source Serializer - pub fn new( - pk: uuid::Uuid, - name: String, - slug: String, - component: String, - verbose_name: String, - verbose_name_plural: String, - meta_model_name: String, - managed: Option, - icon_url: String, - icon_themed_urls: Option, - plex_token: String, - ) -> PlexSource { - PlexSource { - pk, - name, - slug, - enabled: None, - promoted: None, - authentication_flow: None, - enrollment_flow: None, - user_property_mappings: None, - group_property_mappings: None, - component, - verbose_name, - verbose_name_plural, - meta_model_name, - policy_engine_mode: None, - user_matching_mode: None, - managed, - user_path_template: None, - icon: None, - icon_url, - icon_themed_urls, - group_matching_mode: None, - client_id: None, - allowed_servers: None, - allow_friends: None, - plex_token, - } - } -} diff --git a/packages/client-rust/src/models/plex_source_property_mapping.rs b/packages/client-rust/src/models/plex_source_property_mapping.rs deleted file mode 100644 index 553496424e..0000000000 --- a/packages/client-rust/src/models/plex_source_property_mapping.rs +++ /dev/null @@ -1,68 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// PlexSourcePropertyMapping : PlexSourcePropertyMapping Serializer -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct PlexSourcePropertyMapping { - #[serde(rename = "pk")] - pub pk: uuid::Uuid, - /// 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. - #[serde( - rename = "managed", - default, - with = "::serde_with::rust::double_option", - skip_serializing_if = "Option::is_none" - )] - pub managed: Option>, - #[serde(rename = "name")] - pub name: String, - #[serde(rename = "expression")] - pub expression: String, - /// Get object's component so that we know how to edit the object - #[serde(rename = "component")] - pub component: String, - /// Return object's verbose_name - #[serde(rename = "verbose_name")] - pub verbose_name: String, - /// Return object's plural verbose_name - #[serde(rename = "verbose_name_plural")] - pub verbose_name_plural: String, - /// Return internal model name - #[serde(rename = "meta_model_name")] - pub meta_model_name: String, -} - -impl PlexSourcePropertyMapping { - /// PlexSourcePropertyMapping Serializer - pub fn new( - pk: uuid::Uuid, - name: String, - expression: String, - component: String, - verbose_name: String, - verbose_name_plural: String, - meta_model_name: String, - ) -> PlexSourcePropertyMapping { - PlexSourcePropertyMapping { - pk, - managed: None, - name, - expression, - component, - verbose_name, - verbose_name_plural, - meta_model_name, - } - } -} diff --git a/packages/client-rust/src/models/plex_source_property_mapping_request.rs b/packages/client-rust/src/models/plex_source_property_mapping_request.rs deleted file mode 100644 index 71370c83e3..0000000000 --- a/packages/client-rust/src/models/plex_source_property_mapping_request.rs +++ /dev/null @@ -1,41 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// PlexSourcePropertyMappingRequest : PlexSourcePropertyMapping Serializer -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct PlexSourcePropertyMappingRequest { - /// 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. - #[serde( - rename = "managed", - default, - with = "::serde_with::rust::double_option", - skip_serializing_if = "Option::is_none" - )] - pub managed: Option>, - #[serde(rename = "name")] - pub name: String, - #[serde(rename = "expression")] - pub expression: String, -} - -impl PlexSourcePropertyMappingRequest { - /// PlexSourcePropertyMapping Serializer - pub fn new(name: String, expression: String) -> PlexSourcePropertyMappingRequest { - PlexSourcePropertyMappingRequest { - managed: None, - name, - expression, - } - } -} diff --git a/packages/client-rust/src/models/plex_source_request.rs b/packages/client-rust/src/models/plex_source_request.rs deleted file mode 100644 index 23354507c5..0000000000 --- a/packages/client-rust/src/models/plex_source_request.rs +++ /dev/null @@ -1,108 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// PlexSourceRequest : Plex Source Serializer -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct PlexSourceRequest { - /// Source's display Name. - #[serde(rename = "name")] - pub name: String, - /// Internal source name, used in URLs. - #[serde(rename = "slug")] - pub slug: String, - #[serde(rename = "enabled", skip_serializing_if = "Option::is_none")] - pub enabled: Option, - /// When enabled, this source will be displayed as a prominent button on the login page, - /// instead of a small icon. - #[serde(rename = "promoted", skip_serializing_if = "Option::is_none")] - pub promoted: Option, - /// Flow to use when authenticating existing users. - #[serde( - rename = "authentication_flow", - default, - with = "::serde_with::rust::double_option", - skip_serializing_if = "Option::is_none" - )] - pub authentication_flow: Option>, - /// Flow to use when enrolling new users. - #[serde( - rename = "enrollment_flow", - default, - with = "::serde_with::rust::double_option", - skip_serializing_if = "Option::is_none" - )] - pub enrollment_flow: Option>, - #[serde( - rename = "user_property_mappings", - skip_serializing_if = "Option::is_none" - )] - pub user_property_mappings: Option>, - #[serde( - rename = "group_property_mappings", - skip_serializing_if = "Option::is_none" - )] - pub group_property_mappings: Option>, - #[serde(rename = "policy_engine_mode", skip_serializing_if = "Option::is_none")] - pub policy_engine_mode: Option, - /// How the source determines if an existing user should be authenticated or a new user - /// enrolled. - #[serde(rename = "user_matching_mode", skip_serializing_if = "Option::is_none")] - pub user_matching_mode: Option, - #[serde(rename = "user_path_template", skip_serializing_if = "Option::is_none")] - pub user_path_template: Option, - #[serde(rename = "icon", skip_serializing_if = "Option::is_none")] - pub icon: Option, - /// How the source determines if an existing group should be used or a new group created. - #[serde( - rename = "group_matching_mode", - skip_serializing_if = "Option::is_none" - )] - pub group_matching_mode: Option, - /// Client identifier used to talk to Plex. - #[serde(rename = "client_id", skip_serializing_if = "Option::is_none")] - pub client_id: Option, - /// Which servers a user has to be a member of to be granted access. Empty list allows every - /// server. - #[serde(rename = "allowed_servers", skip_serializing_if = "Option::is_none")] - pub allowed_servers: Option>, - /// Allow friends to authenticate, even if you don't share a server. - #[serde(rename = "allow_friends", skip_serializing_if = "Option::is_none")] - pub allow_friends: Option, - /// Plex token used to check friends - #[serde(rename = "plex_token")] - pub plex_token: String, -} - -impl PlexSourceRequest { - /// Plex Source Serializer - pub fn new(name: String, slug: String, plex_token: String) -> PlexSourceRequest { - PlexSourceRequest { - name, - slug, - enabled: None, - promoted: None, - authentication_flow: None, - enrollment_flow: None, - user_property_mappings: None, - group_property_mappings: None, - policy_engine_mode: None, - user_matching_mode: None, - user_path_template: None, - icon: None, - group_matching_mode: None, - client_id: None, - allowed_servers: None, - allow_friends: None, - plex_token, - } - } -} diff --git a/packages/client-rust/src/models/plex_token_redeem_request.rs b/packages/client-rust/src/models/plex_token_redeem_request.rs deleted file mode 100644 index 0bd4bec9e7..0000000000 --- a/packages/client-rust/src/models/plex_token_redeem_request.rs +++ /dev/null @@ -1,25 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// PlexTokenRedeemRequest : Serializer to redeem a plex token -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct PlexTokenRedeemRequest { - #[serde(rename = "plex_token")] - pub plex_token: String, -} - -impl PlexTokenRedeemRequest { - /// Serializer to redeem a plex token - pub fn new(plex_token: String) -> PlexTokenRedeemRequest { - PlexTokenRedeemRequest { plex_token } - } -} diff --git a/packages/client-rust/src/models/policy.rs b/packages/client-rust/src/models/policy.rs deleted file mode 100644 index 9575fcc55f..0000000000 --- a/packages/client-rust/src/models/policy.rs +++ /dev/null @@ -1,63 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// Policy : Policy Serializer -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct Policy { - #[serde(rename = "pk")] - pub pk: uuid::Uuid, - #[serde(rename = "name")] - pub name: String, - /// When this option is enabled, all executions of this policy will be logged. By default, only - /// execution errors are logged. - #[serde(rename = "execution_logging", skip_serializing_if = "Option::is_none")] - pub execution_logging: Option, - /// Get object component so that we know how to edit the object - #[serde(rename = "component")] - pub component: String, - /// Return object's verbose_name - #[serde(rename = "verbose_name")] - pub verbose_name: String, - /// Return object's plural verbose_name - #[serde(rename = "verbose_name_plural")] - pub verbose_name_plural: String, - /// Return internal model name - #[serde(rename = "meta_model_name")] - pub meta_model_name: String, - /// Return objects policy is bound to - #[serde(rename = "bound_to")] - pub bound_to: i32, -} - -impl Policy { - /// Policy Serializer - pub fn new( - pk: uuid::Uuid, - name: String, - component: String, - verbose_name: String, - verbose_name_plural: String, - meta_model_name: String, - bound_to: i32, - ) -> Policy { - Policy { - pk, - name, - execution_logging: None, - component, - verbose_name, - verbose_name_plural, - meta_model_name, - bound_to, - } - } -} diff --git a/packages/client-rust/src/models/policy_binding.rs b/packages/client-rust/src/models/policy_binding.rs deleted file mode 100644 index 740d10ad36..0000000000 --- a/packages/client-rust/src/models/policy_binding.rs +++ /dev/null @@ -1,88 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// PolicyBinding : PolicyBinding Serializer -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct PolicyBinding { - #[serde(rename = "pk")] - pub pk: uuid::Uuid, - #[serde( - rename = "policy", - default, - with = "::serde_with::rust::double_option", - skip_serializing_if = "Option::is_none" - )] - pub policy: Option>, - #[serde( - rename = "group", - default, - with = "::serde_with::rust::double_option", - skip_serializing_if = "Option::is_none" - )] - pub group: Option>, - #[serde( - rename = "user", - default, - with = "::serde_with::rust::double_option", - skip_serializing_if = "Option::is_none" - )] - pub user: Option>, - #[serde(rename = "policy_obj", deserialize_with = "Option::deserialize")] - pub policy_obj: Option, - #[serde(rename = "group_obj", deserialize_with = "Option::deserialize")] - pub group_obj: Option, - #[serde(rename = "user_obj", deserialize_with = "Option::deserialize")] - pub user_obj: Option, - #[serde(rename = "target")] - pub target: uuid::Uuid, - /// Negates the outcome of the policy. Messages are unaffected. - #[serde(rename = "negate", skip_serializing_if = "Option::is_none")] - pub negate: Option, - #[serde(rename = "enabled", skip_serializing_if = "Option::is_none")] - pub enabled: Option, - #[serde(rename = "order")] - pub order: i32, - /// Timeout after which Policy execution is terminated. - #[serde(rename = "timeout", skip_serializing_if = "Option::is_none")] - pub timeout: Option, - /// Result if the Policy execution fails. - #[serde(rename = "failure_result", skip_serializing_if = "Option::is_none")] - pub failure_result: Option, -} - -impl PolicyBinding { - /// PolicyBinding Serializer - pub fn new( - pk: uuid::Uuid, - policy_obj: Option, - group_obj: Option, - user_obj: Option, - target: uuid::Uuid, - order: i32, - ) -> PolicyBinding { - PolicyBinding { - pk, - policy: None, - group: None, - user: None, - policy_obj, - group_obj, - user_obj, - target, - negate: None, - enabled: None, - order, - timeout: None, - failure_result: None, - } - } -} diff --git a/packages/client-rust/src/models/policy_binding_request.rs b/packages/client-rust/src/models/policy_binding_request.rs deleted file mode 100644 index 778eca1300..0000000000 --- a/packages/client-rust/src/models/policy_binding_request.rs +++ /dev/null @@ -1,69 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// PolicyBindingRequest : PolicyBinding Serializer -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct PolicyBindingRequest { - #[serde( - rename = "policy", - default, - with = "::serde_with::rust::double_option", - skip_serializing_if = "Option::is_none" - )] - pub policy: Option>, - #[serde( - rename = "group", - default, - with = "::serde_with::rust::double_option", - skip_serializing_if = "Option::is_none" - )] - pub group: Option>, - #[serde( - rename = "user", - default, - with = "::serde_with::rust::double_option", - skip_serializing_if = "Option::is_none" - )] - pub user: Option>, - #[serde(rename = "target")] - pub target: uuid::Uuid, - /// Negates the outcome of the policy. Messages are unaffected. - #[serde(rename = "negate", skip_serializing_if = "Option::is_none")] - pub negate: Option, - #[serde(rename = "enabled", skip_serializing_if = "Option::is_none")] - pub enabled: Option, - #[serde(rename = "order")] - pub order: i32, - /// Timeout after which Policy execution is terminated. - #[serde(rename = "timeout", skip_serializing_if = "Option::is_none")] - pub timeout: Option, - /// Result if the Policy execution fails. - #[serde(rename = "failure_result", skip_serializing_if = "Option::is_none")] - pub failure_result: Option, -} - -impl PolicyBindingRequest { - /// PolicyBinding Serializer - pub fn new(target: uuid::Uuid, order: i32) -> PolicyBindingRequest { - PolicyBindingRequest { - policy: None, - group: None, - user: None, - target, - negate: None, - enabled: None, - order, - timeout: None, - failure_result: None, - } - } -} diff --git a/packages/client-rust/src/models/policy_engine_mode.rs b/packages/client-rust/src/models/policy_engine_mode.rs deleted file mode 100644 index 0856eabff9..0000000000 --- a/packages/client-rust/src/models/policy_engine_mode.rs +++ /dev/null @@ -1,35 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// -#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] -pub enum PolicyEngineMode { - #[serde(rename = "all")] - All, - #[serde(rename = "any")] - Any, -} - -impl std::fmt::Display for PolicyEngineMode { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - match self { - Self::All => write!(f, "all"), - Self::Any => write!(f, "any"), - } - } -} - -impl Default for PolicyEngineMode { - fn default() -> PolicyEngineMode { - Self::All - } -} diff --git a/packages/client-rust/src/models/policy_test_request.rs b/packages/client-rust/src/models/policy_test_request.rs deleted file mode 100644 index 227b98a506..0000000000 --- a/packages/client-rust/src/models/policy_test_request.rs +++ /dev/null @@ -1,30 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// PolicyTestRequest : Test policy execution for a user with context -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct PolicyTestRequest { - #[serde(rename = "user")] - pub user: i32, - #[serde(rename = "context", skip_serializing_if = "Option::is_none")] - pub context: Option>, -} - -impl PolicyTestRequest { - /// Test policy execution for a user with context - pub fn new(user: i32) -> PolicyTestRequest { - PolicyTestRequest { - user, - context: None, - } - } -} diff --git a/packages/client-rust/src/models/process.rs b/packages/client-rust/src/models/process.rs deleted file mode 100644 index 3f108036da..0000000000 --- a/packages/client-rust/src/models/process.rs +++ /dev/null @@ -1,31 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct Process { - #[serde(rename = "id")] - pub id: i32, - #[serde(rename = "name")] - pub name: String, - #[serde(rename = "user", skip_serializing_if = "Option::is_none")] - pub user: Option, -} - -impl Process { - pub fn new(id: i32, name: String) -> Process { - Process { - id, - name, - user: None, - } - } -} diff --git a/packages/client-rust/src/models/process_request.rs b/packages/client-rust/src/models/process_request.rs deleted file mode 100644 index 54a2829f8c..0000000000 --- a/packages/client-rust/src/models/process_request.rs +++ /dev/null @@ -1,31 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct ProcessRequest { - #[serde(rename = "id")] - pub id: i32, - #[serde(rename = "name")] - pub name: String, - #[serde(rename = "user", skip_serializing_if = "Option::is_none")] - pub user: Option, -} - -impl ProcessRequest { - pub fn new(id: i32, name: String) -> ProcessRequest { - ProcessRequest { - id, - name, - user: None, - } - } -} diff --git a/packages/client-rust/src/models/prompt.rs b/packages/client-rust/src/models/prompt.rs deleted file mode 100644 index 732de949c7..0000000000 --- a/packages/client-rust/src/models/prompt.rs +++ /dev/null @@ -1,82 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// Prompt : Prompt Serializer -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct Prompt { - #[serde(rename = "pk")] - pub pk: uuid::Uuid, - #[serde(rename = "name")] - pub name: String, - /// Name of the form field, also used to store the value - #[serde(rename = "field_key")] - pub field_key: String, - #[serde(rename = "label")] - pub label: String, - #[serde(rename = "type")] - pub r#type: models::PromptTypeEnum, - #[serde(rename = "required", skip_serializing_if = "Option::is_none")] - pub required: Option, - /// 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. - #[serde(rename = "placeholder", skip_serializing_if = "Option::is_none")] - pub placeholder: Option, - /// 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. - #[serde(rename = "initial_value", skip_serializing_if = "Option::is_none")] - pub initial_value: Option, - #[serde(rename = "order", skip_serializing_if = "Option::is_none")] - pub order: Option, - #[serde(rename = "prompt_stages_obj")] - pub prompt_stages_obj: Vec, - #[serde(rename = "sub_text", skip_serializing_if = "Option::is_none")] - pub sub_text: Option, - #[serde( - rename = "placeholder_expression", - skip_serializing_if = "Option::is_none" - )] - pub placeholder_expression: Option, - #[serde( - rename = "initial_value_expression", - skip_serializing_if = "Option::is_none" - )] - pub initial_value_expression: Option, -} - -impl Prompt { - /// Prompt Serializer - pub fn new( - pk: uuid::Uuid, - name: String, - field_key: String, - label: String, - r#type: models::PromptTypeEnum, - prompt_stages_obj: Vec, - ) -> Prompt { - Prompt { - pk, - name, - field_key, - label, - r#type, - required: None, - placeholder: None, - initial_value: None, - order: None, - prompt_stages_obj, - sub_text: None, - placeholder_expression: None, - initial_value_expression: None, - } - } -} diff --git a/packages/client-rust/src/models/prompt_request.rs b/packages/client-rust/src/models/prompt_request.rs deleted file mode 100644 index bd4b8ba377..0000000000 --- a/packages/client-rust/src/models/prompt_request.rs +++ /dev/null @@ -1,74 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// PromptRequest : Prompt Serializer -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct PromptRequest { - #[serde(rename = "name")] - pub name: String, - /// Name of the form field, also used to store the value - #[serde(rename = "field_key")] - pub field_key: String, - #[serde(rename = "label")] - pub label: String, - #[serde(rename = "type")] - pub r#type: models::PromptTypeEnum, - #[serde(rename = "required", skip_serializing_if = "Option::is_none")] - pub required: Option, - /// 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. - #[serde(rename = "placeholder", skip_serializing_if = "Option::is_none")] - pub placeholder: Option, - /// 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. - #[serde(rename = "initial_value", skip_serializing_if = "Option::is_none")] - pub initial_value: Option, - #[serde(rename = "order", skip_serializing_if = "Option::is_none")] - pub order: Option, - #[serde(rename = "sub_text", skip_serializing_if = "Option::is_none")] - pub sub_text: Option, - #[serde( - rename = "placeholder_expression", - skip_serializing_if = "Option::is_none" - )] - pub placeholder_expression: Option, - #[serde( - rename = "initial_value_expression", - skip_serializing_if = "Option::is_none" - )] - pub initial_value_expression: Option, -} - -impl PromptRequest { - /// Prompt Serializer - pub fn new( - name: String, - field_key: String, - label: String, - r#type: models::PromptTypeEnum, - ) -> PromptRequest { - PromptRequest { - name, - field_key, - label, - r#type, - required: None, - placeholder: None, - initial_value: None, - order: None, - sub_text: None, - placeholder_expression: None, - initial_value_expression: None, - } - } -} diff --git a/packages/client-rust/src/models/prompt_stage.rs b/packages/client-rust/src/models/prompt_stage.rs deleted file mode 100644 index ce3c46e19b..0000000000 --- a/packages/client-rust/src/models/prompt_stage.rs +++ /dev/null @@ -1,67 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// PromptStage : PromptStage Serializer -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct PromptStage { - #[serde(rename = "pk")] - pub pk: uuid::Uuid, - #[serde(rename = "name")] - pub name: String, - /// Get object type so that we know how to edit the object - #[serde(rename = "component")] - pub component: String, - /// Return object's verbose_name - #[serde(rename = "verbose_name")] - pub verbose_name: String, - /// Return object's plural verbose_name - #[serde(rename = "verbose_name_plural")] - pub verbose_name_plural: String, - /// Return internal model name - #[serde(rename = "meta_model_name")] - pub meta_model_name: String, - #[serde(rename = "flow_set")] - pub flow_set: Vec, - #[serde(rename = "fields")] - pub fields: Vec, - #[serde( - rename = "validation_policies", - skip_serializing_if = "Option::is_none" - )] - pub validation_policies: Option>, -} - -impl PromptStage { - /// PromptStage Serializer - pub fn new( - pk: uuid::Uuid, - name: String, - component: String, - verbose_name: String, - verbose_name_plural: String, - meta_model_name: String, - flow_set: Vec, - fields: Vec, - ) -> PromptStage { - PromptStage { - pk, - name, - component, - verbose_name, - verbose_name_plural, - meta_model_name, - flow_set, - fields, - validation_policies: None, - } - } -} diff --git a/packages/client-rust/src/models/prompt_stage_request.rs b/packages/client-rust/src/models/prompt_stage_request.rs deleted file mode 100644 index 32bed7f39f..0000000000 --- a/packages/client-rust/src/models/prompt_stage_request.rs +++ /dev/null @@ -1,36 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// PromptStageRequest : PromptStage Serializer -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct PromptStageRequest { - #[serde(rename = "name")] - pub name: String, - #[serde(rename = "fields")] - pub fields: Vec, - #[serde( - rename = "validation_policies", - skip_serializing_if = "Option::is_none" - )] - pub validation_policies: Option>, -} - -impl PromptStageRequest { - /// PromptStage Serializer - pub fn new(name: String, fields: Vec) -> PromptStageRequest { - PromptStageRequest { - name, - fields, - validation_policies: None, - } - } -} diff --git a/packages/client-rust/src/models/property_mapping.rs b/packages/client-rust/src/models/property_mapping.rs deleted file mode 100644 index 14dfe4e339..0000000000 --- a/packages/client-rust/src/models/property_mapping.rs +++ /dev/null @@ -1,68 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// PropertyMapping : PropertyMapping Serializer -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct PropertyMapping { - #[serde(rename = "pk")] - pub pk: uuid::Uuid, - /// 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. - #[serde( - rename = "managed", - default, - with = "::serde_with::rust::double_option", - skip_serializing_if = "Option::is_none" - )] - pub managed: Option>, - #[serde(rename = "name")] - pub name: String, - #[serde(rename = "expression")] - pub expression: String, - /// Get object's component so that we know how to edit the object - #[serde(rename = "component")] - pub component: String, - /// Return object's verbose_name - #[serde(rename = "verbose_name")] - pub verbose_name: String, - /// Return object's plural verbose_name - #[serde(rename = "verbose_name_plural")] - pub verbose_name_plural: String, - /// Return internal model name - #[serde(rename = "meta_model_name")] - pub meta_model_name: String, -} - -impl PropertyMapping { - /// PropertyMapping Serializer - pub fn new( - pk: uuid::Uuid, - name: String, - expression: String, - component: String, - verbose_name: String, - verbose_name_plural: String, - meta_model_name: String, - ) -> PropertyMapping { - PropertyMapping { - pk, - managed: None, - name, - expression, - component, - verbose_name, - verbose_name_plural, - meta_model_name, - } - } -} diff --git a/packages/client-rust/src/models/property_mapping_preview.rs b/packages/client-rust/src/models/property_mapping_preview.rs deleted file mode 100644 index 4396b33a1b..0000000000 --- a/packages/client-rust/src/models/property_mapping_preview.rs +++ /dev/null @@ -1,28 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// PropertyMappingPreview : Preview how the current user is mapped via the property mappings -/// selected in a provider -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct PropertyMappingPreview { - #[serde(rename = "preview")] - pub preview: std::collections::HashMap, -} - -impl PropertyMappingPreview { - /// Preview how the current user is mapped via the property mappings selected in a provider - pub fn new( - preview: std::collections::HashMap, - ) -> PropertyMappingPreview { - PropertyMappingPreview { preview } - } -} diff --git a/packages/client-rust/src/models/property_mapping_test_request.rs b/packages/client-rust/src/models/property_mapping_test_request.rs deleted file mode 100644 index 24529ffdbd..0000000000 --- a/packages/client-rust/src/models/property_mapping_test_request.rs +++ /dev/null @@ -1,43 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// PropertyMappingTestRequest : Test property mapping execution for a user/group with context -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct PropertyMappingTestRequest { - #[serde( - rename = "user", - default, - with = "::serde_with::rust::double_option", - skip_serializing_if = "Option::is_none" - )] - pub user: Option>, - #[serde(rename = "context", skip_serializing_if = "Option::is_none")] - pub context: Option>, - #[serde( - rename = "group", - default, - with = "::serde_with::rust::double_option", - skip_serializing_if = "Option::is_none" - )] - pub group: Option>, -} - -impl PropertyMappingTestRequest { - /// Test property mapping execution for a user/group with context - pub fn new() -> PropertyMappingTestRequest { - PropertyMappingTestRequest { - user: None, - context: None, - group: None, - } - } -} diff --git a/packages/client-rust/src/models/property_mapping_test_result.rs b/packages/client-rust/src/models/property_mapping_test_result.rs deleted file mode 100644 index ca42844e63..0000000000 --- a/packages/client-rust/src/models/property_mapping_test_result.rs +++ /dev/null @@ -1,27 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// PropertyMappingTestResult : Result of a Property-mapping test -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct PropertyMappingTestResult { - #[serde(rename = "result")] - pub result: String, - #[serde(rename = "successful")] - pub successful: bool, -} - -impl PropertyMappingTestResult { - /// Result of a Property-mapping test - pub fn new(result: String, successful: bool) -> PropertyMappingTestResult { - PropertyMappingTestResult { result, successful } - } -} diff --git a/packages/client-rust/src/models/protocol_enum.rs b/packages/client-rust/src/models/protocol_enum.rs deleted file mode 100644 index 9688504653..0000000000 --- a/packages/client-rust/src/models/protocol_enum.rs +++ /dev/null @@ -1,38 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// -#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] -pub enum ProtocolEnum { - #[serde(rename = "rdp")] - Rdp, - #[serde(rename = "vnc")] - Vnc, - #[serde(rename = "ssh")] - Ssh, -} - -impl std::fmt::Display for ProtocolEnum { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - match self { - Self::Rdp => write!(f, "rdp"), - Self::Vnc => write!(f, "vnc"), - Self::Ssh => write!(f, "ssh"), - } - } -} - -impl Default for ProtocolEnum { - fn default() -> ProtocolEnum { - Self::Rdp - } -} diff --git a/packages/client-rust/src/models/provider_enum.rs b/packages/client-rust/src/models/provider_enum.rs deleted file mode 100644 index 7403524ed2..0000000000 --- a/packages/client-rust/src/models/provider_enum.rs +++ /dev/null @@ -1,35 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// -#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] -pub enum ProviderEnum { - #[serde(rename = "twilio")] - Twilio, - #[serde(rename = "generic")] - Generic, -} - -impl std::fmt::Display for ProviderEnum { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - match self { - Self::Twilio => write!(f, "twilio"), - Self::Generic => write!(f, "generic"), - } - } -} - -impl Default for ProviderEnum { - fn default() -> ProviderEnum { - Self::Twilio - } -} diff --git a/packages/client-rust/src/models/provider_model_enum.rs b/packages/client-rust/src/models/provider_model_enum.rs deleted file mode 100644 index fa2c65f2a8..0000000000 --- a/packages/client-rust/src/models/provider_model_enum.rs +++ /dev/null @@ -1,86 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// -#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] -pub enum ProviderModelEnum { - #[serde(rename = "authentik_providers_google_workspace.googleworkspaceprovider")] - AuthentikProvidersGoogleWorkspaceGoogleworkspaceprovider, - #[serde(rename = "authentik_providers_ldap.ldapprovider")] - AuthentikProvidersLdapLdapprovider, - #[serde(rename = "authentik_providers_microsoft_entra.microsoftentraprovider")] - AuthentikProvidersMicrosoftEntraMicrosoftentraprovider, - #[serde(rename = "authentik_providers_oauth2.oauth2provider")] - AuthentikProvidersOauth2Oauth2provider, - #[serde(rename = "authentik_providers_proxy.proxyprovider")] - AuthentikProvidersProxyProxyprovider, - #[serde(rename = "authentik_providers_rac.racprovider")] - AuthentikProvidersRacRacprovider, - #[serde(rename = "authentik_providers_radius.radiusprovider")] - AuthentikProvidersRadiusRadiusprovider, - #[serde(rename = "authentik_providers_saml.samlprovider")] - AuthentikProvidersSamlSamlprovider, - #[serde(rename = "authentik_providers_scim.scimprovider")] - AuthentikProvidersScimScimprovider, - #[serde(rename = "authentik_providers_ssf.ssfprovider")] - AuthentikProvidersSsfSsfprovider, - #[serde(rename = "authentik_providers_ws_federation.wsfederationprovider")] - AuthentikProvidersWsFederationWsfederationprovider, -} - -impl std::fmt::Display for ProviderModelEnum { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - match self { - Self::AuthentikProvidersGoogleWorkspaceGoogleworkspaceprovider => write!( - f, - "authentik_providers_google_workspace.googleworkspaceprovider" - ), - Self::AuthentikProvidersLdapLdapprovider => { - write!(f, "authentik_providers_ldap.ldapprovider") - } - Self::AuthentikProvidersMicrosoftEntraMicrosoftentraprovider => write!( - f, - "authentik_providers_microsoft_entra.microsoftentraprovider" - ), - Self::AuthentikProvidersOauth2Oauth2provider => { - write!(f, "authentik_providers_oauth2.oauth2provider") - } - Self::AuthentikProvidersProxyProxyprovider => { - write!(f, "authentik_providers_proxy.proxyprovider") - } - Self::AuthentikProvidersRacRacprovider => { - write!(f, "authentik_providers_rac.racprovider") - } - Self::AuthentikProvidersRadiusRadiusprovider => { - write!(f, "authentik_providers_radius.radiusprovider") - } - Self::AuthentikProvidersSamlSamlprovider => { - write!(f, "authentik_providers_saml.samlprovider") - } - Self::AuthentikProvidersScimScimprovider => { - write!(f, "authentik_providers_scim.scimprovider") - } - Self::AuthentikProvidersSsfSsfprovider => { - write!(f, "authentik_providers_ssf.ssfprovider") - } - Self::AuthentikProvidersWsFederationWsfederationprovider => { - write!(f, "authentik_providers_ws_federation.wsfederationprovider") - } - } - } -} - -impl Default for ProviderModelEnum { - fn default() -> ProviderModelEnum { - Self::AuthentikProvidersGoogleWorkspaceGoogleworkspaceprovider - } -} diff --git a/packages/client-rust/src/models/provider_type_enum.rs b/packages/client-rust/src/models/provider_type_enum.rs deleted file mode 100644 index d4778e880a..0000000000 --- a/packages/client-rust/src/models/provider_type_enum.rs +++ /dev/null @@ -1,80 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// -#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] -pub enum ProviderTypeEnum { - #[serde(rename = "apple")] - Apple, - #[serde(rename = "openidconnect")] - Openidconnect, - #[serde(rename = "entraid")] - Entraid, - #[serde(rename = "azuread")] - Azuread, - #[serde(rename = "discord")] - Discord, - #[serde(rename = "facebook")] - Facebook, - #[serde(rename = "github")] - Github, - #[serde(rename = "gitlab")] - Gitlab, - #[serde(rename = "google")] - Google, - #[serde(rename = "mailcow")] - Mailcow, - #[serde(rename = "okta")] - Okta, - #[serde(rename = "patreon")] - Patreon, - #[serde(rename = "reddit")] - Reddit, - #[serde(rename = "slack")] - Slack, - #[serde(rename = "twitch")] - Twitch, - #[serde(rename = "twitter")] - Twitter, - #[serde(rename = "wechat")] - Wechat, -} - -impl std::fmt::Display for ProviderTypeEnum { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - match self { - Self::Apple => write!(f, "apple"), - Self::Openidconnect => write!(f, "openidconnect"), - Self::Entraid => write!(f, "entraid"), - Self::Azuread => write!(f, "azuread"), - Self::Discord => write!(f, "discord"), - Self::Facebook => write!(f, "facebook"), - Self::Github => write!(f, "github"), - Self::Gitlab => write!(f, "gitlab"), - Self::Google => write!(f, "google"), - Self::Mailcow => write!(f, "mailcow"), - Self::Okta => write!(f, "okta"), - Self::Patreon => write!(f, "patreon"), - Self::Reddit => write!(f, "reddit"), - Self::Slack => write!(f, "slack"), - Self::Twitch => write!(f, "twitch"), - Self::Twitter => write!(f, "twitter"), - Self::Wechat => write!(f, "wechat"), - } - } -} - -impl Default for ProviderTypeEnum { - fn default() -> ProviderTypeEnum { - Self::Apple - } -} diff --git a/packages/client-rust/src/models/proxy_provider.rs b/packages/client-rust/src/models/proxy_provider.rs deleted file mode 100644 index 6c23d5a290..0000000000 --- a/packages/client-rust/src/models/proxy_provider.rs +++ /dev/null @@ -1,210 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// ProxyProvider : ProxyProvider Serializer -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct ProxyProvider { - #[serde(rename = "pk")] - pub pk: i32, - #[serde(rename = "name")] - pub name: String, - /// Flow used for authentication when the associated application is accessed by an - /// un-authenticated user. - #[serde( - rename = "authentication_flow", - default, - with = "::serde_with::rust::double_option", - skip_serializing_if = "Option::is_none" - )] - pub authentication_flow: Option>, - /// Flow used when authorizing this provider. - #[serde(rename = "authorization_flow")] - pub authorization_flow: uuid::Uuid, - /// Flow used ending the session from a provider. - #[serde(rename = "invalidation_flow")] - pub invalidation_flow: uuid::Uuid, - #[serde(rename = "property_mappings", skip_serializing_if = "Option::is_none")] - pub property_mappings: Option>, - /// Get object component so that we know how to edit the object - #[serde(rename = "component")] - pub component: String, - /// Internal application name, used in URLs. - #[serde( - rename = "assigned_application_slug", - deserialize_with = "Option::deserialize" - )] - pub assigned_application_slug: Option, - /// Application's display Name. - #[serde( - rename = "assigned_application_name", - deserialize_with = "Option::deserialize" - )] - pub assigned_application_name: Option, - /// Internal application name, used in URLs. - #[serde( - rename = "assigned_backchannel_application_slug", - deserialize_with = "Option::deserialize" - )] - pub assigned_backchannel_application_slug: Option, - /// Application's display Name. - #[serde( - rename = "assigned_backchannel_application_name", - deserialize_with = "Option::deserialize" - )] - pub assigned_backchannel_application_name: Option, - /// Return object's verbose_name - #[serde(rename = "verbose_name")] - pub verbose_name: String, - /// Return object's plural verbose_name - #[serde(rename = "verbose_name_plural")] - pub verbose_name_plural: String, - /// Return internal model name - #[serde(rename = "meta_model_name")] - pub meta_model_name: String, - #[serde(rename = "client_id")] - pub client_id: String, - #[serde(rename = "internal_host", skip_serializing_if = "Option::is_none")] - pub internal_host: Option, - #[serde(rename = "external_host")] - pub external_host: String, - /// Validate SSL Certificates of upstream servers - #[serde( - rename = "internal_host_ssl_validation", - skip_serializing_if = "Option::is_none" - )] - pub internal_host_ssl_validation: Option, - #[serde( - rename = "certificate", - default, - with = "::serde_with::rust::double_option", - skip_serializing_if = "Option::is_none" - )] - pub certificate: Option>, - /// Regular expressions for which authentication is not required. Each new line is interpreted - /// as a new Regular Expression. - #[serde(rename = "skip_path_regex", skip_serializing_if = "Option::is_none")] - pub skip_path_regex: Option, - /// Set a custom HTTP-Basic Authentication header based on values from authentik. - #[serde(rename = "basic_auth_enabled", skip_serializing_if = "Option::is_none")] - pub basic_auth_enabled: Option, - /// User/Group Attribute used for the password part of the HTTP-Basic Header. - #[serde( - rename = "basic_auth_password_attribute", - skip_serializing_if = "Option::is_none" - )] - pub basic_auth_password_attribute: Option, - /// User/Group Attribute used for the user part of the HTTP-Basic Header. If not set, the - /// user's Email address is used. - #[serde( - rename = "basic_auth_user_attribute", - skip_serializing_if = "Option::is_none" - )] - pub basic_auth_user_attribute: Option, - /// Enable support for forwardAuth in traefik and nginx auth_request. Exclusive with - /// internal_host. - #[serde(rename = "mode", skip_serializing_if = "Option::is_none")] - pub mode: Option, - /// When enabled, this provider will intercept the authorization header and authenticate - /// requests based on its value. - #[serde( - rename = "intercept_header_auth", - skip_serializing_if = "Option::is_none" - )] - pub intercept_header_auth: Option, - #[serde(rename = "redirect_uris")] - pub redirect_uris: Vec, - #[serde(rename = "cookie_domain", skip_serializing_if = "Option::is_none")] - pub cookie_domain: Option, - #[serde( - rename = "jwt_federation_sources", - skip_serializing_if = "Option::is_none" - )] - pub jwt_federation_sources: Option>, - #[serde( - rename = "jwt_federation_providers", - skip_serializing_if = "Option::is_none" - )] - pub jwt_federation_providers: Option>, - /// Tokens not valid on or after current time + this value (Format: - /// hours=1;minutes=2;seconds=3). - #[serde( - rename = "access_token_validity", - skip_serializing_if = "Option::is_none" - )] - pub access_token_validity: Option, - /// Tokens not valid on or after current time + this value (Format: - /// hours=1;minutes=2;seconds=3). - #[serde( - rename = "refresh_token_validity", - skip_serializing_if = "Option::is_none" - )] - pub refresh_token_validity: Option, - #[serde(rename = "outpost_set")] - pub outpost_set: Vec, -} - -impl ProxyProvider { - /// ProxyProvider Serializer - pub fn new( - pk: i32, - name: String, - authorization_flow: uuid::Uuid, - invalidation_flow: uuid::Uuid, - component: String, - assigned_application_slug: Option, - assigned_application_name: Option, - assigned_backchannel_application_slug: Option, - assigned_backchannel_application_name: Option, - verbose_name: String, - verbose_name_plural: String, - meta_model_name: String, - client_id: String, - external_host: String, - redirect_uris: Vec, - outpost_set: Vec, - ) -> ProxyProvider { - ProxyProvider { - pk, - name, - authentication_flow: None, - authorization_flow, - invalidation_flow, - property_mappings: None, - 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, - internal_host: None, - external_host, - internal_host_ssl_validation: None, - certificate: None, - skip_path_regex: None, - basic_auth_enabled: None, - basic_auth_password_attribute: None, - basic_auth_user_attribute: None, - mode: None, - intercept_header_auth: None, - redirect_uris, - cookie_domain: None, - jwt_federation_sources: None, - jwt_federation_providers: None, - access_token_validity: None, - refresh_token_validity: None, - outpost_set, - } - } -} diff --git a/packages/client-rust/src/models/proxy_provider_request.rs b/packages/client-rust/src/models/proxy_provider_request.rs deleted file mode 100644 index d13f7c46c7..0000000000 --- a/packages/client-rust/src/models/proxy_provider_request.rs +++ /dev/null @@ -1,142 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// ProxyProviderRequest : ProxyProvider Serializer -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct ProxyProviderRequest { - #[serde(rename = "name")] - pub name: String, - /// Flow used for authentication when the associated application is accessed by an - /// un-authenticated user. - #[serde( - rename = "authentication_flow", - default, - with = "::serde_with::rust::double_option", - skip_serializing_if = "Option::is_none" - )] - pub authentication_flow: Option>, - /// Flow used when authorizing this provider. - #[serde(rename = "authorization_flow")] - pub authorization_flow: uuid::Uuid, - /// Flow used ending the session from a provider. - #[serde(rename = "invalidation_flow")] - pub invalidation_flow: uuid::Uuid, - #[serde(rename = "property_mappings", skip_serializing_if = "Option::is_none")] - pub property_mappings: Option>, - #[serde(rename = "internal_host", skip_serializing_if = "Option::is_none")] - pub internal_host: Option, - #[serde(rename = "external_host")] - pub external_host: String, - /// Validate SSL Certificates of upstream servers - #[serde( - rename = "internal_host_ssl_validation", - skip_serializing_if = "Option::is_none" - )] - pub internal_host_ssl_validation: Option, - #[serde( - rename = "certificate", - default, - with = "::serde_with::rust::double_option", - skip_serializing_if = "Option::is_none" - )] - pub certificate: Option>, - /// Regular expressions for which authentication is not required. Each new line is interpreted - /// as a new Regular Expression. - #[serde(rename = "skip_path_regex", skip_serializing_if = "Option::is_none")] - pub skip_path_regex: Option, - /// Set a custom HTTP-Basic Authentication header based on values from authentik. - #[serde(rename = "basic_auth_enabled", skip_serializing_if = "Option::is_none")] - pub basic_auth_enabled: Option, - /// User/Group Attribute used for the password part of the HTTP-Basic Header. - #[serde( - rename = "basic_auth_password_attribute", - skip_serializing_if = "Option::is_none" - )] - pub basic_auth_password_attribute: Option, - /// User/Group Attribute used for the user part of the HTTP-Basic Header. If not set, the - /// user's Email address is used. - #[serde( - rename = "basic_auth_user_attribute", - skip_serializing_if = "Option::is_none" - )] - pub basic_auth_user_attribute: Option, - /// Enable support for forwardAuth in traefik and nginx auth_request. Exclusive with - /// internal_host. - #[serde(rename = "mode", skip_serializing_if = "Option::is_none")] - pub mode: Option, - /// When enabled, this provider will intercept the authorization header and authenticate - /// requests based on its value. - #[serde( - rename = "intercept_header_auth", - skip_serializing_if = "Option::is_none" - )] - pub intercept_header_auth: Option, - #[serde(rename = "cookie_domain", skip_serializing_if = "Option::is_none")] - pub cookie_domain: Option, - #[serde( - rename = "jwt_federation_sources", - skip_serializing_if = "Option::is_none" - )] - pub jwt_federation_sources: Option>, - #[serde( - rename = "jwt_federation_providers", - skip_serializing_if = "Option::is_none" - )] - pub jwt_federation_providers: Option>, - /// Tokens not valid on or after current time + this value (Format: - /// hours=1;minutes=2;seconds=3). - #[serde( - rename = "access_token_validity", - skip_serializing_if = "Option::is_none" - )] - pub access_token_validity: Option, - /// Tokens not valid on or after current time + this value (Format: - /// hours=1;minutes=2;seconds=3). - #[serde( - rename = "refresh_token_validity", - skip_serializing_if = "Option::is_none" - )] - pub refresh_token_validity: Option, -} - -impl ProxyProviderRequest { - /// ProxyProvider Serializer - pub fn new( - name: String, - authorization_flow: uuid::Uuid, - invalidation_flow: uuid::Uuid, - external_host: String, - ) -> ProxyProviderRequest { - ProxyProviderRequest { - name, - authentication_flow: None, - authorization_flow, - invalidation_flow, - property_mappings: None, - internal_host: None, - external_host, - internal_host_ssl_validation: None, - certificate: None, - skip_path_regex: None, - basic_auth_enabled: None, - basic_auth_password_attribute: None, - basic_auth_user_attribute: None, - mode: None, - intercept_header_auth: None, - cookie_domain: None, - jwt_federation_sources: None, - jwt_federation_providers: None, - access_token_validity: None, - refresh_token_validity: None, - } - } -} diff --git a/packages/client-rust/src/models/rac_property_mapping.rs b/packages/client-rust/src/models/rac_property_mapping.rs deleted file mode 100644 index 46aacbecdb..0000000000 --- a/packages/client-rust/src/models/rac_property_mapping.rs +++ /dev/null @@ -1,71 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// RacPropertyMapping : RACPropertyMapping Serializer -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct RacPropertyMapping { - #[serde(rename = "pk")] - pub pk: uuid::Uuid, - /// 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. - #[serde( - rename = "managed", - default, - with = "::serde_with::rust::double_option", - skip_serializing_if = "Option::is_none" - )] - pub managed: Option>, - #[serde(rename = "name")] - pub name: String, - #[serde(rename = "expression", skip_serializing_if = "Option::is_none")] - pub expression: Option, - /// Get object's component so that we know how to edit the object - #[serde(rename = "component")] - pub component: String, - /// Return object's verbose_name - #[serde(rename = "verbose_name")] - pub verbose_name: String, - /// Return object's plural verbose_name - #[serde(rename = "verbose_name_plural")] - pub verbose_name_plural: String, - /// Return internal model name - #[serde(rename = "meta_model_name")] - pub meta_model_name: String, - #[serde(rename = "static_settings")] - pub static_settings: std::collections::HashMap, -} - -impl RacPropertyMapping { - /// RACPropertyMapping Serializer - pub fn new( - pk: uuid::Uuid, - name: String, - component: String, - verbose_name: String, - verbose_name_plural: String, - meta_model_name: String, - static_settings: std::collections::HashMap, - ) -> RacPropertyMapping { - RacPropertyMapping { - pk, - managed: None, - name, - expression: None, - component, - verbose_name, - verbose_name_plural, - meta_model_name, - static_settings, - } - } -} diff --git a/packages/client-rust/src/models/rac_property_mapping_request.rs b/packages/client-rust/src/models/rac_property_mapping_request.rs deleted file mode 100644 index 2119ce09e2..0000000000 --- a/packages/client-rust/src/models/rac_property_mapping_request.rs +++ /dev/null @@ -1,47 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// RacPropertyMappingRequest : RACPropertyMapping Serializer -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct RacPropertyMappingRequest { - /// 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. - #[serde( - rename = "managed", - default, - with = "::serde_with::rust::double_option", - skip_serializing_if = "Option::is_none" - )] - pub managed: Option>, - #[serde(rename = "name")] - pub name: String, - #[serde(rename = "expression", skip_serializing_if = "Option::is_none")] - pub expression: Option, - #[serde(rename = "static_settings")] - pub static_settings: std::collections::HashMap, -} - -impl RacPropertyMappingRequest { - /// RACPropertyMapping Serializer - pub fn new( - name: String, - static_settings: std::collections::HashMap, - ) -> RacPropertyMappingRequest { - RacPropertyMappingRequest { - managed: None, - name, - expression: None, - static_settings, - } - } -} diff --git a/packages/client-rust/src/models/rac_provider.rs b/packages/client-rust/src/models/rac_provider.rs deleted file mode 100644 index 7b51ae0ab9..0000000000 --- a/packages/client-rust/src/models/rac_provider.rs +++ /dev/null @@ -1,122 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// RacProvider : RACProvider Serializer -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct RacProvider { - #[serde(rename = "pk")] - pub pk: i32, - #[serde(rename = "name")] - pub name: String, - /// Flow used for authentication when the associated application is accessed by an - /// un-authenticated user. - #[serde( - rename = "authentication_flow", - default, - with = "::serde_with::rust::double_option", - skip_serializing_if = "Option::is_none" - )] - pub authentication_flow: Option>, - /// Flow used when authorizing this provider. - #[serde(rename = "authorization_flow")] - pub authorization_flow: uuid::Uuid, - #[serde(rename = "property_mappings", skip_serializing_if = "Option::is_none")] - pub property_mappings: Option>, - /// Get object component so that we know how to edit the object - #[serde(rename = "component")] - pub component: String, - /// Internal application name, used in URLs. - #[serde( - rename = "assigned_application_slug", - deserialize_with = "Option::deserialize" - )] - pub assigned_application_slug: Option, - /// Application's display Name. - #[serde( - rename = "assigned_application_name", - deserialize_with = "Option::deserialize" - )] - pub assigned_application_name: Option, - /// Internal application name, used in URLs. - #[serde( - rename = "assigned_backchannel_application_slug", - deserialize_with = "Option::deserialize" - )] - pub assigned_backchannel_application_slug: Option, - /// Application's display Name. - #[serde( - rename = "assigned_backchannel_application_name", - deserialize_with = "Option::deserialize" - )] - pub assigned_backchannel_application_name: Option, - /// Return object's verbose_name - #[serde(rename = "verbose_name")] - pub verbose_name: String, - /// Return object's plural verbose_name - #[serde(rename = "verbose_name_plural")] - pub verbose_name_plural: String, - /// Return internal model name - #[serde(rename = "meta_model_name")] - pub meta_model_name: String, - #[serde(rename = "settings", skip_serializing_if = "Option::is_none")] - pub settings: Option>, - #[serde(rename = "outpost_set")] - pub outpost_set: Vec, - /// 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) - #[serde(rename = "connection_expiry", skip_serializing_if = "Option::is_none")] - pub connection_expiry: Option, - /// When set to true, connection tokens will be deleted upon disconnect. - #[serde( - rename = "delete_token_on_disconnect", - skip_serializing_if = "Option::is_none" - )] - pub delete_token_on_disconnect: Option, -} - -impl RacProvider { - /// RACProvider Serializer - pub fn new( - pk: i32, - name: String, - authorization_flow: uuid::Uuid, - component: String, - assigned_application_slug: Option, - assigned_application_name: Option, - assigned_backchannel_application_slug: Option, - assigned_backchannel_application_name: Option, - verbose_name: String, - verbose_name_plural: String, - meta_model_name: String, - outpost_set: Vec, - ) -> RacProvider { - RacProvider { - pk, - name, - authentication_flow: None, - authorization_flow, - property_mappings: None, - component, - assigned_application_slug, - assigned_application_name, - assigned_backchannel_application_slug, - assigned_backchannel_application_name, - verbose_name, - verbose_name_plural, - meta_model_name, - settings: None, - outpost_set, - connection_expiry: None, - delete_token_on_disconnect: None, - } - } -} diff --git a/packages/client-rust/src/models/rac_provider_request.rs b/packages/client-rust/src/models/rac_provider_request.rs deleted file mode 100644 index b610f7125a..0000000000 --- a/packages/client-rust/src/models/rac_provider_request.rs +++ /dev/null @@ -1,59 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// RacProviderRequest : RACProvider Serializer -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct RacProviderRequest { - #[serde(rename = "name")] - pub name: String, - /// Flow used for authentication when the associated application is accessed by an - /// un-authenticated user. - #[serde( - rename = "authentication_flow", - default, - with = "::serde_with::rust::double_option", - skip_serializing_if = "Option::is_none" - )] - pub authentication_flow: Option>, - /// Flow used when authorizing this provider. - #[serde(rename = "authorization_flow")] - pub authorization_flow: uuid::Uuid, - #[serde(rename = "property_mappings", skip_serializing_if = "Option::is_none")] - pub property_mappings: Option>, - #[serde(rename = "settings", skip_serializing_if = "Option::is_none")] - pub settings: Option>, - /// 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) - #[serde(rename = "connection_expiry", skip_serializing_if = "Option::is_none")] - pub connection_expiry: Option, - /// When set to true, connection tokens will be deleted upon disconnect. - #[serde( - rename = "delete_token_on_disconnect", - skip_serializing_if = "Option::is_none" - )] - pub delete_token_on_disconnect: Option, -} - -impl RacProviderRequest { - /// RACProvider Serializer - pub fn new(name: String, authorization_flow: uuid::Uuid) -> RacProviderRequest { - RacProviderRequest { - name, - authentication_flow: None, - authorization_flow, - property_mappings: None, - settings: None, - connection_expiry: None, - delete_token_on_disconnect: None, - } - } -} diff --git a/packages/client-rust/src/models/radius_provider.rs b/packages/client-rust/src/models/radius_provider.rs deleted file mode 100644 index ee645e7bad..0000000000 --- a/packages/client-rust/src/models/radius_provider.rs +++ /dev/null @@ -1,136 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// RadiusProvider : RadiusProvider Serializer -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct RadiusProvider { - #[serde(rename = "pk")] - pub pk: i32, - #[serde(rename = "name")] - pub name: String, - /// Flow used for authentication when the associated application is accessed by an - /// un-authenticated user. - #[serde( - rename = "authentication_flow", - default, - with = "::serde_with::rust::double_option", - skip_serializing_if = "Option::is_none" - )] - pub authentication_flow: Option>, - /// Flow used when authorizing this provider. - #[serde(rename = "authorization_flow")] - pub authorization_flow: uuid::Uuid, - /// Flow used ending the session from a provider. - #[serde(rename = "invalidation_flow")] - pub invalidation_flow: uuid::Uuid, - #[serde(rename = "property_mappings", skip_serializing_if = "Option::is_none")] - pub property_mappings: Option>, - /// Get object component so that we know how to edit the object - #[serde(rename = "component")] - pub component: String, - /// Internal application name, used in URLs. - #[serde( - rename = "assigned_application_slug", - deserialize_with = "Option::deserialize" - )] - pub assigned_application_slug: Option, - /// Application's display Name. - #[serde( - rename = "assigned_application_name", - deserialize_with = "Option::deserialize" - )] - pub assigned_application_name: Option, - /// Internal application name, used in URLs. - #[serde( - rename = "assigned_backchannel_application_slug", - deserialize_with = "Option::deserialize" - )] - pub assigned_backchannel_application_slug: Option, - /// Application's display Name. - #[serde( - rename = "assigned_backchannel_application_name", - deserialize_with = "Option::deserialize" - )] - pub assigned_backchannel_application_name: Option, - /// Return object's verbose_name - #[serde(rename = "verbose_name")] - pub verbose_name: String, - /// Return object's plural verbose_name - #[serde(rename = "verbose_name_plural")] - pub verbose_name_plural: String, - /// Return internal model name - #[serde(rename = "meta_model_name")] - pub meta_model_name: String, - /// 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. - #[serde(rename = "client_networks", skip_serializing_if = "Option::is_none")] - pub client_networks: Option, - /// Shared secret between clients and server to hash packets. - #[serde(rename = "shared_secret", skip_serializing_if = "Option::is_none")] - pub shared_secret: Option, - #[serde(rename = "outpost_set")] - pub outpost_set: Vec, - /// 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. - #[serde(rename = "mfa_support", skip_serializing_if = "Option::is_none")] - pub mfa_support: Option, - #[serde( - rename = "certificate", - default, - with = "::serde_with::rust::double_option", - skip_serializing_if = "Option::is_none" - )] - pub certificate: Option>, -} - -impl RadiusProvider { - /// RadiusProvider Serializer - pub fn new( - pk: i32, - name: String, - authorization_flow: uuid::Uuid, - invalidation_flow: uuid::Uuid, - component: String, - assigned_application_slug: Option, - assigned_application_name: Option, - assigned_backchannel_application_slug: Option, - assigned_backchannel_application_name: Option, - verbose_name: String, - verbose_name_plural: String, - meta_model_name: String, - outpost_set: Vec, - ) -> RadiusProvider { - RadiusProvider { - pk, - name, - authentication_flow: None, - authorization_flow, - invalidation_flow, - property_mappings: None, - component, - assigned_application_slug, - assigned_application_name, - assigned_backchannel_application_slug, - assigned_backchannel_application_name, - verbose_name, - verbose_name_plural, - meta_model_name, - client_networks: None, - shared_secret: None, - outpost_set, - mfa_support: None, - certificate: None, - } - } -} diff --git a/packages/client-rust/src/models/radius_provider_property_mapping.rs b/packages/client-rust/src/models/radius_provider_property_mapping.rs deleted file mode 100644 index 2ae88dd841..0000000000 --- a/packages/client-rust/src/models/radius_provider_property_mapping.rs +++ /dev/null @@ -1,68 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// RadiusProviderPropertyMapping : RadiusProviderPropertyMapping Serializer -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct RadiusProviderPropertyMapping { - #[serde(rename = "pk")] - pub pk: uuid::Uuid, - /// 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. - #[serde( - rename = "managed", - default, - with = "::serde_with::rust::double_option", - skip_serializing_if = "Option::is_none" - )] - pub managed: Option>, - #[serde(rename = "name")] - pub name: String, - #[serde(rename = "expression")] - pub expression: String, - /// Get object's component so that we know how to edit the object - #[serde(rename = "component")] - pub component: String, - /// Return object's verbose_name - #[serde(rename = "verbose_name")] - pub verbose_name: String, - /// Return object's plural verbose_name - #[serde(rename = "verbose_name_plural")] - pub verbose_name_plural: String, - /// Return internal model name - #[serde(rename = "meta_model_name")] - pub meta_model_name: String, -} - -impl RadiusProviderPropertyMapping { - /// RadiusProviderPropertyMapping Serializer - pub fn new( - pk: uuid::Uuid, - name: String, - expression: String, - component: String, - verbose_name: String, - verbose_name_plural: String, - meta_model_name: String, - ) -> RadiusProviderPropertyMapping { - RadiusProviderPropertyMapping { - pk, - managed: None, - name, - expression, - component, - verbose_name, - verbose_name_plural, - meta_model_name, - } - } -} diff --git a/packages/client-rust/src/models/radius_provider_property_mapping_request.rs b/packages/client-rust/src/models/radius_provider_property_mapping_request.rs deleted file mode 100644 index 40eab7201d..0000000000 --- a/packages/client-rust/src/models/radius_provider_property_mapping_request.rs +++ /dev/null @@ -1,41 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// RadiusProviderPropertyMappingRequest : RadiusProviderPropertyMapping Serializer -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct RadiusProviderPropertyMappingRequest { - /// 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. - #[serde( - rename = "managed", - default, - with = "::serde_with::rust::double_option", - skip_serializing_if = "Option::is_none" - )] - pub managed: Option>, - #[serde(rename = "name")] - pub name: String, - #[serde(rename = "expression")] - pub expression: String, -} - -impl RadiusProviderPropertyMappingRequest { - /// RadiusProviderPropertyMapping Serializer - pub fn new(name: String, expression: String) -> RadiusProviderPropertyMappingRequest { - RadiusProviderPropertyMappingRequest { - managed: None, - name, - expression, - } - } -} diff --git a/packages/client-rust/src/models/radius_provider_request.rs b/packages/client-rust/src/models/radius_provider_request.rs deleted file mode 100644 index a845077c1b..0000000000 --- a/packages/client-rust/src/models/radius_provider_request.rs +++ /dev/null @@ -1,76 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// RadiusProviderRequest : RadiusProvider Serializer -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct RadiusProviderRequest { - #[serde(rename = "name")] - pub name: String, - /// Flow used for authentication when the associated application is accessed by an - /// un-authenticated user. - #[serde( - rename = "authentication_flow", - default, - with = "::serde_with::rust::double_option", - skip_serializing_if = "Option::is_none" - )] - pub authentication_flow: Option>, - /// Flow used when authorizing this provider. - #[serde(rename = "authorization_flow")] - pub authorization_flow: uuid::Uuid, - /// Flow used ending the session from a provider. - #[serde(rename = "invalidation_flow")] - pub invalidation_flow: uuid::Uuid, - #[serde(rename = "property_mappings", skip_serializing_if = "Option::is_none")] - pub property_mappings: Option>, - /// 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. - #[serde(rename = "client_networks", skip_serializing_if = "Option::is_none")] - pub client_networks: Option, - /// Shared secret between clients and server to hash packets. - #[serde(rename = "shared_secret", skip_serializing_if = "Option::is_none")] - pub shared_secret: Option, - /// 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. - #[serde(rename = "mfa_support", skip_serializing_if = "Option::is_none")] - pub mfa_support: Option, - #[serde( - rename = "certificate", - default, - with = "::serde_with::rust::double_option", - skip_serializing_if = "Option::is_none" - )] - pub certificate: Option>, -} - -impl RadiusProviderRequest { - /// RadiusProvider Serializer - pub fn new( - name: String, - authorization_flow: uuid::Uuid, - invalidation_flow: uuid::Uuid, - ) -> RadiusProviderRequest { - RadiusProviderRequest { - name, - authentication_flow: None, - authorization_flow, - invalidation_flow, - property_mappings: None, - client_networks: None, - shared_secret: None, - mfa_support: None, - certificate: None, - } - } -} diff --git a/packages/client-rust/src/models/redirect_stage.rs b/packages/client-rust/src/models/redirect_stage.rs deleted file mode 100644 index 707626ba04..0000000000 --- a/packages/client-rust/src/models/redirect_stage.rs +++ /dev/null @@ -1,75 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// RedirectStage : RedirectStage Serializer -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct RedirectStage { - #[serde(rename = "pk")] - pub pk: uuid::Uuid, - #[serde(rename = "name")] - pub name: String, - /// Get object type so that we know how to edit the object - #[serde(rename = "component")] - pub component: String, - /// Return object's verbose_name - #[serde(rename = "verbose_name")] - pub verbose_name: String, - /// Return object's plural verbose_name - #[serde(rename = "verbose_name_plural")] - pub verbose_name_plural: String, - /// Return internal model name - #[serde(rename = "meta_model_name")] - pub meta_model_name: String, - #[serde(rename = "flow_set")] - pub flow_set: Vec, - #[serde(rename = "keep_context", skip_serializing_if = "Option::is_none")] - pub keep_context: Option, - #[serde(rename = "mode")] - pub mode: models::RedirectStageModeEnum, - #[serde(rename = "target_static", skip_serializing_if = "Option::is_none")] - pub target_static: Option, - #[serde( - rename = "target_flow", - default, - with = "::serde_with::rust::double_option", - skip_serializing_if = "Option::is_none" - )] - pub target_flow: Option>, -} - -impl RedirectStage { - /// RedirectStage Serializer - pub fn new( - pk: uuid::Uuid, - name: String, - component: String, - verbose_name: String, - verbose_name_plural: String, - meta_model_name: String, - flow_set: Vec, - mode: models::RedirectStageModeEnum, - ) -> RedirectStage { - RedirectStage { - pk, - name, - component, - verbose_name, - verbose_name_plural, - meta_model_name, - flow_set, - keep_context: None, - mode, - target_static: None, - target_flow: None, - } - } -} diff --git a/packages/client-rust/src/models/redirect_stage_mode_enum.rs b/packages/client-rust/src/models/redirect_stage_mode_enum.rs deleted file mode 100644 index 566490a0ef..0000000000 --- a/packages/client-rust/src/models/redirect_stage_mode_enum.rs +++ /dev/null @@ -1,35 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// -#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] -pub enum RedirectStageModeEnum { - #[serde(rename = "static")] - Static, - #[serde(rename = "flow")] - Flow, -} - -impl std::fmt::Display for RedirectStageModeEnum { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - match self { - Self::Static => write!(f, "static"), - Self::Flow => write!(f, "flow"), - } - } -} - -impl Default for RedirectStageModeEnum { - fn default() -> RedirectStageModeEnum { - Self::Static - } -} diff --git a/packages/client-rust/src/models/redirect_stage_request.rs b/packages/client-rust/src/models/redirect_stage_request.rs deleted file mode 100644 index a1cfa643fd..0000000000 --- a/packages/client-rust/src/models/redirect_stage_request.rs +++ /dev/null @@ -1,44 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// RedirectStageRequest : RedirectStage Serializer -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct RedirectStageRequest { - #[serde(rename = "name")] - pub name: String, - #[serde(rename = "keep_context", skip_serializing_if = "Option::is_none")] - pub keep_context: Option, - #[serde(rename = "mode")] - pub mode: models::RedirectStageModeEnum, - #[serde(rename = "target_static", skip_serializing_if = "Option::is_none")] - pub target_static: Option, - #[serde( - rename = "target_flow", - default, - with = "::serde_with::rust::double_option", - skip_serializing_if = "Option::is_none" - )] - pub target_flow: Option>, -} - -impl RedirectStageRequest { - /// RedirectStage Serializer - pub fn new(name: String, mode: models::RedirectStageModeEnum) -> RedirectStageRequest { - RedirectStageRequest { - name, - keep_context: None, - mode, - target_static: None, - target_flow: None, - } - } -} diff --git a/packages/client-rust/src/models/redirect_uri.rs b/packages/client-rust/src/models/redirect_uri.rs deleted file mode 100644 index b7b03e0d09..0000000000 --- a/packages/client-rust/src/models/redirect_uri.rs +++ /dev/null @@ -1,33 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// RedirectUri : A single allowed redirect URI entry -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct RedirectUri { - #[serde(rename = "matching_mode")] - pub matching_mode: models::MatchingModeEnum, - #[serde(rename = "url")] - pub url: String, - #[serde(rename = "redirect_uri_type", skip_serializing_if = "Option::is_none")] - pub redirect_uri_type: Option, -} - -impl RedirectUri { - /// A single allowed redirect URI entry - pub fn new(matching_mode: models::MatchingModeEnum, url: String) -> RedirectUri { - RedirectUri { - matching_mode, - url, - redirect_uri_type: None, - } - } -} diff --git a/packages/client-rust/src/models/redirect_uri_request.rs b/packages/client-rust/src/models/redirect_uri_request.rs deleted file mode 100644 index df8fd146da..0000000000 --- a/packages/client-rust/src/models/redirect_uri_request.rs +++ /dev/null @@ -1,33 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// RedirectUriRequest : A single allowed redirect URI entry -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct RedirectUriRequest { - #[serde(rename = "matching_mode")] - pub matching_mode: models::MatchingModeEnum, - #[serde(rename = "url")] - pub url: String, - #[serde(rename = "redirect_uri_type", skip_serializing_if = "Option::is_none")] - pub redirect_uri_type: Option, -} - -impl RedirectUriRequest { - /// A single allowed redirect URI entry - pub fn new(matching_mode: models::MatchingModeEnum, url: String) -> RedirectUriRequest { - RedirectUriRequest { - matching_mode, - url, - redirect_uri_type: None, - } - } -} diff --git a/packages/client-rust/src/models/redirect_uri_type_enum.rs b/packages/client-rust/src/models/redirect_uri_type_enum.rs deleted file mode 100644 index b93deb627b..0000000000 --- a/packages/client-rust/src/models/redirect_uri_type_enum.rs +++ /dev/null @@ -1,35 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// -#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] -pub enum RedirectUriTypeEnum { - #[serde(rename = "authorization")] - Authorization, - #[serde(rename = "logout")] - Logout, -} - -impl std::fmt::Display for RedirectUriTypeEnum { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - match self { - Self::Authorization => write!(f, "authorization"), - Self::Logout => write!(f, "logout"), - } - } -} - -impl Default for RedirectUriTypeEnum { - fn default() -> RedirectUriTypeEnum { - Self::Authorization - } -} diff --git a/packages/client-rust/src/models/reputation.rs b/packages/client-rust/src/models/reputation.rs deleted file mode 100644 index 889d217037..0000000000 --- a/packages/client-rust/src/models/reputation.rs +++ /dev/null @@ -1,45 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// Reputation : Reputation Serializer -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct Reputation { - #[serde(rename = "pk", skip_serializing_if = "Option::is_none")] - pub pk: Option, - #[serde(rename = "identifier")] - pub identifier: String, - #[serde(rename = "ip")] - pub ip: String, - #[serde(rename = "ip_geo_data", skip_serializing_if = "Option::is_none")] - pub ip_geo_data: Option>, - #[serde(rename = "ip_asn_data", skip_serializing_if = "Option::is_none")] - pub ip_asn_data: Option>, - #[serde(rename = "score", skip_serializing_if = "Option::is_none")] - pub score: Option, - #[serde(rename = "updated")] - pub updated: String, -} - -impl Reputation { - /// Reputation Serializer - pub fn new(identifier: String, ip: String, updated: String) -> Reputation { - Reputation { - pk: None, - identifier, - ip, - ip_geo_data: None, - ip_asn_data: None, - score: None, - updated, - } - } -} diff --git a/packages/client-rust/src/models/reputation_policy.rs b/packages/client-rust/src/models/reputation_policy.rs deleted file mode 100644 index 50c4aa5f8d..0000000000 --- a/packages/client-rust/src/models/reputation_policy.rs +++ /dev/null @@ -1,72 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// ReputationPolicy : Reputation Policy Serializer -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct ReputationPolicy { - #[serde(rename = "pk")] - pub pk: uuid::Uuid, - #[serde(rename = "name")] - pub name: String, - /// When this option is enabled, all executions of this policy will be logged. By default, only - /// execution errors are logged. - #[serde(rename = "execution_logging", skip_serializing_if = "Option::is_none")] - pub execution_logging: Option, - /// Get object component so that we know how to edit the object - #[serde(rename = "component")] - pub component: String, - /// Return object's verbose_name - #[serde(rename = "verbose_name")] - pub verbose_name: String, - /// Return object's plural verbose_name - #[serde(rename = "verbose_name_plural")] - pub verbose_name_plural: String, - /// Return internal model name - #[serde(rename = "meta_model_name")] - pub meta_model_name: String, - /// Return objects policy is bound to - #[serde(rename = "bound_to")] - pub bound_to: i32, - #[serde(rename = "check_ip", skip_serializing_if = "Option::is_none")] - pub check_ip: Option, - #[serde(rename = "check_username", skip_serializing_if = "Option::is_none")] - pub check_username: Option, - #[serde(rename = "threshold", skip_serializing_if = "Option::is_none")] - pub threshold: Option, -} - -impl ReputationPolicy { - /// Reputation Policy Serializer - pub fn new( - pk: uuid::Uuid, - name: String, - component: String, - verbose_name: String, - verbose_name_plural: String, - meta_model_name: String, - bound_to: i32, - ) -> ReputationPolicy { - ReputationPolicy { - pk, - name, - execution_logging: None, - component, - verbose_name, - verbose_name_plural, - meta_model_name, - bound_to, - check_ip: None, - check_username: None, - threshold: None, - } - } -} diff --git a/packages/client-rust/src/models/reputation_policy_request.rs b/packages/client-rust/src/models/reputation_policy_request.rs deleted file mode 100644 index a28b2971a4..0000000000 --- a/packages/client-rust/src/models/reputation_policy_request.rs +++ /dev/null @@ -1,41 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// ReputationPolicyRequest : Reputation Policy Serializer -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct ReputationPolicyRequest { - #[serde(rename = "name")] - pub name: String, - /// When this option is enabled, all executions of this policy will be logged. By default, only - /// execution errors are logged. - #[serde(rename = "execution_logging", skip_serializing_if = "Option::is_none")] - pub execution_logging: Option, - #[serde(rename = "check_ip", skip_serializing_if = "Option::is_none")] - pub check_ip: Option, - #[serde(rename = "check_username", skip_serializing_if = "Option::is_none")] - pub check_username: Option, - #[serde(rename = "threshold", skip_serializing_if = "Option::is_none")] - pub threshold: Option, -} - -impl ReputationPolicyRequest { - /// Reputation Policy Serializer - pub fn new(name: String) -> ReputationPolicyRequest { - ReputationPolicyRequest { - name, - execution_logging: None, - check_ip: None, - check_username: None, - threshold: None, - } - } -} diff --git a/packages/client-rust/src/models/review.rs b/packages/client-rust/src/models/review.rs deleted file mode 100644 index 1e32259f29..0000000000 --- a/packages/client-rust/src/models/review.rs +++ /dev/null @@ -1,50 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// Review : Mixin to validate that a valid enterprise license exists before allowing to save the -/// object -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct Review { - #[serde(rename = "id")] - pub id: uuid::Uuid, - #[serde(rename = "iteration")] - pub iteration: uuid::Uuid, - #[serde(rename = "reviewer")] - pub reviewer: models::ReviewerUser, - #[serde(rename = "timestamp")] - pub timestamp: String, - #[serde( - rename = "note", - default, - with = "::serde_with::rust::double_option", - skip_serializing_if = "Option::is_none" - )] - pub note: Option>, -} - -impl Review { - /// Mixin to validate that a valid enterprise license exists before allowing to save the object - pub fn new( - id: uuid::Uuid, - iteration: uuid::Uuid, - reviewer: models::ReviewerUser, - timestamp: String, - ) -> Review { - Review { - id, - iteration, - reviewer, - timestamp, - note: None, - } - } -} diff --git a/packages/client-rust/src/models/review_request.rs b/packages/client-rust/src/models/review_request.rs deleted file mode 100644 index 7ec38166b9..0000000000 --- a/packages/client-rust/src/models/review_request.rs +++ /dev/null @@ -1,36 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// ReviewRequest : Mixin to validate that a valid enterprise license exists before allowing to save -/// the object -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct ReviewRequest { - #[serde(rename = "iteration")] - pub iteration: uuid::Uuid, - #[serde( - rename = "note", - default, - with = "::serde_with::rust::double_option", - skip_serializing_if = "Option::is_none" - )] - pub note: Option>, -} - -impl ReviewRequest { - /// Mixin to validate that a valid enterprise license exists before allowing to save the object - pub fn new(iteration: uuid::Uuid) -> ReviewRequest { - ReviewRequest { - iteration, - note: None, - } - } -} diff --git a/packages/client-rust/src/models/reviewer_group.rs b/packages/client-rust/src/models/reviewer_group.rs deleted file mode 100644 index 28dadef802..0000000000 --- a/packages/client-rust/src/models/reviewer_group.rs +++ /dev/null @@ -1,25 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct ReviewerGroup { - #[serde(rename = "pk")] - pub pk: uuid::Uuid, - #[serde(rename = "name")] - pub name: String, -} - -impl ReviewerGroup { - pub fn new(pk: uuid::Uuid, name: String) -> ReviewerGroup { - ReviewerGroup { pk, name } - } -} diff --git a/packages/client-rust/src/models/reviewer_user.rs b/packages/client-rust/src/models/reviewer_user.rs deleted file mode 100644 index a4c69f347f..0000000000 --- a/packages/client-rust/src/models/reviewer_user.rs +++ /dev/null @@ -1,36 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct ReviewerUser { - #[serde(rename = "pk")] - pub pk: i32, - #[serde(rename = "uuid")] - pub uuid: uuid::Uuid, - /// Required. 150 characters or fewer. Letters, digits and @/./+/-/_ only. - #[serde(rename = "username")] - pub username: String, - /// User's display name. - #[serde(rename = "name")] - pub name: String, -} - -impl ReviewerUser { - pub fn new(pk: i32, uuid: uuid::Uuid, username: String, name: String) -> ReviewerUser { - ReviewerUser { - pk, - uuid, - username, - name, - } - } -} diff --git a/packages/client-rust/src/models/role_assigned_object_permission.rs b/packages/client-rust/src/models/role_assigned_object_permission.rs deleted file mode 100644 index 3109c42460..0000000000 --- a/packages/client-rust/src/models/role_assigned_object_permission.rs +++ /dev/null @@ -1,41 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// RoleAssignedObjectPermission : Roles assigned object permission serializer -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct RoleAssignedObjectPermission { - #[serde(rename = "role_pk")] - pub role_pk: String, - #[serde(rename = "name")] - pub name: String, - #[serde(rename = "object_permissions")] - pub object_permissions: Vec, - #[serde(rename = "model_permissions")] - pub model_permissions: Vec, -} - -impl RoleAssignedObjectPermission { - /// Roles assigned object permission serializer - pub fn new( - role_pk: String, - name: String, - object_permissions: Vec, - model_permissions: Vec, - ) -> RoleAssignedObjectPermission { - RoleAssignedObjectPermission { - role_pk, - name, - object_permissions, - model_permissions, - } - } -} diff --git a/packages/client-rust/src/models/role_model_permission.rs b/packages/client-rust/src/models/role_model_permission.rs deleted file mode 100644 index 6cf8046f43..0000000000 --- a/packages/client-rust/src/models/role_model_permission.rs +++ /dev/null @@ -1,45 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// RoleModelPermission : Role-bound object level permission -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct RoleModelPermission { - #[serde(rename = "id")] - pub id: i32, - #[serde(rename = "codename")] - pub codename: String, - #[serde(rename = "model")] - pub model: String, - #[serde(rename = "app_label")] - pub app_label: String, - #[serde(rename = "name")] - pub name: String, -} - -impl RoleModelPermission { - /// Role-bound object level permission - pub fn new( - id: i32, - codename: String, - model: String, - app_label: String, - name: String, - ) -> RoleModelPermission { - RoleModelPermission { - id, - codename, - model, - app_label, - name, - } - } -} diff --git a/packages/client-rust/src/models/role_object_permission.rs b/packages/client-rust/src/models/role_object_permission.rs deleted file mode 100644 index ab5185fd90..0000000000 --- a/packages/client-rust/src/models/role_object_permission.rs +++ /dev/null @@ -1,49 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// RoleObjectPermission : Role-bound object level permission -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct RoleObjectPermission { - #[serde(rename = "id")] - pub id: i32, - #[serde(rename = "codename")] - pub codename: String, - #[serde(rename = "model")] - pub model: String, - #[serde(rename = "app_label")] - pub app_label: String, - #[serde(rename = "object_pk")] - pub object_pk: String, - #[serde(rename = "name")] - pub name: String, -} - -impl RoleObjectPermission { - /// Role-bound object level permission - pub fn new( - id: i32, - codename: String, - model: String, - app_label: String, - object_pk: String, - name: String, - ) -> RoleObjectPermission { - RoleObjectPermission { - id, - codename, - model, - app_label, - object_pk, - name, - } - } -} diff --git a/packages/client-rust/src/models/role_request.rs b/packages/client-rust/src/models/role_request.rs deleted file mode 100644 index 8c8c080e20..0000000000 --- a/packages/client-rust/src/models/role_request.rs +++ /dev/null @@ -1,25 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// RoleRequest : Role serializer -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct RoleRequest { - #[serde(rename = "name")] - pub name: String, -} - -impl RoleRequest { - /// Role serializer - pub fn new(name: String) -> RoleRequest { - RoleRequest { name } - } -} diff --git a/packages/client-rust/src/models/saml_logout_methods.rs b/packages/client-rust/src/models/saml_logout_methods.rs deleted file mode 100644 index d5f6e2a3ea..0000000000 --- a/packages/client-rust/src/models/saml_logout_methods.rs +++ /dev/null @@ -1,38 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// -#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] -pub enum SamlLogoutMethods { - #[serde(rename = "frontchannel_iframe")] - FrontchannelIframe, - #[serde(rename = "frontchannel_native")] - FrontchannelNative, - #[serde(rename = "backchannel")] - Backchannel, -} - -impl std::fmt::Display for SamlLogoutMethods { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - match self { - Self::FrontchannelIframe => write!(f, "frontchannel_iframe"), - Self::FrontchannelNative => write!(f, "frontchannel_native"), - Self::Backchannel => write!(f, "backchannel"), - } - } -} - -impl Default for SamlLogoutMethods { - fn default() -> SamlLogoutMethods { - Self::FrontchannelIframe - } -} diff --git a/packages/client-rust/src/models/saml_metadata.rs b/packages/client-rust/src/models/saml_metadata.rs deleted file mode 100644 index 15820da888..0000000000 --- a/packages/client-rust/src/models/saml_metadata.rs +++ /dev/null @@ -1,35 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// SamlMetadata : SAML Provider Metadata serializer -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct SamlMetadata { - #[serde(rename = "metadata")] - pub metadata: String, - #[serde( - rename = "download_url", - default, - with = "::serde_with::rust::double_option", - skip_serializing_if = "Option::is_none" - )] - pub download_url: Option>, -} - -impl SamlMetadata { - /// SAML Provider Metadata serializer - pub fn new(metadata: String) -> SamlMetadata { - SamlMetadata { - metadata, - download_url: None, - } - } -} diff --git a/packages/client-rust/src/models/saml_name_id_policy_enum.rs b/packages/client-rust/src/models/saml_name_id_policy_enum.rs deleted file mode 100644 index 35547440ff..0000000000 --- a/packages/client-rust/src/models/saml_name_id_policy_enum.rs +++ /dev/null @@ -1,47 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// -#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] -pub enum SamlNameIdPolicyEnum { - #[serde(rename = "urn:oasis:names:tc:SAML:1.1:nameid-format:emailAddress")] - UrnColonOasisColonNamesColonTcColonSamlColon11ColonNameidFormatColonEmailAddress, - #[serde(rename = "urn:oasis:names:tc:SAML:2.0:nameid-format:persistent")] - UrnColonOasisColonNamesColonTcColonSamlColon20ColonNameidFormatColonPersistent, - #[serde(rename = "urn:oasis:names:tc:SAML:1.1:nameid-format:X509SubjectName")] - UrnColonOasisColonNamesColonTcColonSamlColon11ColonNameidFormatColonX509SubjectName, - #[serde(rename = "urn:oasis:names:tc:SAML:2.0:nameid-format:WindowsDomainQualifiedName")] - UrnColonOasisColonNamesColonTcColonSamlColon20ColonNameidFormatColonWindowsDomainQualifiedName, - #[serde(rename = "urn:oasis:names:tc:SAML:2.0:nameid-format:transient")] - UrnColonOasisColonNamesColonTcColonSamlColon20ColonNameidFormatColonTransient, - #[serde(rename = "urn:oasis:names:tc:SAML:1.1:nameid-format:unspecified")] - UrnColonOasisColonNamesColonTcColonSamlColon11ColonNameidFormatColonUnspecified, -} - -impl std::fmt::Display for SamlNameIdPolicyEnum { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - match self { - Self::UrnColonOasisColonNamesColonTcColonSamlColon11ColonNameidFormatColonEmailAddress => write!(f, "urn:oasis:names:tc:SAML:1.1:nameid-format:emailAddress"), - Self::UrnColonOasisColonNamesColonTcColonSamlColon20ColonNameidFormatColonPersistent => write!(f, "urn:oasis:names:tc:SAML:2.0:nameid-format:persistent"), - Self::UrnColonOasisColonNamesColonTcColonSamlColon11ColonNameidFormatColonX509SubjectName => write!(f, "urn:oasis:names:tc:SAML:1.1:nameid-format:X509SubjectName"), - Self::UrnColonOasisColonNamesColonTcColonSamlColon20ColonNameidFormatColonWindowsDomainQualifiedName => write!(f, "urn:oasis:names:tc:SAML:2.0:nameid-format:WindowsDomainQualifiedName"), - Self::UrnColonOasisColonNamesColonTcColonSamlColon20ColonNameidFormatColonTransient => write!(f, "urn:oasis:names:tc:SAML:2.0:nameid-format:transient"), - Self::UrnColonOasisColonNamesColonTcColonSamlColon11ColonNameidFormatColonUnspecified => write!(f, "urn:oasis:names:tc:SAML:1.1:nameid-format:unspecified"), - } - } -} - -impl Default for SamlNameIdPolicyEnum { - fn default() -> SamlNameIdPolicyEnum { - Self::UrnColonOasisColonNamesColonTcColonSamlColon11ColonNameidFormatColonEmailAddress - } -} diff --git a/packages/client-rust/src/models/saml_property_mapping.rs b/packages/client-rust/src/models/saml_property_mapping.rs deleted file mode 100644 index 83c5822f42..0000000000 --- a/packages/client-rust/src/models/saml_property_mapping.rs +++ /dev/null @@ -1,80 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// SamlPropertyMapping : SAMLPropertyMapping Serializer -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct SamlPropertyMapping { - #[serde(rename = "pk")] - pub pk: uuid::Uuid, - /// 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. - #[serde( - rename = "managed", - default, - with = "::serde_with::rust::double_option", - skip_serializing_if = "Option::is_none" - )] - pub managed: Option>, - #[serde(rename = "name")] - pub name: String, - #[serde(rename = "expression")] - pub expression: String, - /// Get object's component so that we know how to edit the object - #[serde(rename = "component")] - pub component: String, - /// Return object's verbose_name - #[serde(rename = "verbose_name")] - pub verbose_name: String, - /// Return object's plural verbose_name - #[serde(rename = "verbose_name_plural")] - pub verbose_name_plural: String, - /// Return internal model name - #[serde(rename = "meta_model_name")] - pub meta_model_name: String, - #[serde(rename = "saml_name")] - pub saml_name: String, - #[serde( - rename = "friendly_name", - default, - with = "::serde_with::rust::double_option", - skip_serializing_if = "Option::is_none" - )] - pub friendly_name: Option>, -} - -impl SamlPropertyMapping { - /// SAMLPropertyMapping Serializer - pub fn new( - pk: uuid::Uuid, - name: String, - expression: String, - component: String, - verbose_name: String, - verbose_name_plural: String, - meta_model_name: String, - saml_name: String, - ) -> SamlPropertyMapping { - SamlPropertyMapping { - pk, - managed: None, - name, - expression, - component, - verbose_name, - verbose_name_plural, - meta_model_name, - saml_name, - friendly_name: None, - } - } -} diff --git a/packages/client-rust/src/models/saml_property_mapping_request.rs b/packages/client-rust/src/models/saml_property_mapping_request.rs deleted file mode 100644 index bd72e535c7..0000000000 --- a/packages/client-rust/src/models/saml_property_mapping_request.rs +++ /dev/null @@ -1,52 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// SamlPropertyMappingRequest : SAMLPropertyMapping Serializer -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct SamlPropertyMappingRequest { - /// 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. - #[serde( - rename = "managed", - default, - with = "::serde_with::rust::double_option", - skip_serializing_if = "Option::is_none" - )] - pub managed: Option>, - #[serde(rename = "name")] - pub name: String, - #[serde(rename = "expression")] - pub expression: String, - #[serde(rename = "saml_name")] - pub saml_name: String, - #[serde( - rename = "friendly_name", - default, - with = "::serde_with::rust::double_option", - skip_serializing_if = "Option::is_none" - )] - pub friendly_name: Option>, -} - -impl SamlPropertyMappingRequest { - /// SAMLPropertyMapping Serializer - pub fn new(name: String, expression: String, saml_name: String) -> SamlPropertyMappingRequest { - SamlPropertyMappingRequest { - managed: None, - name, - expression, - saml_name, - friendly_name: None, - } - } -} diff --git a/packages/client-rust/src/models/saml_provider.rs b/packages/client-rust/src/models/saml_provider.rs deleted file mode 100644 index 8649bd6ccc..0000000000 --- a/packages/client-rust/src/models/saml_provider.rs +++ /dev/null @@ -1,284 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// SamlProvider : SAMLProvider Serializer -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct SamlProvider { - #[serde(rename = "pk")] - pub pk: i32, - #[serde(rename = "name")] - pub name: String, - /// Flow used for authentication when the associated application is accessed by an - /// un-authenticated user. - #[serde( - rename = "authentication_flow", - default, - with = "::serde_with::rust::double_option", - skip_serializing_if = "Option::is_none" - )] - pub authentication_flow: Option>, - /// Flow used when authorizing this provider. - #[serde(rename = "authorization_flow")] - pub authorization_flow: uuid::Uuid, - /// Flow used ending the session from a provider. - #[serde(rename = "invalidation_flow")] - pub invalidation_flow: uuid::Uuid, - #[serde(rename = "property_mappings", skip_serializing_if = "Option::is_none")] - pub property_mappings: Option>, - /// Get object component so that we know how to edit the object - #[serde(rename = "component")] - pub component: String, - /// Internal application name, used in URLs. - #[serde( - rename = "assigned_application_slug", - deserialize_with = "Option::deserialize" - )] - pub assigned_application_slug: Option, - /// Application's display Name. - #[serde( - rename = "assigned_application_name", - deserialize_with = "Option::deserialize" - )] - pub assigned_application_name: Option, - /// Internal application name, used in URLs. - #[serde( - rename = "assigned_backchannel_application_slug", - deserialize_with = "Option::deserialize" - )] - pub assigned_backchannel_application_slug: Option, - /// Application's display Name. - #[serde( - rename = "assigned_backchannel_application_name", - deserialize_with = "Option::deserialize" - )] - pub assigned_backchannel_application_name: Option, - /// Return object's verbose_name - #[serde(rename = "verbose_name")] - pub verbose_name: String, - /// Return object's plural verbose_name - #[serde(rename = "verbose_name_plural")] - pub verbose_name_plural: String, - /// Return internal model name - #[serde(rename = "meta_model_name")] - pub meta_model_name: String, - #[serde(rename = "acs_url")] - pub acs_url: String, - /// Single Logout Service URL where the logout response should be sent. - #[serde(rename = "sls_url", skip_serializing_if = "Option::is_none")] - pub sls_url: Option, - /// Value of the audience restriction field of the assertion. When left empty, no audience - /// restriction will be added. - #[serde(rename = "audience", skip_serializing_if = "Option::is_none")] - pub audience: Option, - /// Also known as EntityID - #[serde(rename = "issuer", skip_serializing_if = "Option::is_none")] - pub issuer: Option, - /// Assertion valid not before current time + this value (Format: - /// hours=-1;minutes=-2;seconds=-3). - #[serde( - rename = "assertion_valid_not_before", - skip_serializing_if = "Option::is_none" - )] - pub assertion_valid_not_before: Option, - /// Assertion not valid on or after current time + this value (Format: - /// hours=1;minutes=2;seconds=3). - #[serde( - rename = "assertion_valid_not_on_or_after", - skip_serializing_if = "Option::is_none" - )] - pub assertion_valid_not_on_or_after: Option, - /// Session not valid on or after current time + this value (Format: - /// hours=1;minutes=2;seconds=3). - #[serde( - rename = "session_valid_not_on_or_after", - skip_serializing_if = "Option::is_none" - )] - pub session_valid_not_on_or_after: Option, - /// Configure how the NameID value will be created. When left empty, the NameIDPolicy of the - /// incoming request will be considered - #[serde( - rename = "name_id_mapping", - default, - with = "::serde_with::rust::double_option", - skip_serializing_if = "Option::is_none" - )] - pub name_id_mapping: Option>, - /// 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. - #[serde( - rename = "authn_context_class_ref_mapping", - default, - with = "::serde_with::rust::double_option", - skip_serializing_if = "Option::is_none" - )] - pub authn_context_class_ref_mapping: Option>, - #[serde(rename = "digest_algorithm", skip_serializing_if = "Option::is_none")] - pub digest_algorithm: Option, - #[serde( - rename = "signature_algorithm", - skip_serializing_if = "Option::is_none" - )] - pub signature_algorithm: Option, - /// Keypair used to sign outgoing Responses going to the Service Provider. - #[serde( - rename = "signing_kp", - default, - with = "::serde_with::rust::double_option", - skip_serializing_if = "Option::is_none" - )] - pub signing_kp: Option>, - /// When selected, incoming assertion's Signatures will be validated against this certificate. - /// To allow unsigned Requests, leave on default. - #[serde( - rename = "verification_kp", - default, - with = "::serde_with::rust::double_option", - skip_serializing_if = "Option::is_none" - )] - pub verification_kp: Option>, - /// 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. - #[serde( - rename = "encryption_kp", - default, - with = "::serde_with::rust::double_option", - skip_serializing_if = "Option::is_none" - )] - pub encryption_kp: Option>, - #[serde(rename = "sign_assertion", skip_serializing_if = "Option::is_none")] - pub sign_assertion: Option, - #[serde(rename = "sign_response", skip_serializing_if = "Option::is_none")] - pub sign_response: Option, - #[serde( - rename = "sign_logout_request", - skip_serializing_if = "Option::is_none" - )] - pub sign_logout_request: Option, - #[serde( - rename = "sign_logout_response", - skip_serializing_if = "Option::is_none" - )] - pub sign_logout_response: Option, - /// This determines how authentik sends the response back to the Service Provider. - #[serde(rename = "sp_binding", skip_serializing_if = "Option::is_none")] - pub sp_binding: Option, - /// This determines how authentik sends the logout response back to the Service Provider. - #[serde(rename = "sls_binding", skip_serializing_if = "Option::is_none")] - pub sls_binding: Option, - /// 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). - #[serde(rename = "logout_method", skip_serializing_if = "Option::is_none")] - pub logout_method: Option, - /// Default relay_state value for IDP-initiated logins - #[serde( - rename = "default_relay_state", - skip_serializing_if = "Option::is_none" - )] - pub default_relay_state: Option, - #[serde( - rename = "default_name_id_policy", - skip_serializing_if = "Option::is_none" - )] - pub default_name_id_policy: Option, - /// Get metadata download URL - #[serde(rename = "url_download_metadata")] - pub url_download_metadata: String, - /// Get SSO Post URL - #[serde(rename = "url_sso_post")] - pub url_sso_post: String, - /// Get SSO Redirect URL - #[serde(rename = "url_sso_redirect")] - pub url_sso_redirect: String, - /// Get SSO IDP-Initiated URL - #[serde(rename = "url_sso_init")] - pub url_sso_init: String, - /// Get SLO POST URL - #[serde(rename = "url_slo_post")] - pub url_slo_post: String, - /// Get SLO redirect URL - #[serde(rename = "url_slo_redirect")] - pub url_slo_redirect: String, -} - -impl SamlProvider { - /// SAMLProvider Serializer - pub fn new( - pk: i32, - name: String, - authorization_flow: uuid::Uuid, - invalidation_flow: uuid::Uuid, - component: String, - assigned_application_slug: Option, - assigned_application_name: Option, - assigned_backchannel_application_slug: Option, - assigned_backchannel_application_name: Option, - verbose_name: String, - verbose_name_plural: String, - meta_model_name: String, - acs_url: String, - url_download_metadata: String, - url_sso_post: String, - url_sso_redirect: String, - url_sso_init: String, - url_slo_post: String, - url_slo_redirect: String, - ) -> SamlProvider { - SamlProvider { - pk, - name, - authentication_flow: None, - authorization_flow, - invalidation_flow, - property_mappings: None, - 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, - sls_url: None, - audience: None, - issuer: None, - assertion_valid_not_before: None, - assertion_valid_not_on_or_after: None, - session_valid_not_on_or_after: None, - name_id_mapping: None, - authn_context_class_ref_mapping: None, - digest_algorithm: None, - signature_algorithm: None, - signing_kp: None, - verification_kp: None, - encryption_kp: None, - sign_assertion: None, - sign_response: None, - sign_logout_request: None, - sign_logout_response: None, - sp_binding: None, - sls_binding: None, - logout_method: None, - default_relay_state: None, - default_name_id_policy: None, - url_download_metadata, - url_sso_post, - url_sso_redirect, - url_sso_init, - url_slo_post, - url_slo_redirect, - } - } -} diff --git a/packages/client-rust/src/models/saml_provider_request.rs b/packages/client-rust/src/models/saml_provider_request.rs deleted file mode 100644 index 8f943fed86..0000000000 --- a/packages/client-rust/src/models/saml_provider_request.rs +++ /dev/null @@ -1,198 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// SamlProviderRequest : SAMLProvider Serializer -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct SamlProviderRequest { - #[serde(rename = "name")] - pub name: String, - /// Flow used for authentication when the associated application is accessed by an - /// un-authenticated user. - #[serde( - rename = "authentication_flow", - default, - with = "::serde_with::rust::double_option", - skip_serializing_if = "Option::is_none" - )] - pub authentication_flow: Option>, - /// Flow used when authorizing this provider. - #[serde(rename = "authorization_flow")] - pub authorization_flow: uuid::Uuid, - /// Flow used ending the session from a provider. - #[serde(rename = "invalidation_flow")] - pub invalidation_flow: uuid::Uuid, - #[serde(rename = "property_mappings", skip_serializing_if = "Option::is_none")] - pub property_mappings: Option>, - #[serde(rename = "acs_url")] - pub acs_url: String, - /// Single Logout Service URL where the logout response should be sent. - #[serde(rename = "sls_url", skip_serializing_if = "Option::is_none")] - pub sls_url: Option, - /// Value of the audience restriction field of the assertion. When left empty, no audience - /// restriction will be added. - #[serde(rename = "audience", skip_serializing_if = "Option::is_none")] - pub audience: Option, - /// Also known as EntityID - #[serde(rename = "issuer", skip_serializing_if = "Option::is_none")] - pub issuer: Option, - /// Assertion valid not before current time + this value (Format: - /// hours=-1;minutes=-2;seconds=-3). - #[serde( - rename = "assertion_valid_not_before", - skip_serializing_if = "Option::is_none" - )] - pub assertion_valid_not_before: Option, - /// Assertion not valid on or after current time + this value (Format: - /// hours=1;minutes=2;seconds=3). - #[serde( - rename = "assertion_valid_not_on_or_after", - skip_serializing_if = "Option::is_none" - )] - pub assertion_valid_not_on_or_after: Option, - /// Session not valid on or after current time + this value (Format: - /// hours=1;minutes=2;seconds=3). - #[serde( - rename = "session_valid_not_on_or_after", - skip_serializing_if = "Option::is_none" - )] - pub session_valid_not_on_or_after: Option, - /// Configure how the NameID value will be created. When left empty, the NameIDPolicy of the - /// incoming request will be considered - #[serde( - rename = "name_id_mapping", - default, - with = "::serde_with::rust::double_option", - skip_serializing_if = "Option::is_none" - )] - pub name_id_mapping: Option>, - /// 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. - #[serde( - rename = "authn_context_class_ref_mapping", - default, - with = "::serde_with::rust::double_option", - skip_serializing_if = "Option::is_none" - )] - pub authn_context_class_ref_mapping: Option>, - #[serde(rename = "digest_algorithm", skip_serializing_if = "Option::is_none")] - pub digest_algorithm: Option, - #[serde( - rename = "signature_algorithm", - skip_serializing_if = "Option::is_none" - )] - pub signature_algorithm: Option, - /// Keypair used to sign outgoing Responses going to the Service Provider. - #[serde( - rename = "signing_kp", - default, - with = "::serde_with::rust::double_option", - skip_serializing_if = "Option::is_none" - )] - pub signing_kp: Option>, - /// When selected, incoming assertion's Signatures will be validated against this certificate. - /// To allow unsigned Requests, leave on default. - #[serde( - rename = "verification_kp", - default, - with = "::serde_with::rust::double_option", - skip_serializing_if = "Option::is_none" - )] - pub verification_kp: Option>, - /// 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. - #[serde( - rename = "encryption_kp", - default, - with = "::serde_with::rust::double_option", - skip_serializing_if = "Option::is_none" - )] - pub encryption_kp: Option>, - #[serde(rename = "sign_assertion", skip_serializing_if = "Option::is_none")] - pub sign_assertion: Option, - #[serde(rename = "sign_response", skip_serializing_if = "Option::is_none")] - pub sign_response: Option, - #[serde( - rename = "sign_logout_request", - skip_serializing_if = "Option::is_none" - )] - pub sign_logout_request: Option, - #[serde( - rename = "sign_logout_response", - skip_serializing_if = "Option::is_none" - )] - pub sign_logout_response: Option, - /// This determines how authentik sends the response back to the Service Provider. - #[serde(rename = "sp_binding", skip_serializing_if = "Option::is_none")] - pub sp_binding: Option, - /// This determines how authentik sends the logout response back to the Service Provider. - #[serde(rename = "sls_binding", skip_serializing_if = "Option::is_none")] - pub sls_binding: Option, - /// 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). - #[serde(rename = "logout_method", skip_serializing_if = "Option::is_none")] - pub logout_method: Option, - /// Default relay_state value for IDP-initiated logins - #[serde( - rename = "default_relay_state", - skip_serializing_if = "Option::is_none" - )] - pub default_relay_state: Option, - #[serde( - rename = "default_name_id_policy", - skip_serializing_if = "Option::is_none" - )] - pub default_name_id_policy: Option, -} - -impl SamlProviderRequest { - /// SAMLProvider Serializer - pub fn new( - name: String, - authorization_flow: uuid::Uuid, - invalidation_flow: uuid::Uuid, - acs_url: String, - ) -> SamlProviderRequest { - SamlProviderRequest { - name, - authentication_flow: None, - authorization_flow, - invalidation_flow, - property_mappings: None, - acs_url, - sls_url: None, - audience: None, - issuer: None, - assertion_valid_not_before: None, - assertion_valid_not_on_or_after: None, - session_valid_not_on_or_after: None, - name_id_mapping: None, - authn_context_class_ref_mapping: None, - digest_algorithm: None, - signature_algorithm: None, - signing_kp: None, - verification_kp: None, - encryption_kp: None, - sign_assertion: None, - sign_response: None, - sign_logout_request: None, - sign_logout_response: None, - sp_binding: None, - sls_binding: None, - logout_method: None, - default_relay_state: None, - default_name_id_policy: None, - } - } -} diff --git a/packages/client-rust/src/models/saml_source.rs b/packages/client-rust/src/models/saml_source.rs deleted file mode 100644 index 8926ef83fa..0000000000 --- a/packages/client-rust/src/models/saml_source.rs +++ /dev/null @@ -1,228 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// SamlSource : SAMLSource Serializer -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct SamlSource { - #[serde(rename = "pk")] - pub pk: uuid::Uuid, - /// Source's display Name. - #[serde(rename = "name")] - pub name: String, - /// Internal source name, used in URLs. - #[serde(rename = "slug")] - pub slug: String, - #[serde(rename = "enabled", skip_serializing_if = "Option::is_none")] - pub enabled: Option, - /// When enabled, this source will be displayed as a prominent button on the login page, - /// instead of a small icon. - #[serde(rename = "promoted", skip_serializing_if = "Option::is_none")] - pub promoted: Option, - /// Flow to use when authenticating existing users. - #[serde( - rename = "authentication_flow", - default, - with = "::serde_with::rust::double_option", - skip_serializing_if = "Option::is_none" - )] - pub authentication_flow: Option>, - /// Flow to use when enrolling new users. - #[serde( - rename = "enrollment_flow", - default, - with = "::serde_with::rust::double_option", - skip_serializing_if = "Option::is_none" - )] - pub enrollment_flow: Option>, - #[serde( - rename = "user_property_mappings", - skip_serializing_if = "Option::is_none" - )] - pub user_property_mappings: Option>, - #[serde( - rename = "group_property_mappings", - skip_serializing_if = "Option::is_none" - )] - pub group_property_mappings: Option>, - /// Get object component so that we know how to edit the object - #[serde(rename = "component")] - pub component: String, - /// Return object's verbose_name - #[serde(rename = "verbose_name")] - pub verbose_name: String, - /// Return object's plural verbose_name - #[serde(rename = "verbose_name_plural")] - pub verbose_name_plural: String, - /// Return internal model name - #[serde(rename = "meta_model_name")] - pub meta_model_name: String, - #[serde(rename = "policy_engine_mode", skip_serializing_if = "Option::is_none")] - pub policy_engine_mode: Option, - /// How the source determines if an existing user should be authenticated or a new user - /// enrolled. - #[serde(rename = "user_matching_mode", skip_serializing_if = "Option::is_none")] - pub user_matching_mode: Option, - /// 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. - #[serde(rename = "managed", deserialize_with = "Option::deserialize")] - pub managed: Option, - #[serde(rename = "user_path_template", skip_serializing_if = "Option::is_none")] - pub user_path_template: Option, - #[serde(rename = "icon", skip_serializing_if = "Option::is_none")] - pub icon: Option, - #[serde(rename = "icon_url")] - pub icon_url: String, - #[serde(rename = "icon_themed_urls", deserialize_with = "Option::deserialize")] - pub icon_themed_urls: Option, - /// How the source determines if an existing group should be used or a new group created. - #[serde( - rename = "group_matching_mode", - skip_serializing_if = "Option::is_none" - )] - pub group_matching_mode: Option, - /// Flow used before authentication. - #[serde(rename = "pre_authentication_flow")] - pub pre_authentication_flow: uuid::Uuid, - /// Also known as Entity ID. Defaults the Metadata URL. - #[serde(rename = "issuer", skip_serializing_if = "Option::is_none")] - pub issuer: Option, - /// URL that the initial Login request is sent to. - #[serde(rename = "sso_url")] - pub sso_url: String, - /// Optional URL if your IDP supports Single-Logout. - #[serde( - rename = "slo_url", - default, - with = "::serde_with::rust::double_option", - skip_serializing_if = "Option::is_none" - )] - pub slo_url: Option>, - /// Allows authentication flows initiated by the IdP. This can be a security risk, as no - /// validation of the request ID is done. - #[serde( - rename = "allow_idp_initiated", - skip_serializing_if = "Option::is_none" - )] - pub allow_idp_initiated: Option, - /// When enabled, the IdP will re-authenticate the user even if a session exists. - #[serde(rename = "force_authn", skip_serializing_if = "Option::is_none")] - pub force_authn: Option, - /// NameID Policy sent to the IdP. Can be unset, in which case no Policy is sent. - #[serde(rename = "name_id_policy", skip_serializing_if = "Option::is_none")] - pub name_id_policy: Option, - #[serde(rename = "binding_type", skip_serializing_if = "Option::is_none")] - pub binding_type: Option, - /// When selected, incoming assertion's Signatures will be validated against this certificate. - /// To allow unsigned Requests, leave on default. - #[serde( - rename = "verification_kp", - default, - with = "::serde_with::rust::double_option", - skip_serializing_if = "Option::is_none" - )] - pub verification_kp: Option>, - /// Keypair used to sign outgoing Responses going to the Identity Provider. - #[serde( - rename = "signing_kp", - default, - with = "::serde_with::rust::double_option", - skip_serializing_if = "Option::is_none" - )] - pub signing_kp: Option>, - #[serde(rename = "digest_algorithm", skip_serializing_if = "Option::is_none")] - pub digest_algorithm: Option, - #[serde( - rename = "signature_algorithm", - skip_serializing_if = "Option::is_none" - )] - pub signature_algorithm: Option, - /// 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). - #[serde( - rename = "temporary_user_delete_after", - skip_serializing_if = "Option::is_none" - )] - pub temporary_user_delete_after: Option, - /// 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. - #[serde( - rename = "encryption_kp", - default, - with = "::serde_with::rust::double_option", - skip_serializing_if = "Option::is_none" - )] - pub encryption_kp: Option>, - #[serde(rename = "signed_assertion", skip_serializing_if = "Option::is_none")] - pub signed_assertion: Option, - #[serde(rename = "signed_response", skip_serializing_if = "Option::is_none")] - pub signed_response: Option, -} - -impl SamlSource { - /// SAMLSource Serializer - pub fn new( - pk: uuid::Uuid, - name: String, - slug: String, - component: String, - verbose_name: String, - verbose_name_plural: String, - meta_model_name: String, - managed: Option, - icon_url: String, - icon_themed_urls: Option, - pre_authentication_flow: uuid::Uuid, - sso_url: String, - ) -> SamlSource { - SamlSource { - pk, - name, - slug, - enabled: None, - promoted: None, - authentication_flow: None, - enrollment_flow: None, - user_property_mappings: None, - group_property_mappings: None, - component, - verbose_name, - verbose_name_plural, - meta_model_name, - policy_engine_mode: None, - user_matching_mode: None, - managed, - user_path_template: None, - icon: None, - icon_url, - icon_themed_urls, - group_matching_mode: None, - pre_authentication_flow, - issuer: None, - sso_url, - slo_url: None, - allow_idp_initiated: None, - force_authn: None, - name_id_policy: None, - binding_type: None, - verification_kp: None, - signing_kp: None, - digest_algorithm: None, - signature_algorithm: None, - temporary_user_delete_after: None, - encryption_kp: None, - signed_assertion: None, - signed_response: None, - } - } -} diff --git a/packages/client-rust/src/models/saml_source_property_mapping.rs b/packages/client-rust/src/models/saml_source_property_mapping.rs deleted file mode 100644 index ed1b109b97..0000000000 --- a/packages/client-rust/src/models/saml_source_property_mapping.rs +++ /dev/null @@ -1,68 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// SamlSourcePropertyMapping : SAMLSourcePropertyMapping Serializer -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct SamlSourcePropertyMapping { - #[serde(rename = "pk")] - pub pk: uuid::Uuid, - /// 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. - #[serde( - rename = "managed", - default, - with = "::serde_with::rust::double_option", - skip_serializing_if = "Option::is_none" - )] - pub managed: Option>, - #[serde(rename = "name")] - pub name: String, - #[serde(rename = "expression")] - pub expression: String, - /// Get object's component so that we know how to edit the object - #[serde(rename = "component")] - pub component: String, - /// Return object's verbose_name - #[serde(rename = "verbose_name")] - pub verbose_name: String, - /// Return object's plural verbose_name - #[serde(rename = "verbose_name_plural")] - pub verbose_name_plural: String, - /// Return internal model name - #[serde(rename = "meta_model_name")] - pub meta_model_name: String, -} - -impl SamlSourcePropertyMapping { - /// SAMLSourcePropertyMapping Serializer - pub fn new( - pk: uuid::Uuid, - name: String, - expression: String, - component: String, - verbose_name: String, - verbose_name_plural: String, - meta_model_name: String, - ) -> SamlSourcePropertyMapping { - SamlSourcePropertyMapping { - pk, - managed: None, - name, - expression, - component, - verbose_name, - verbose_name_plural, - meta_model_name, - } - } -} diff --git a/packages/client-rust/src/models/saml_source_property_mapping_request.rs b/packages/client-rust/src/models/saml_source_property_mapping_request.rs deleted file mode 100644 index 7fc15156f7..0000000000 --- a/packages/client-rust/src/models/saml_source_property_mapping_request.rs +++ /dev/null @@ -1,41 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// SamlSourcePropertyMappingRequest : SAMLSourcePropertyMapping Serializer -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct SamlSourcePropertyMappingRequest { - /// 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. - #[serde( - rename = "managed", - default, - with = "::serde_with::rust::double_option", - skip_serializing_if = "Option::is_none" - )] - pub managed: Option>, - #[serde(rename = "name")] - pub name: String, - #[serde(rename = "expression")] - pub expression: String, -} - -impl SamlSourcePropertyMappingRequest { - /// SAMLSourcePropertyMapping Serializer - pub fn new(name: String, expression: String) -> SamlSourcePropertyMappingRequest { - SamlSourcePropertyMappingRequest { - managed: None, - name, - expression, - } - } -} diff --git a/packages/client-rust/src/models/saml_source_request.rs b/packages/client-rust/src/models/saml_source_request.rs deleted file mode 100644 index 04a4af46b6..0000000000 --- a/packages/client-rust/src/models/saml_source_request.rs +++ /dev/null @@ -1,189 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// SamlSourceRequest : SAMLSource Serializer -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct SamlSourceRequest { - /// Source's display Name. - #[serde(rename = "name")] - pub name: String, - /// Internal source name, used in URLs. - #[serde(rename = "slug")] - pub slug: String, - #[serde(rename = "enabled", skip_serializing_if = "Option::is_none")] - pub enabled: Option, - /// When enabled, this source will be displayed as a prominent button on the login page, - /// instead of a small icon. - #[serde(rename = "promoted", skip_serializing_if = "Option::is_none")] - pub promoted: Option, - /// Flow to use when authenticating existing users. - #[serde( - rename = "authentication_flow", - default, - with = "::serde_with::rust::double_option", - skip_serializing_if = "Option::is_none" - )] - pub authentication_flow: Option>, - /// Flow to use when enrolling new users. - #[serde( - rename = "enrollment_flow", - default, - with = "::serde_with::rust::double_option", - skip_serializing_if = "Option::is_none" - )] - pub enrollment_flow: Option>, - #[serde( - rename = "user_property_mappings", - skip_serializing_if = "Option::is_none" - )] - pub user_property_mappings: Option>, - #[serde( - rename = "group_property_mappings", - skip_serializing_if = "Option::is_none" - )] - pub group_property_mappings: Option>, - #[serde(rename = "policy_engine_mode", skip_serializing_if = "Option::is_none")] - pub policy_engine_mode: Option, - /// How the source determines if an existing user should be authenticated or a new user - /// enrolled. - #[serde(rename = "user_matching_mode", skip_serializing_if = "Option::is_none")] - pub user_matching_mode: Option, - #[serde(rename = "user_path_template", skip_serializing_if = "Option::is_none")] - pub user_path_template: Option, - #[serde(rename = "icon", skip_serializing_if = "Option::is_none")] - pub icon: Option, - /// How the source determines if an existing group should be used or a new group created. - #[serde( - rename = "group_matching_mode", - skip_serializing_if = "Option::is_none" - )] - pub group_matching_mode: Option, - /// Flow used before authentication. - #[serde(rename = "pre_authentication_flow")] - pub pre_authentication_flow: uuid::Uuid, - /// Also known as Entity ID. Defaults the Metadata URL. - #[serde(rename = "issuer", skip_serializing_if = "Option::is_none")] - pub issuer: Option, - /// URL that the initial Login request is sent to. - #[serde(rename = "sso_url")] - pub sso_url: String, - /// Optional URL if your IDP supports Single-Logout. - #[serde( - rename = "slo_url", - default, - with = "::serde_with::rust::double_option", - skip_serializing_if = "Option::is_none" - )] - pub slo_url: Option>, - /// Allows authentication flows initiated by the IdP. This can be a security risk, as no - /// validation of the request ID is done. - #[serde( - rename = "allow_idp_initiated", - skip_serializing_if = "Option::is_none" - )] - pub allow_idp_initiated: Option, - /// When enabled, the IdP will re-authenticate the user even if a session exists. - #[serde(rename = "force_authn", skip_serializing_if = "Option::is_none")] - pub force_authn: Option, - /// NameID Policy sent to the IdP. Can be unset, in which case no Policy is sent. - #[serde(rename = "name_id_policy", skip_serializing_if = "Option::is_none")] - pub name_id_policy: Option, - #[serde(rename = "binding_type", skip_serializing_if = "Option::is_none")] - pub binding_type: Option, - /// When selected, incoming assertion's Signatures will be validated against this certificate. - /// To allow unsigned Requests, leave on default. - #[serde( - rename = "verification_kp", - default, - with = "::serde_with::rust::double_option", - skip_serializing_if = "Option::is_none" - )] - pub verification_kp: Option>, - /// Keypair used to sign outgoing Responses going to the Identity Provider. - #[serde( - rename = "signing_kp", - default, - with = "::serde_with::rust::double_option", - skip_serializing_if = "Option::is_none" - )] - pub signing_kp: Option>, - #[serde(rename = "digest_algorithm", skip_serializing_if = "Option::is_none")] - pub digest_algorithm: Option, - #[serde( - rename = "signature_algorithm", - skip_serializing_if = "Option::is_none" - )] - pub signature_algorithm: Option, - /// 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). - #[serde( - rename = "temporary_user_delete_after", - skip_serializing_if = "Option::is_none" - )] - pub temporary_user_delete_after: Option, - /// 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. - #[serde( - rename = "encryption_kp", - default, - with = "::serde_with::rust::double_option", - skip_serializing_if = "Option::is_none" - )] - pub encryption_kp: Option>, - #[serde(rename = "signed_assertion", skip_serializing_if = "Option::is_none")] - pub signed_assertion: Option, - #[serde(rename = "signed_response", skip_serializing_if = "Option::is_none")] - pub signed_response: Option, -} - -impl SamlSourceRequest { - /// SAMLSource Serializer - pub fn new( - name: String, - slug: String, - pre_authentication_flow: uuid::Uuid, - sso_url: String, - ) -> SamlSourceRequest { - SamlSourceRequest { - name, - slug, - enabled: None, - promoted: None, - authentication_flow: None, - enrollment_flow: None, - user_property_mappings: None, - group_property_mappings: None, - policy_engine_mode: None, - user_matching_mode: None, - user_path_template: None, - icon: None, - group_matching_mode: None, - pre_authentication_flow, - issuer: None, - sso_url, - slo_url: None, - allow_idp_initiated: None, - force_authn: None, - name_id_policy: None, - binding_type: None, - verification_kp: None, - signing_kp: None, - digest_algorithm: None, - signature_algorithm: None, - temporary_user_delete_after: None, - encryption_kp: None, - signed_assertion: None, - signed_response: None, - } - } -} diff --git a/packages/client-rust/src/models/schedule.rs b/packages/client-rust/src/models/schedule.rs deleted file mode 100644 index 77774c91b0..0000000000 --- a/packages/client-rust/src/models/schedule.rs +++ /dev/null @@ -1,78 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct Schedule { - #[serde(rename = "id")] - pub id: uuid::Uuid, - /// Unique schedule identifier - #[serde(rename = "identifier", deserialize_with = "Option::deserialize")] - pub identifier: Option, - #[serde(rename = "uid")] - pub uid: String, - /// Dramatiq actor to call - #[serde(rename = "actor_name")] - pub actor_name: String, - #[serde(rename = "rel_obj_app_label")] - pub rel_obj_app_label: String, - #[serde(rename = "rel_obj_model")] - pub rel_obj_model: String, - #[serde( - rename = "rel_obj_id", - default, - with = "::serde_with::rust::double_option", - skip_serializing_if = "Option::is_none" - )] - pub rel_obj_id: Option>, - /// When to schedule tasks - #[serde(rename = "crontab")] - pub crontab: String, - /// Pause this schedule - #[serde(rename = "paused", skip_serializing_if = "Option::is_none")] - pub paused: Option, - #[serde(rename = "next_run")] - pub next_run: String, - #[serde(rename = "description", deserialize_with = "Option::deserialize")] - pub description: Option, - #[serde(rename = "last_task_status", deserialize_with = "Option::deserialize")] - pub last_task_status: Option, -} - -impl Schedule { - pub fn new( - id: uuid::Uuid, - identifier: Option, - uid: String, - actor_name: String, - rel_obj_app_label: String, - rel_obj_model: String, - crontab: String, - next_run: String, - description: Option, - last_task_status: Option, - ) -> Schedule { - Schedule { - id, - identifier, - uid, - actor_name, - rel_obj_app_label, - rel_obj_model, - rel_obj_id: None, - crontab, - paused: None, - next_run, - description, - last_task_status, - } - } -} diff --git a/packages/client-rust/src/models/schedule_request.rs b/packages/client-rust/src/models/schedule_request.rs deleted file mode 100644 index 022e3094c6..0000000000 --- a/packages/client-rust/src/models/schedule_request.rs +++ /dev/null @@ -1,38 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct ScheduleRequest { - #[serde( - rename = "rel_obj_id", - default, - with = "::serde_with::rust::double_option", - skip_serializing_if = "Option::is_none" - )] - pub rel_obj_id: Option>, - /// When to schedule tasks - #[serde(rename = "crontab")] - pub crontab: String, - /// Pause this schedule - #[serde(rename = "paused", skip_serializing_if = "Option::is_none")] - pub paused: Option, -} - -impl ScheduleRequest { - pub fn new(crontab: String) -> ScheduleRequest { - ScheduleRequest { - rel_obj_id: None, - crontab, - paused: None, - } - } -} diff --git a/packages/client-rust/src/models/scim_authentication_mode_enum.rs b/packages/client-rust/src/models/scim_authentication_mode_enum.rs deleted file mode 100644 index 37dbf08062..0000000000 --- a/packages/client-rust/src/models/scim_authentication_mode_enum.rs +++ /dev/null @@ -1,35 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// -#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] -pub enum ScimAuthenticationModeEnum { - #[serde(rename = "token")] - Token, - #[serde(rename = "oauth")] - Oauth, -} - -impl std::fmt::Display for ScimAuthenticationModeEnum { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - match self { - Self::Token => write!(f, "token"), - Self::Oauth => write!(f, "oauth"), - } - } -} - -impl Default for ScimAuthenticationModeEnum { - fn default() -> ScimAuthenticationModeEnum { - Self::Token - } -} diff --git a/packages/client-rust/src/models/scim_mapping.rs b/packages/client-rust/src/models/scim_mapping.rs deleted file mode 100644 index 018fbcff9a..0000000000 --- a/packages/client-rust/src/models/scim_mapping.rs +++ /dev/null @@ -1,68 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// ScimMapping : SCIMMapping Serializer -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct ScimMapping { - #[serde(rename = "pk")] - pub pk: uuid::Uuid, - /// 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. - #[serde( - rename = "managed", - default, - with = "::serde_with::rust::double_option", - skip_serializing_if = "Option::is_none" - )] - pub managed: Option>, - #[serde(rename = "name")] - pub name: String, - #[serde(rename = "expression")] - pub expression: String, - /// Get object's component so that we know how to edit the object - #[serde(rename = "component")] - pub component: String, - /// Return object's verbose_name - #[serde(rename = "verbose_name")] - pub verbose_name: String, - /// Return object's plural verbose_name - #[serde(rename = "verbose_name_plural")] - pub verbose_name_plural: String, - /// Return internal model name - #[serde(rename = "meta_model_name")] - pub meta_model_name: String, -} - -impl ScimMapping { - /// SCIMMapping Serializer - pub fn new( - pk: uuid::Uuid, - name: String, - expression: String, - component: String, - verbose_name: String, - verbose_name_plural: String, - meta_model_name: String, - ) -> ScimMapping { - ScimMapping { - pk, - managed: None, - name, - expression, - component, - verbose_name, - verbose_name_plural, - meta_model_name, - } - } -} diff --git a/packages/client-rust/src/models/scim_mapping_request.rs b/packages/client-rust/src/models/scim_mapping_request.rs deleted file mode 100644 index aafe0a3603..0000000000 --- a/packages/client-rust/src/models/scim_mapping_request.rs +++ /dev/null @@ -1,41 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// ScimMappingRequest : SCIMMapping Serializer -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct ScimMappingRequest { - /// 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. - #[serde( - rename = "managed", - default, - with = "::serde_with::rust::double_option", - skip_serializing_if = "Option::is_none" - )] - pub managed: Option>, - #[serde(rename = "name")] - pub name: String, - #[serde(rename = "expression")] - pub expression: String, -} - -impl ScimMappingRequest { - /// SCIMMapping Serializer - pub fn new(name: String, expression: String) -> ScimMappingRequest { - ScimMappingRequest { - managed: None, - name, - expression, - } - } -} diff --git a/packages/client-rust/src/models/scim_provider.rs b/packages/client-rust/src/models/scim_provider.rs deleted file mode 100644 index 78da7926b7..0000000000 --- a/packages/client-rust/src/models/scim_provider.rs +++ /dev/null @@ -1,143 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// ScimProvider : SCIMProvider Serializer -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct ScimProvider { - #[serde(rename = "pk")] - pub pk: i32, - #[serde(rename = "name")] - pub name: String, - #[serde(rename = "property_mappings", skip_serializing_if = "Option::is_none")] - pub property_mappings: Option>, - /// Property mappings used for group creation/updating. - #[serde( - rename = "property_mappings_group", - skip_serializing_if = "Option::is_none" - )] - pub property_mappings_group: Option>, - /// Get object component so that we know how to edit the object - #[serde(rename = "component")] - pub component: String, - /// Internal application name, used in URLs. - #[serde( - rename = "assigned_backchannel_application_slug", - deserialize_with = "Option::deserialize" - )] - pub assigned_backchannel_application_slug: Option, - /// Application's display Name. - #[serde( - rename = "assigned_backchannel_application_name", - deserialize_with = "Option::deserialize" - )] - pub assigned_backchannel_application_name: Option, - /// Return object's verbose_name - #[serde(rename = "verbose_name")] - pub verbose_name: String, - /// Return object's plural verbose_name - #[serde(rename = "verbose_name_plural")] - pub verbose_name_plural: String, - /// Return internal model name - #[serde(rename = "meta_model_name")] - pub meta_model_name: String, - /// Base URL to SCIM requests, usually ends in /v2 - #[serde(rename = "url")] - pub url: String, - #[serde( - rename = "verify_certificates", - skip_serializing_if = "Option::is_none" - )] - pub verify_certificates: Option, - /// Authentication token - #[serde(rename = "token", skip_serializing_if = "Option::is_none")] - pub token: Option, - #[serde(rename = "auth_mode", skip_serializing_if = "Option::is_none")] - pub auth_mode: Option, - /// OAuth Source used for authentication - #[serde( - rename = "auth_oauth", - default, - with = "::serde_with::rust::double_option", - skip_serializing_if = "Option::is_none" - )] - pub auth_oauth: Option>, - /// Additional OAuth parameters, such as grant_type - #[serde(rename = "auth_oauth_params", skip_serializing_if = "Option::is_none")] - pub auth_oauth_params: Option>, - /// Alter authentik behavior for vendor-specific SCIM implementations. - #[serde(rename = "compatibility_mode", skip_serializing_if = "Option::is_none")] - pub compatibility_mode: Option, - /// Cache duration for ServiceProviderConfig responses. Set minutes=0 to disable. - #[serde( - rename = "service_provider_config_cache_timeout", - skip_serializing_if = "Option::is_none" - )] - pub service_provider_config_cache_timeout: Option, - #[serde( - rename = "exclude_users_service_account", - skip_serializing_if = "Option::is_none" - )] - pub exclude_users_service_account: Option, - /// Controls the number of objects synced in a single task - #[serde(rename = "sync_page_size", skip_serializing_if = "Option::is_none")] - pub sync_page_size: Option, - /// Timeout for synchronization of a single page - #[serde(rename = "sync_page_timeout", skip_serializing_if = "Option::is_none")] - pub sync_page_timeout: Option, - /// Group filters used to define sync-scope for groups. - #[serde(rename = "group_filters", skip_serializing_if = "Option::is_none")] - pub group_filters: Option>, - /// When enabled, provider will not modify or create objects in the remote system. - #[serde(rename = "dry_run", skip_serializing_if = "Option::is_none")] - pub dry_run: Option, -} - -impl ScimProvider { - /// SCIMProvider Serializer - pub fn new( - pk: i32, - name: String, - component: String, - assigned_backchannel_application_slug: Option, - assigned_backchannel_application_name: Option, - verbose_name: String, - verbose_name_plural: String, - meta_model_name: String, - url: String, - ) -> ScimProvider { - ScimProvider { - pk, - name, - property_mappings: None, - property_mappings_group: None, - component, - assigned_backchannel_application_slug, - assigned_backchannel_application_name, - verbose_name, - verbose_name_plural, - meta_model_name, - url, - verify_certificates: None, - token: None, - auth_mode: None, - auth_oauth: None, - auth_oauth_params: None, - compatibility_mode: None, - service_provider_config_cache_timeout: None, - exclude_users_service_account: None, - sync_page_size: None, - sync_page_timeout: None, - group_filters: None, - dry_run: None, - } - } -} diff --git a/packages/client-rust/src/models/scim_provider_group.rs b/packages/client-rust/src/models/scim_provider_group.rs deleted file mode 100644 index 831107dd69..0000000000 --- a/packages/client-rust/src/models/scim_provider_group.rs +++ /dev/null @@ -1,49 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// ScimProviderGroup : SCIMProviderGroup Serializer -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct ScimProviderGroup { - #[serde(rename = "id")] - pub id: uuid::Uuid, - #[serde(rename = "scim_id")] - pub scim_id: String, - #[serde(rename = "group")] - pub group: uuid::Uuid, - #[serde(rename = "group_obj")] - pub group_obj: models::PartialGroup, - #[serde(rename = "provider")] - pub provider: i32, - #[serde(rename = "attributes")] - pub attributes: std::collections::HashMap, -} - -impl ScimProviderGroup { - /// SCIMProviderGroup Serializer - pub fn new( - id: uuid::Uuid, - scim_id: String, - group: uuid::Uuid, - group_obj: models::PartialGroup, - provider: i32, - attributes: std::collections::HashMap, - ) -> ScimProviderGroup { - ScimProviderGroup { - id, - scim_id, - group, - group_obj, - provider, - attributes, - } - } -} diff --git a/packages/client-rust/src/models/scim_provider_group_request.rs b/packages/client-rust/src/models/scim_provider_group_request.rs deleted file mode 100644 index 362a7c37b3..0000000000 --- a/packages/client-rust/src/models/scim_provider_group_request.rs +++ /dev/null @@ -1,33 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// ScimProviderGroupRequest : SCIMProviderGroup Serializer -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct ScimProviderGroupRequest { - #[serde(rename = "scim_id")] - pub scim_id: String, - #[serde(rename = "group")] - pub group: uuid::Uuid, - #[serde(rename = "provider")] - pub provider: i32, -} - -impl ScimProviderGroupRequest { - /// SCIMProviderGroup Serializer - pub fn new(scim_id: String, group: uuid::Uuid, provider: i32) -> ScimProviderGroupRequest { - ScimProviderGroupRequest { - scim_id, - group, - provider, - } - } -} diff --git a/packages/client-rust/src/models/scim_provider_request.rs b/packages/client-rust/src/models/scim_provider_request.rs deleted file mode 100644 index 0d206dcf4f..0000000000 --- a/packages/client-rust/src/models/scim_provider_request.rs +++ /dev/null @@ -1,100 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// ScimProviderRequest : SCIMProvider Serializer -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct ScimProviderRequest { - #[serde(rename = "name")] - pub name: String, - #[serde(rename = "property_mappings", skip_serializing_if = "Option::is_none")] - pub property_mappings: Option>, - /// Property mappings used for group creation/updating. - #[serde( - rename = "property_mappings_group", - skip_serializing_if = "Option::is_none" - )] - pub property_mappings_group: Option>, - /// Base URL to SCIM requests, usually ends in /v2 - #[serde(rename = "url")] - pub url: String, - #[serde( - rename = "verify_certificates", - skip_serializing_if = "Option::is_none" - )] - pub verify_certificates: Option, - /// Authentication token - #[serde(rename = "token", skip_serializing_if = "Option::is_none")] - pub token: Option, - #[serde(rename = "auth_mode", skip_serializing_if = "Option::is_none")] - pub auth_mode: Option, - /// OAuth Source used for authentication - #[serde( - rename = "auth_oauth", - default, - with = "::serde_with::rust::double_option", - skip_serializing_if = "Option::is_none" - )] - pub auth_oauth: Option>, - /// Additional OAuth parameters, such as grant_type - #[serde(rename = "auth_oauth_params", skip_serializing_if = "Option::is_none")] - pub auth_oauth_params: Option>, - /// Alter authentik behavior for vendor-specific SCIM implementations. - #[serde(rename = "compatibility_mode", skip_serializing_if = "Option::is_none")] - pub compatibility_mode: Option, - /// Cache duration for ServiceProviderConfig responses. Set minutes=0 to disable. - #[serde( - rename = "service_provider_config_cache_timeout", - skip_serializing_if = "Option::is_none" - )] - pub service_provider_config_cache_timeout: Option, - #[serde( - rename = "exclude_users_service_account", - skip_serializing_if = "Option::is_none" - )] - pub exclude_users_service_account: Option, - /// Controls the number of objects synced in a single task - #[serde(rename = "sync_page_size", skip_serializing_if = "Option::is_none")] - pub sync_page_size: Option, - /// Timeout for synchronization of a single page - #[serde(rename = "sync_page_timeout", skip_serializing_if = "Option::is_none")] - pub sync_page_timeout: Option, - /// Group filters used to define sync-scope for groups. - #[serde(rename = "group_filters", skip_serializing_if = "Option::is_none")] - pub group_filters: Option>, - /// When enabled, provider will not modify or create objects in the remote system. - #[serde(rename = "dry_run", skip_serializing_if = "Option::is_none")] - pub dry_run: Option, -} - -impl ScimProviderRequest { - /// SCIMProvider Serializer - pub fn new(name: String, url: String) -> ScimProviderRequest { - ScimProviderRequest { - name, - property_mappings: None, - property_mappings_group: None, - url, - verify_certificates: None, - token: None, - auth_mode: None, - auth_oauth: None, - auth_oauth_params: None, - compatibility_mode: None, - service_provider_config_cache_timeout: None, - exclude_users_service_account: None, - sync_page_size: None, - sync_page_timeout: None, - group_filters: None, - dry_run: None, - } - } -} diff --git a/packages/client-rust/src/models/scim_provider_user.rs b/packages/client-rust/src/models/scim_provider_user.rs deleted file mode 100644 index 98cc6bad7e..0000000000 --- a/packages/client-rust/src/models/scim_provider_user.rs +++ /dev/null @@ -1,49 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// ScimProviderUser : SCIMProviderUser Serializer -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct ScimProviderUser { - #[serde(rename = "id")] - pub id: uuid::Uuid, - #[serde(rename = "scim_id")] - pub scim_id: String, - #[serde(rename = "user")] - pub user: i32, - #[serde(rename = "user_obj")] - pub user_obj: models::PartialUser, - #[serde(rename = "provider")] - pub provider: i32, - #[serde(rename = "attributes")] - pub attributes: std::collections::HashMap, -} - -impl ScimProviderUser { - /// SCIMProviderUser Serializer - pub fn new( - id: uuid::Uuid, - scim_id: String, - user: i32, - user_obj: models::PartialUser, - provider: i32, - attributes: std::collections::HashMap, - ) -> ScimProviderUser { - ScimProviderUser { - id, - scim_id, - user, - user_obj, - provider, - attributes, - } - } -} diff --git a/packages/client-rust/src/models/scim_provider_user_request.rs b/packages/client-rust/src/models/scim_provider_user_request.rs deleted file mode 100644 index 8cb904ac29..0000000000 --- a/packages/client-rust/src/models/scim_provider_user_request.rs +++ /dev/null @@ -1,33 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// ScimProviderUserRequest : SCIMProviderUser Serializer -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct ScimProviderUserRequest { - #[serde(rename = "scim_id")] - pub scim_id: String, - #[serde(rename = "user")] - pub user: i32, - #[serde(rename = "provider")] - pub provider: i32, -} - -impl ScimProviderUserRequest { - /// SCIMProviderUser Serializer - pub fn new(scim_id: String, user: i32, provider: i32) -> ScimProviderUserRequest { - ScimProviderUserRequest { - scim_id, - user, - provider, - } - } -} diff --git a/packages/client-rust/src/models/scim_source.rs b/packages/client-rust/src/models/scim_source.rs deleted file mode 100644 index 417e9c2b6a..0000000000 --- a/packages/client-rust/src/models/scim_source.rs +++ /dev/null @@ -1,93 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// ScimSource : SCIMSource Serializer -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct ScimSource { - #[serde(rename = "pk")] - pub pk: uuid::Uuid, - /// Source's display Name. - #[serde(rename = "name")] - pub name: String, - /// Internal source name, used in URLs. - #[serde(rename = "slug")] - pub slug: String, - #[serde(rename = "enabled", skip_serializing_if = "Option::is_none")] - pub enabled: Option, - #[serde( - rename = "user_property_mappings", - skip_serializing_if = "Option::is_none" - )] - pub user_property_mappings: Option>, - #[serde( - rename = "group_property_mappings", - skip_serializing_if = "Option::is_none" - )] - pub group_property_mappings: Option>, - /// Get object component so that we know how to edit the object - #[serde(rename = "component")] - pub component: String, - /// Return object's verbose_name - #[serde(rename = "verbose_name")] - pub verbose_name: String, - /// Return object's plural verbose_name - #[serde(rename = "verbose_name_plural")] - pub verbose_name_plural: String, - /// Return internal model name - #[serde(rename = "meta_model_name")] - pub meta_model_name: String, - /// 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. - #[serde(rename = "managed", deserialize_with = "Option::deserialize")] - pub managed: Option, - #[serde(rename = "user_path_template", skip_serializing_if = "Option::is_none")] - pub user_path_template: Option, - /// Get Root URL - #[serde(rename = "root_url")] - pub root_url: String, - #[serde(rename = "token_obj")] - pub token_obj: models::Token, -} - -impl ScimSource { - /// SCIMSource Serializer - pub fn new( - pk: uuid::Uuid, - name: String, - slug: String, - component: String, - verbose_name: String, - verbose_name_plural: String, - meta_model_name: String, - managed: Option, - root_url: String, - token_obj: models::Token, - ) -> ScimSource { - ScimSource { - pk, - name, - slug, - enabled: None, - user_property_mappings: None, - group_property_mappings: None, - component, - verbose_name, - verbose_name_plural, - meta_model_name, - managed, - user_path_template: None, - root_url, - token_obj, - } - } -} diff --git a/packages/client-rust/src/models/scim_source_group.rs b/packages/client-rust/src/models/scim_source_group.rs deleted file mode 100644 index f821e350ef..0000000000 --- a/packages/client-rust/src/models/scim_source_group.rs +++ /dev/null @@ -1,47 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// ScimSourceGroup : SCIMSourceGroup Serializer -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct ScimSourceGroup { - #[serde(rename = "id", skip_serializing_if = "Option::is_none")] - pub id: Option, - #[serde(rename = "external_id")] - pub external_id: String, - #[serde(rename = "group")] - pub group: uuid::Uuid, - #[serde(rename = "group_obj")] - pub group_obj: models::PartialGroup, - #[serde(rename = "source")] - pub source: uuid::Uuid, - #[serde(rename = "attributes", skip_serializing_if = "Option::is_none")] - pub attributes: Option>, -} - -impl ScimSourceGroup { - /// SCIMSourceGroup Serializer - pub fn new( - external_id: String, - group: uuid::Uuid, - group_obj: models::PartialGroup, - source: uuid::Uuid, - ) -> ScimSourceGroup { - ScimSourceGroup { - id: None, - external_id, - group, - group_obj, - source, - attributes: None, - } - } -} diff --git a/packages/client-rust/src/models/scim_source_group_request.rs b/packages/client-rust/src/models/scim_source_group_request.rs deleted file mode 100644 index 1ed9cebaae..0000000000 --- a/packages/client-rust/src/models/scim_source_group_request.rs +++ /dev/null @@ -1,43 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// ScimSourceGroupRequest : SCIMSourceGroup Serializer -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct ScimSourceGroupRequest { - #[serde(rename = "id", skip_serializing_if = "Option::is_none")] - pub id: Option, - #[serde(rename = "external_id")] - pub external_id: String, - #[serde(rename = "group")] - pub group: uuid::Uuid, - #[serde(rename = "source")] - pub source: uuid::Uuid, - #[serde(rename = "attributes", skip_serializing_if = "Option::is_none")] - pub attributes: Option>, -} - -impl ScimSourceGroupRequest { - /// SCIMSourceGroup Serializer - pub fn new( - external_id: String, - group: uuid::Uuid, - source: uuid::Uuid, - ) -> ScimSourceGroupRequest { - ScimSourceGroupRequest { - id: None, - external_id, - group, - source, - attributes: None, - } - } -} diff --git a/packages/client-rust/src/models/scim_source_property_mapping.rs b/packages/client-rust/src/models/scim_source_property_mapping.rs deleted file mode 100644 index 2fca1c50d7..0000000000 --- a/packages/client-rust/src/models/scim_source_property_mapping.rs +++ /dev/null @@ -1,68 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// ScimSourcePropertyMapping : SCIMSourcePropertyMapping Serializer -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct ScimSourcePropertyMapping { - #[serde(rename = "pk")] - pub pk: uuid::Uuid, - /// 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. - #[serde( - rename = "managed", - default, - with = "::serde_with::rust::double_option", - skip_serializing_if = "Option::is_none" - )] - pub managed: Option>, - #[serde(rename = "name")] - pub name: String, - #[serde(rename = "expression")] - pub expression: String, - /// Get object's component so that we know how to edit the object - #[serde(rename = "component")] - pub component: String, - /// Return object's verbose_name - #[serde(rename = "verbose_name")] - pub verbose_name: String, - /// Return object's plural verbose_name - #[serde(rename = "verbose_name_plural")] - pub verbose_name_plural: String, - /// Return internal model name - #[serde(rename = "meta_model_name")] - pub meta_model_name: String, -} - -impl ScimSourcePropertyMapping { - /// SCIMSourcePropertyMapping Serializer - pub fn new( - pk: uuid::Uuid, - name: String, - expression: String, - component: String, - verbose_name: String, - verbose_name_plural: String, - meta_model_name: String, - ) -> ScimSourcePropertyMapping { - ScimSourcePropertyMapping { - pk, - managed: None, - name, - expression, - component, - verbose_name, - verbose_name_plural, - meta_model_name, - } - } -} diff --git a/packages/client-rust/src/models/scim_source_property_mapping_request.rs b/packages/client-rust/src/models/scim_source_property_mapping_request.rs deleted file mode 100644 index 0a87386847..0000000000 --- a/packages/client-rust/src/models/scim_source_property_mapping_request.rs +++ /dev/null @@ -1,41 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// ScimSourcePropertyMappingRequest : SCIMSourcePropertyMapping Serializer -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct ScimSourcePropertyMappingRequest { - /// 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. - #[serde( - rename = "managed", - default, - with = "::serde_with::rust::double_option", - skip_serializing_if = "Option::is_none" - )] - pub managed: Option>, - #[serde(rename = "name")] - pub name: String, - #[serde(rename = "expression")] - pub expression: String, -} - -impl ScimSourcePropertyMappingRequest { - /// SCIMSourcePropertyMapping Serializer - pub fn new(name: String, expression: String) -> ScimSourcePropertyMappingRequest { - ScimSourcePropertyMappingRequest { - managed: None, - name, - expression, - } - } -} diff --git a/packages/client-rust/src/models/scim_source_request.rs b/packages/client-rust/src/models/scim_source_request.rs deleted file mode 100644 index 875e685de2..0000000000 --- a/packages/client-rust/src/models/scim_source_request.rs +++ /dev/null @@ -1,50 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// ScimSourceRequest : SCIMSource Serializer -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct ScimSourceRequest { - /// Source's display Name. - #[serde(rename = "name")] - pub name: String, - /// Internal source name, used in URLs. - #[serde(rename = "slug")] - pub slug: String, - #[serde(rename = "enabled", skip_serializing_if = "Option::is_none")] - pub enabled: Option, - #[serde( - rename = "user_property_mappings", - skip_serializing_if = "Option::is_none" - )] - pub user_property_mappings: Option>, - #[serde( - rename = "group_property_mappings", - skip_serializing_if = "Option::is_none" - )] - pub group_property_mappings: Option>, - #[serde(rename = "user_path_template", skip_serializing_if = "Option::is_none")] - pub user_path_template: Option, -} - -impl ScimSourceRequest { - /// SCIMSource Serializer - pub fn new(name: String, slug: String) -> ScimSourceRequest { - ScimSourceRequest { - name, - slug, - enabled: None, - user_property_mappings: None, - group_property_mappings: None, - user_path_template: None, - } - } -} diff --git a/packages/client-rust/src/models/scim_source_user.rs b/packages/client-rust/src/models/scim_source_user.rs deleted file mode 100644 index 4de23363e2..0000000000 --- a/packages/client-rust/src/models/scim_source_user.rs +++ /dev/null @@ -1,47 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// ScimSourceUser : SCIMSourceUser Serializer -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct ScimSourceUser { - #[serde(rename = "id", skip_serializing_if = "Option::is_none")] - pub id: Option, - #[serde(rename = "external_id")] - pub external_id: String, - #[serde(rename = "user")] - pub user: i32, - #[serde(rename = "user_obj")] - pub user_obj: models::PartialUser, - #[serde(rename = "source")] - pub source: uuid::Uuid, - #[serde(rename = "attributes", skip_serializing_if = "Option::is_none")] - pub attributes: Option>, -} - -impl ScimSourceUser { - /// SCIMSourceUser Serializer - pub fn new( - external_id: String, - user: i32, - user_obj: models::PartialUser, - source: uuid::Uuid, - ) -> ScimSourceUser { - ScimSourceUser { - id: None, - external_id, - user, - user_obj, - source, - attributes: None, - } - } -} diff --git a/packages/client-rust/src/models/scim_source_user_request.rs b/packages/client-rust/src/models/scim_source_user_request.rs deleted file mode 100644 index de2e8b61f8..0000000000 --- a/packages/client-rust/src/models/scim_source_user_request.rs +++ /dev/null @@ -1,39 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// ScimSourceUserRequest : SCIMSourceUser Serializer -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct ScimSourceUserRequest { - #[serde(rename = "id", skip_serializing_if = "Option::is_none")] - pub id: Option, - #[serde(rename = "external_id")] - pub external_id: String, - #[serde(rename = "user")] - pub user: i32, - #[serde(rename = "source")] - pub source: uuid::Uuid, - #[serde(rename = "attributes", skip_serializing_if = "Option::is_none")] - pub attributes: Option>, -} - -impl ScimSourceUserRequest { - /// SCIMSourceUser Serializer - pub fn new(external_id: String, user: i32, source: uuid::Uuid) -> ScimSourceUserRequest { - ScimSourceUserRequest { - id: None, - external_id, - user, - source, - attributes: None, - } - } -} diff --git a/packages/client-rust/src/models/scope_mapping.rs b/packages/client-rust/src/models/scope_mapping.rs deleted file mode 100644 index 0760a4df45..0000000000 --- a/packages/client-rust/src/models/scope_mapping.rs +++ /dev/null @@ -1,77 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// ScopeMapping : ScopeMapping Serializer -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct ScopeMapping { - #[serde(rename = "pk")] - pub pk: uuid::Uuid, - /// 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. - #[serde( - rename = "managed", - default, - with = "::serde_with::rust::double_option", - skip_serializing_if = "Option::is_none" - )] - pub managed: Option>, - #[serde(rename = "name")] - pub name: String, - #[serde(rename = "expression")] - pub expression: String, - /// Get object's component so that we know how to edit the object - #[serde(rename = "component")] - pub component: String, - /// Return object's verbose_name - #[serde(rename = "verbose_name")] - pub verbose_name: String, - /// Return object's plural verbose_name - #[serde(rename = "verbose_name_plural")] - pub verbose_name_plural: String, - /// Return internal model name - #[serde(rename = "meta_model_name")] - pub meta_model_name: String, - /// Scope name requested by the client - #[serde(rename = "scope_name")] - pub scope_name: String, - /// Description shown to the user when consenting. If left empty, the user won't be informed. - #[serde(rename = "description", skip_serializing_if = "Option::is_none")] - pub description: Option, -} - -impl ScopeMapping { - /// ScopeMapping Serializer - pub fn new( - pk: uuid::Uuid, - name: String, - expression: String, - component: String, - verbose_name: String, - verbose_name_plural: String, - meta_model_name: String, - scope_name: String, - ) -> ScopeMapping { - ScopeMapping { - pk, - managed: None, - name, - expression, - component, - verbose_name, - verbose_name_plural, - meta_model_name, - scope_name, - description: None, - } - } -} diff --git a/packages/client-rust/src/models/scope_mapping_request.rs b/packages/client-rust/src/models/scope_mapping_request.rs deleted file mode 100644 index aa68047eb7..0000000000 --- a/packages/client-rust/src/models/scope_mapping_request.rs +++ /dev/null @@ -1,49 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// ScopeMappingRequest : ScopeMapping Serializer -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct ScopeMappingRequest { - /// 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. - #[serde( - rename = "managed", - default, - with = "::serde_with::rust::double_option", - skip_serializing_if = "Option::is_none" - )] - pub managed: Option>, - #[serde(rename = "name")] - pub name: String, - #[serde(rename = "expression")] - pub expression: String, - /// Scope name requested by the client - #[serde(rename = "scope_name")] - pub scope_name: String, - /// Description shown to the user when consenting. If left empty, the user won't be informed. - #[serde(rename = "description", skip_serializing_if = "Option::is_none")] - pub description: Option, -} - -impl ScopeMappingRequest { - /// ScopeMapping Serializer - pub fn new(name: String, expression: String, scope_name: String) -> ScopeMappingRequest { - ScopeMappingRequest { - managed: None, - name, - expression, - scope_name, - description: None, - } - } -} diff --git a/packages/client-rust/src/models/service_connection_state.rs b/packages/client-rust/src/models/service_connection_state.rs deleted file mode 100644 index 356898be5d..0000000000 --- a/packages/client-rust/src/models/service_connection_state.rs +++ /dev/null @@ -1,27 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// ServiceConnectionState : Serializer for Service connection state -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct ServiceConnectionState { - #[serde(rename = "healthy")] - pub healthy: bool, - #[serde(rename = "version")] - pub version: String, -} - -impl ServiceConnectionState { - /// Serializer for Service connection state - pub fn new(healthy: bool, version: String) -> ServiceConnectionState { - ServiceConnectionState { healthy, version } - } -} diff --git a/packages/client-rust/src/models/settings.rs b/packages/client-rust/src/models/settings.rs deleted file mode 100644 index 3a08eff6e0..0000000000 --- a/packages/client-rust/src/models/settings.rs +++ /dev/null @@ -1,121 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// Settings : Settings Serializer -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct Settings { - /// Configure how authentik should show avatars for users. - #[serde(rename = "avatars", skip_serializing_if = "Option::is_none")] - pub avatars: Option, - /// Enable the ability for users to change their name. - #[serde( - rename = "default_user_change_name", - skip_serializing_if = "Option::is_none" - )] - pub default_user_change_name: Option, - /// Enable the ability for users to change their email address. - #[serde( - rename = "default_user_change_email", - skip_serializing_if = "Option::is_none" - )] - pub default_user_change_email: Option, - /// Enable the ability for users to change their username. - #[serde( - rename = "default_user_change_username", - skip_serializing_if = "Option::is_none" - )] - pub default_user_change_username: Option, - /// Events will be deleted after this duration.(Format: weeks=3;days=2;hours=3,seconds=2). - #[serde(rename = "event_retention", skip_serializing_if = "Option::is_none")] - pub event_retention: Option, - /// Reputation cannot decrease lower than this value. Zero or negative. - #[serde( - rename = "reputation_lower_limit", - skip_serializing_if = "Option::is_none" - )] - pub reputation_lower_limit: Option, - /// Reputation cannot increase higher than this value. Zero or positive. - #[serde( - rename = "reputation_upper_limit", - skip_serializing_if = "Option::is_none" - )] - pub reputation_upper_limit: Option, - #[serde( - rename = "footer_links", - default, - with = "::serde_with::rust::double_option", - skip_serializing_if = "Option::is_none" - )] - pub footer_links: Option>, - /// When enabled, all the events caused by a user will be deleted upon the user's deletion. - #[serde(rename = "gdpr_compliance", skip_serializing_if = "Option::is_none")] - pub gdpr_compliance: Option, - /// Globally enable/disable impersonation. - #[serde(rename = "impersonation", skip_serializing_if = "Option::is_none")] - pub impersonation: Option, - /// Require administrators to provide a reason for impersonating a user. - #[serde( - rename = "impersonation_require_reason", - skip_serializing_if = "Option::is_none" - )] - pub impersonation_require_reason: Option, - /// Default token duration - #[serde( - rename = "default_token_duration", - skip_serializing_if = "Option::is_none" - )] - pub default_token_duration: Option, - /// Default token length - #[serde( - rename = "default_token_length", - skip_serializing_if = "Option::is_none" - )] - pub default_token_length: Option, - /// Default page size for API responses, if no size was requested. - #[serde( - rename = "pagination_default_page_size", - skip_serializing_if = "Option::is_none" - )] - pub pagination_default_page_size: Option, - /// Maximum page size - #[serde( - rename = "pagination_max_page_size", - skip_serializing_if = "Option::is_none" - )] - pub pagination_max_page_size: Option, - #[serde(rename = "flags")] - pub flags: models::PatchedSettingsRequestFlags, -} - -impl Settings { - /// Settings Serializer - pub fn new(flags: models::PatchedSettingsRequestFlags) -> Settings { - Settings { - avatars: None, - default_user_change_name: None, - default_user_change_email: None, - default_user_change_username: None, - event_retention: None, - reputation_lower_limit: None, - reputation_upper_limit: None, - footer_links: None, - gdpr_compliance: None, - impersonation: None, - impersonation_require_reason: None, - default_token_duration: None, - default_token_length: None, - pagination_default_page_size: None, - pagination_max_page_size: None, - flags, - } - } -} diff --git a/packages/client-rust/src/models/settings_request.rs b/packages/client-rust/src/models/settings_request.rs deleted file mode 100644 index 11bd9e963a..0000000000 --- a/packages/client-rust/src/models/settings_request.rs +++ /dev/null @@ -1,121 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// SettingsRequest : Settings Serializer -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct SettingsRequest { - /// Configure how authentik should show avatars for users. - #[serde(rename = "avatars", skip_serializing_if = "Option::is_none")] - pub avatars: Option, - /// Enable the ability for users to change their name. - #[serde( - rename = "default_user_change_name", - skip_serializing_if = "Option::is_none" - )] - pub default_user_change_name: Option, - /// Enable the ability for users to change their email address. - #[serde( - rename = "default_user_change_email", - skip_serializing_if = "Option::is_none" - )] - pub default_user_change_email: Option, - /// Enable the ability for users to change their username. - #[serde( - rename = "default_user_change_username", - skip_serializing_if = "Option::is_none" - )] - pub default_user_change_username: Option, - /// Events will be deleted after this duration.(Format: weeks=3;days=2;hours=3,seconds=2). - #[serde(rename = "event_retention", skip_serializing_if = "Option::is_none")] - pub event_retention: Option, - /// Reputation cannot decrease lower than this value. Zero or negative. - #[serde( - rename = "reputation_lower_limit", - skip_serializing_if = "Option::is_none" - )] - pub reputation_lower_limit: Option, - /// Reputation cannot increase higher than this value. Zero or positive. - #[serde( - rename = "reputation_upper_limit", - skip_serializing_if = "Option::is_none" - )] - pub reputation_upper_limit: Option, - #[serde( - rename = "footer_links", - default, - with = "::serde_with::rust::double_option", - skip_serializing_if = "Option::is_none" - )] - pub footer_links: Option>, - /// When enabled, all the events caused by a user will be deleted upon the user's deletion. - #[serde(rename = "gdpr_compliance", skip_serializing_if = "Option::is_none")] - pub gdpr_compliance: Option, - /// Globally enable/disable impersonation. - #[serde(rename = "impersonation", skip_serializing_if = "Option::is_none")] - pub impersonation: Option, - /// Require administrators to provide a reason for impersonating a user. - #[serde( - rename = "impersonation_require_reason", - skip_serializing_if = "Option::is_none" - )] - pub impersonation_require_reason: Option, - /// Default token duration - #[serde( - rename = "default_token_duration", - skip_serializing_if = "Option::is_none" - )] - pub default_token_duration: Option, - /// Default token length - #[serde( - rename = "default_token_length", - skip_serializing_if = "Option::is_none" - )] - pub default_token_length: Option, - /// Default page size for API responses, if no size was requested. - #[serde( - rename = "pagination_default_page_size", - skip_serializing_if = "Option::is_none" - )] - pub pagination_default_page_size: Option, - /// Maximum page size - #[serde( - rename = "pagination_max_page_size", - skip_serializing_if = "Option::is_none" - )] - pub pagination_max_page_size: Option, - #[serde(rename = "flags")] - pub flags: models::PatchedSettingsRequestFlags, -} - -impl SettingsRequest { - /// Settings Serializer - pub fn new(flags: models::PatchedSettingsRequestFlags) -> SettingsRequest { - SettingsRequest { - avatars: None, - default_user_change_name: None, - default_user_change_email: None, - default_user_change_username: None, - event_retention: None, - reputation_lower_limit: None, - reputation_upper_limit: None, - footer_links: None, - gdpr_compliance: None, - impersonation: None, - impersonation_require_reason: None, - default_token_duration: None, - default_token_length: None, - pagination_default_page_size: None, - pagination_max_page_size: None, - flags, - } - } -} diff --git a/packages/client-rust/src/models/severity_enum.rs b/packages/client-rust/src/models/severity_enum.rs deleted file mode 100644 index 179458b97e..0000000000 --- a/packages/client-rust/src/models/severity_enum.rs +++ /dev/null @@ -1,38 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// -#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] -pub enum SeverityEnum { - #[serde(rename = "notice")] - Notice, - #[serde(rename = "warning")] - Warning, - #[serde(rename = "alert")] - Alert, -} - -impl std::fmt::Display for SeverityEnum { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - match self { - Self::Notice => write!(f, "notice"), - Self::Warning => write!(f, "warning"), - Self::Alert => write!(f, "alert"), - } - } -} - -impl Default for SeverityEnum { - fn default() -> SeverityEnum { - Self::Notice - } -} diff --git a/packages/client-rust/src/models/signature_algorithm_enum.rs b/packages/client-rust/src/models/signature_algorithm_enum.rs deleted file mode 100644 index af9df53c7c..0000000000 --- a/packages/client-rust/src/models/signature_algorithm_enum.rs +++ /dev/null @@ -1,74 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// -#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] -pub enum SignatureAlgorithmEnum { - #[serde(rename = "http://www.w3.org/2000/09/xmldsig#rsa-sha1")] - HttpColonSlashSlashWwwW3OrgSlash2000Slash09SlashXmldsigHashRsaSha1, - #[serde(rename = "http://www.w3.org/2001/04/xmldsig-more#rsa-sha256")] - HttpColonSlashSlashWwwW3OrgSlash2001Slash04SlashXmldsigMoreHashRsaSha256, - #[serde(rename = "http://www.w3.org/2001/04/xmldsig-more#rsa-sha384")] - HttpColonSlashSlashWwwW3OrgSlash2001Slash04SlashXmldsigMoreHashRsaSha384, - #[serde(rename = "http://www.w3.org/2001/04/xmldsig-more#rsa-sha512")] - HttpColonSlashSlashWwwW3OrgSlash2001Slash04SlashXmldsigMoreHashRsaSha512, - #[serde(rename = "http://www.w3.org/2001/04/xmldsig-more#ecdsa-sha1")] - HttpColonSlashSlashWwwW3OrgSlash2001Slash04SlashXmldsigMoreHashEcdsaSha1, - #[serde(rename = "http://www.w3.org/2001/04/xmldsig-more#ecdsa-sha256")] - HttpColonSlashSlashWwwW3OrgSlash2001Slash04SlashXmldsigMoreHashEcdsaSha256, - #[serde(rename = "http://www.w3.org/2001/04/xmldsig-more#ecdsa-sha384")] - HttpColonSlashSlashWwwW3OrgSlash2001Slash04SlashXmldsigMoreHashEcdsaSha384, - #[serde(rename = "http://www.w3.org/2001/04/xmldsig-more#ecdsa-sha512")] - HttpColonSlashSlashWwwW3OrgSlash2001Slash04SlashXmldsigMoreHashEcdsaSha512, - #[serde(rename = "http://www.w3.org/2000/09/xmldsig#dsa-sha1")] - HttpColonSlashSlashWwwW3OrgSlash2000Slash09SlashXmldsigHashDsaSha1, -} - -impl std::fmt::Display for SignatureAlgorithmEnum { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - match self { - Self::HttpColonSlashSlashWwwW3OrgSlash2000Slash09SlashXmldsigHashRsaSha1 => { - write!(f, "http://www.w3.org/2000/09/xmldsig#rsa-sha1") - } - Self::HttpColonSlashSlashWwwW3OrgSlash2001Slash04SlashXmldsigMoreHashRsaSha256 => { - write!(f, "http://www.w3.org/2001/04/xmldsig-more#rsa-sha256") - } - Self::HttpColonSlashSlashWwwW3OrgSlash2001Slash04SlashXmldsigMoreHashRsaSha384 => { - write!(f, "http://www.w3.org/2001/04/xmldsig-more#rsa-sha384") - } - Self::HttpColonSlashSlashWwwW3OrgSlash2001Slash04SlashXmldsigMoreHashRsaSha512 => { - write!(f, "http://www.w3.org/2001/04/xmldsig-more#rsa-sha512") - } - Self::HttpColonSlashSlashWwwW3OrgSlash2001Slash04SlashXmldsigMoreHashEcdsaSha1 => { - write!(f, "http://www.w3.org/2001/04/xmldsig-more#ecdsa-sha1") - } - Self::HttpColonSlashSlashWwwW3OrgSlash2001Slash04SlashXmldsigMoreHashEcdsaSha256 => { - write!(f, "http://www.w3.org/2001/04/xmldsig-more#ecdsa-sha256") - } - Self::HttpColonSlashSlashWwwW3OrgSlash2001Slash04SlashXmldsigMoreHashEcdsaSha384 => { - write!(f, "http://www.w3.org/2001/04/xmldsig-more#ecdsa-sha384") - } - Self::HttpColonSlashSlashWwwW3OrgSlash2001Slash04SlashXmldsigMoreHashEcdsaSha512 => { - write!(f, "http://www.w3.org/2001/04/xmldsig-more#ecdsa-sha512") - } - Self::HttpColonSlashSlashWwwW3OrgSlash2000Slash09SlashXmldsigHashDsaSha1 => { - write!(f, "http://www.w3.org/2000/09/xmldsig#dsa-sha1") - } - } - } -} - -impl Default for SignatureAlgorithmEnum { - fn default() -> SignatureAlgorithmEnum { - Self::HttpColonSlashSlashWwwW3OrgSlash2000Slash09SlashXmldsigHashRsaSha1 - } -} diff --git a/packages/client-rust/src/models/sms_device.rs b/packages/client-rust/src/models/sms_device.rs deleted file mode 100644 index 0df7003db6..0000000000 --- a/packages/client-rust/src/models/sms_device.rs +++ /dev/null @@ -1,42 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// SmsDevice : Serializer for sms authenticator devices -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct SmsDevice { - /// The human-readable name of this device. - #[serde(rename = "name")] - pub name: String, - #[serde(rename = "pk")] - pub pk: i32, - #[serde(rename = "phone_number")] - pub phone_number: String, - #[serde(rename = "user")] - pub user: models::PartialUser, -} - -impl SmsDevice { - /// Serializer for sms authenticator devices - pub fn new( - name: String, - pk: i32, - phone_number: String, - user: models::PartialUser, - ) -> SmsDevice { - SmsDevice { - name, - pk, - phone_number, - user, - } - } -} diff --git a/packages/client-rust/src/models/sms_device_request.rs b/packages/client-rust/src/models/sms_device_request.rs deleted file mode 100644 index 1af0e66446..0000000000 --- a/packages/client-rust/src/models/sms_device_request.rs +++ /dev/null @@ -1,26 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// SmsDeviceRequest : Serializer for sms authenticator devices -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct SmsDeviceRequest { - /// The human-readable name of this device. - #[serde(rename = "name")] - pub name: String, -} - -impl SmsDeviceRequest { - /// Serializer for sms authenticator devices - pub fn new(name: String) -> SmsDeviceRequest { - SmsDeviceRequest { name } - } -} diff --git a/packages/client-rust/src/models/software.rs b/packages/client-rust/src/models/software.rs deleted file mode 100644 index acce00b8fd..0000000000 --- a/packages/client-rust/src/models/software.rs +++ /dev/null @@ -1,34 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct Software { - #[serde(rename = "name")] - pub name: String, - #[serde(rename = "version", skip_serializing_if = "Option::is_none")] - pub version: Option, - #[serde(rename = "source")] - pub source: String, - #[serde(rename = "path", skip_serializing_if = "Option::is_none")] - pub path: Option, -} - -impl Software { - pub fn new(name: String, source: String) -> Software { - Software { - name, - version: None, - source, - path: None, - } - } -} diff --git a/packages/client-rust/src/models/software_request.rs b/packages/client-rust/src/models/software_request.rs deleted file mode 100644 index 4db878da35..0000000000 --- a/packages/client-rust/src/models/software_request.rs +++ /dev/null @@ -1,34 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct SoftwareRequest { - #[serde(rename = "name")] - pub name: String, - #[serde(rename = "version", skip_serializing_if = "Option::is_none")] - pub version: Option, - #[serde(rename = "source")] - pub source: String, - #[serde(rename = "path", skip_serializing_if = "Option::is_none")] - pub path: Option, -} - -impl SoftwareRequest { - pub fn new(name: String, source: String) -> SoftwareRequest { - SoftwareRequest { - name, - version: None, - source, - path: None, - } - } -} diff --git a/packages/client-rust/src/models/source.rs b/packages/client-rust/src/models/source.rs deleted file mode 100644 index b01e9d9957..0000000000 --- a/packages/client-rust/src/models/source.rs +++ /dev/null @@ -1,127 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// Source : Source Serializer -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct Source { - #[serde(rename = "pk")] - pub pk: uuid::Uuid, - /// Source's display Name. - #[serde(rename = "name")] - pub name: String, - /// Internal source name, used in URLs. - #[serde(rename = "slug")] - pub slug: String, - #[serde(rename = "enabled", skip_serializing_if = "Option::is_none")] - pub enabled: Option, - /// When enabled, this source will be displayed as a prominent button on the login page, - /// instead of a small icon. - #[serde(rename = "promoted", skip_serializing_if = "Option::is_none")] - pub promoted: Option, - /// Flow to use when authenticating existing users. - #[serde( - rename = "authentication_flow", - default, - with = "::serde_with::rust::double_option", - skip_serializing_if = "Option::is_none" - )] - pub authentication_flow: Option>, - /// Flow to use when enrolling new users. - #[serde( - rename = "enrollment_flow", - default, - with = "::serde_with::rust::double_option", - skip_serializing_if = "Option::is_none" - )] - pub enrollment_flow: Option>, - #[serde( - rename = "user_property_mappings", - skip_serializing_if = "Option::is_none" - )] - pub user_property_mappings: Option>, - #[serde( - rename = "group_property_mappings", - skip_serializing_if = "Option::is_none" - )] - pub group_property_mappings: Option>, - /// Get object component so that we know how to edit the object - #[serde(rename = "component")] - pub component: String, - /// Return object's verbose_name - #[serde(rename = "verbose_name")] - pub verbose_name: String, - /// Return object's plural verbose_name - #[serde(rename = "verbose_name_plural")] - pub verbose_name_plural: String, - /// Return internal model name - #[serde(rename = "meta_model_name")] - pub meta_model_name: String, - #[serde(rename = "policy_engine_mode", skip_serializing_if = "Option::is_none")] - pub policy_engine_mode: Option, - /// How the source determines if an existing user should be authenticated or a new user - /// enrolled. - #[serde(rename = "user_matching_mode", skip_serializing_if = "Option::is_none")] - pub user_matching_mode: Option, - /// 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. - #[serde(rename = "managed", deserialize_with = "Option::deserialize")] - pub managed: Option, - #[serde(rename = "user_path_template", skip_serializing_if = "Option::is_none")] - pub user_path_template: Option, - #[serde(rename = "icon", skip_serializing_if = "Option::is_none")] - pub icon: Option, - /// Get the URL to the source icon - #[serde(rename = "icon_url", deserialize_with = "Option::deserialize")] - pub icon_url: Option, - #[serde(rename = "icon_themed_urls", deserialize_with = "Option::deserialize")] - pub icon_themed_urls: Option, -} - -impl Source { - /// Source Serializer - pub fn new( - pk: uuid::Uuid, - name: String, - slug: String, - component: String, - verbose_name: String, - verbose_name_plural: String, - meta_model_name: String, - managed: Option, - icon_url: Option, - icon_themed_urls: Option, - ) -> Source { - Source { - pk, - name, - slug, - enabled: None, - promoted: None, - authentication_flow: None, - enrollment_flow: None, - user_property_mappings: None, - group_property_mappings: None, - component, - verbose_name, - verbose_name_plural, - meta_model_name, - policy_engine_mode: None, - user_matching_mode: None, - managed, - user_path_template: None, - icon: None, - icon_url, - icon_themed_urls, - } - } -} diff --git a/packages/client-rust/src/models/source_stage.rs b/packages/client-rust/src/models/source_stage.rs deleted file mode 100644 index fed8a27320..0000000000 --- a/packages/client-rust/src/models/source_stage.rs +++ /dev/null @@ -1,66 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// SourceStage : SourceStage Serializer -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct SourceStage { - #[serde(rename = "pk")] - pub pk: uuid::Uuid, - #[serde(rename = "name")] - pub name: String, - /// Get object type so that we know how to edit the object - #[serde(rename = "component")] - pub component: String, - /// Return object's verbose_name - #[serde(rename = "verbose_name")] - pub verbose_name: String, - /// Return object's plural verbose_name - #[serde(rename = "verbose_name_plural")] - pub verbose_name_plural: String, - /// Return internal model name - #[serde(rename = "meta_model_name")] - pub meta_model_name: String, - #[serde(rename = "flow_set")] - pub flow_set: Vec, - #[serde(rename = "source")] - pub source: uuid::Uuid, - /// Amount of time a user can take to return from the source to continue the flow (Format: - /// hours=-1;minutes=-2;seconds=-3) - #[serde(rename = "resume_timeout", skip_serializing_if = "Option::is_none")] - pub resume_timeout: Option, -} - -impl SourceStage { - /// SourceStage Serializer - pub fn new( - pk: uuid::Uuid, - name: String, - component: String, - verbose_name: String, - verbose_name_plural: String, - meta_model_name: String, - flow_set: Vec, - source: uuid::Uuid, - ) -> SourceStage { - SourceStage { - pk, - name, - component, - verbose_name, - verbose_name_plural, - meta_model_name, - flow_set, - source, - resume_timeout: None, - } - } -} diff --git a/packages/client-rust/src/models/source_stage_request.rs b/packages/client-rust/src/models/source_stage_request.rs deleted file mode 100644 index 48f6de2942..0000000000 --- a/packages/client-rust/src/models/source_stage_request.rs +++ /dev/null @@ -1,35 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// SourceStageRequest : SourceStage Serializer -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct SourceStageRequest { - #[serde(rename = "name")] - pub name: String, - #[serde(rename = "source")] - pub source: uuid::Uuid, - /// Amount of time a user can take to return from the source to continue the flow (Format: - /// hours=-1;minutes=-2;seconds=-3) - #[serde(rename = "resume_timeout", skip_serializing_if = "Option::is_none")] - pub resume_timeout: Option, -} - -impl SourceStageRequest { - /// SourceStage Serializer - pub fn new(name: String, source: uuid::Uuid) -> SourceStageRequest { - SourceStageRequest { - name, - source, - resume_timeout: None, - } - } -} diff --git a/packages/client-rust/src/models/source_type.rs b/packages/client-rust/src/models/source_type.rs deleted file mode 100644 index c5daafc8d7..0000000000 --- a/packages/client-rust/src/models/source_type.rs +++ /dev/null @@ -1,64 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// SourceType : Serializer for SourceType -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct SourceType { - #[serde(rename = "name")] - pub name: String, - #[serde(rename = "verbose_name")] - pub verbose_name: String, - #[serde(rename = "urls_customizable")] - pub urls_customizable: bool, - #[serde(rename = "request_token_url", deserialize_with = "Option::deserialize")] - pub request_token_url: Option, - #[serde(rename = "authorization_url", deserialize_with = "Option::deserialize")] - pub authorization_url: Option, - #[serde(rename = "access_token_url", deserialize_with = "Option::deserialize")] - pub access_token_url: Option, - #[serde(rename = "profile_url", deserialize_with = "Option::deserialize")] - pub profile_url: Option, - #[serde( - rename = "oidc_well_known_url", - deserialize_with = "Option::deserialize" - )] - pub oidc_well_known_url: Option, - #[serde(rename = "oidc_jwks_url", deserialize_with = "Option::deserialize")] - pub oidc_jwks_url: Option, -} - -impl SourceType { - /// Serializer for SourceType - pub fn new( - name: String, - verbose_name: String, - urls_customizable: bool, - request_token_url: Option, - authorization_url: Option, - access_token_url: Option, - profile_url: Option, - oidc_well_known_url: Option, - oidc_jwks_url: Option, - ) -> SourceType { - SourceType { - name, - verbose_name, - urls_customizable, - request_token_url, - authorization_url, - access_token_url, - profile_url, - oidc_well_known_url, - oidc_jwks_url, - } - } -} diff --git a/packages/client-rust/src/models/ssf_provider.rs b/packages/client-rust/src/models/ssf_provider.rs deleted file mode 100644 index 6e489955ef..0000000000 --- a/packages/client-rust/src/models/ssf_provider.rs +++ /dev/null @@ -1,85 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// SsfProvider : SSFProvider Serializer -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct SsfProvider { - #[serde(rename = "pk")] - pub pk: i32, - #[serde(rename = "name")] - pub name: String, - /// Get object component so that we know how to edit the object - #[serde(rename = "component")] - pub component: String, - /// Return object's verbose_name - #[serde(rename = "verbose_name")] - pub verbose_name: String, - /// Return object's plural verbose_name - #[serde(rename = "verbose_name_plural")] - pub verbose_name_plural: String, - /// Return internal model name - #[serde(rename = "meta_model_name")] - pub meta_model_name: String, - /// Key used to sign the SSF Events. - #[serde(rename = "signing_key")] - pub signing_key: uuid::Uuid, - #[serde(rename = "token_obj")] - pub token_obj: models::Token, - #[serde( - rename = "oidc_auth_providers", - skip_serializing_if = "Option::is_none" - )] - pub oidc_auth_providers: Option>, - #[serde(rename = "oidc_auth_providers_obj")] - pub oidc_auth_providers_obj: Vec, - #[serde(rename = "ssf_url", deserialize_with = "Option::deserialize")] - pub ssf_url: Option, - #[serde(rename = "event_retention", skip_serializing_if = "Option::is_none")] - pub event_retention: Option, - #[serde( - rename = "push_verify_certificates", - skip_serializing_if = "Option::is_none" - )] - pub push_verify_certificates: Option, -} - -impl SsfProvider { - /// SSFProvider Serializer - pub fn new( - pk: i32, - name: String, - component: String, - verbose_name: String, - verbose_name_plural: String, - meta_model_name: String, - signing_key: uuid::Uuid, - token_obj: models::Token, - oidc_auth_providers_obj: Vec, - ssf_url: Option, - ) -> SsfProvider { - SsfProvider { - pk, - name, - component, - verbose_name, - verbose_name_plural, - meta_model_name, - signing_key, - token_obj, - oidc_auth_providers: None, - oidc_auth_providers_obj, - ssf_url, - event_retention: None, - push_verify_certificates: None, - } - } -} diff --git a/packages/client-rust/src/models/ssf_provider_request.rs b/packages/client-rust/src/models/ssf_provider_request.rs deleted file mode 100644 index 4d7914414d..0000000000 --- a/packages/client-rust/src/models/ssf_provider_request.rs +++ /dev/null @@ -1,46 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// SsfProviderRequest : SSFProvider Serializer -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct SsfProviderRequest { - #[serde(rename = "name")] - pub name: String, - /// Key used to sign the SSF Events. - #[serde(rename = "signing_key")] - pub signing_key: uuid::Uuid, - #[serde( - rename = "oidc_auth_providers", - skip_serializing_if = "Option::is_none" - )] - pub oidc_auth_providers: Option>, - #[serde(rename = "event_retention", skip_serializing_if = "Option::is_none")] - pub event_retention: Option, - #[serde( - rename = "push_verify_certificates", - skip_serializing_if = "Option::is_none" - )] - pub push_verify_certificates: Option, -} - -impl SsfProviderRequest { - /// SSFProvider Serializer - pub fn new(name: String, signing_key: uuid::Uuid) -> SsfProviderRequest { - SsfProviderRequest { - name, - signing_key, - oidc_auth_providers: None, - event_retention: None, - push_verify_certificates: None, - } - } -} diff --git a/packages/client-rust/src/models/ssf_stream.rs b/packages/client-rust/src/models/ssf_stream.rs deleted file mode 100644 index 3c1b5ea622..0000000000 --- a/packages/client-rust/src/models/ssf_stream.rs +++ /dev/null @@ -1,66 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// SsfStream : SSFStream Serializer -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct SsfStream { - #[serde(rename = "pk")] - pub pk: uuid::Uuid, - #[serde(rename = "status", skip_serializing_if = "Option::is_none")] - pub status: Option, - #[serde(rename = "provider")] - pub provider: i32, - #[serde(rename = "provider_obj")] - pub provider_obj: models::SsfProvider, - #[serde(rename = "delivery_method")] - pub delivery_method: models::DeliveryMethodEnum, - #[serde( - rename = "endpoint_url", - default, - with = "::serde_with::rust::double_option", - skip_serializing_if = "Option::is_none" - )] - pub endpoint_url: Option>, - #[serde(rename = "events_requested", skip_serializing_if = "Option::is_none")] - pub events_requested: Option>, - #[serde(rename = "format")] - pub format: String, - #[serde(rename = "aud", skip_serializing_if = "Option::is_none")] - pub aud: Option>, - #[serde(rename = "iss")] - pub iss: String, -} - -impl SsfStream { - /// SSFStream Serializer - pub fn new( - pk: uuid::Uuid, - provider: i32, - provider_obj: models::SsfProvider, - delivery_method: models::DeliveryMethodEnum, - format: String, - iss: String, - ) -> SsfStream { - SsfStream { - pk, - status: None, - provider, - provider_obj, - delivery_method, - endpoint_url: None, - events_requested: None, - format, - aud: None, - iss, - } - } -} diff --git a/packages/client-rust/src/models/ssf_stream_status_enum.rs b/packages/client-rust/src/models/ssf_stream_status_enum.rs deleted file mode 100644 index b7df0f67c3..0000000000 --- a/packages/client-rust/src/models/ssf_stream_status_enum.rs +++ /dev/null @@ -1,38 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// -#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] -pub enum SsfStreamStatusEnum { - #[serde(rename = "enabled")] - Enabled, - #[serde(rename = "paused")] - Paused, - #[serde(rename = "disabled")] - Disabled, -} - -impl std::fmt::Display for SsfStreamStatusEnum { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - match self { - Self::Enabled => write!(f, "enabled"), - Self::Paused => write!(f, "paused"), - Self::Disabled => write!(f, "disabled"), - } - } -} - -impl Default for SsfStreamStatusEnum { - fn default() -> SsfStreamStatusEnum { - Self::Enabled - } -} diff --git a/packages/client-rust/src/models/stage.rs b/packages/client-rust/src/models/stage.rs deleted file mode 100644 index e9f8a532ee..0000000000 --- a/packages/client-rust/src/models/stage.rs +++ /dev/null @@ -1,57 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// Stage : Stage Serializer -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct Stage { - #[serde(rename = "pk")] - pub pk: uuid::Uuid, - #[serde(rename = "name")] - pub name: String, - /// Get object type so that we know how to edit the object - #[serde(rename = "component")] - pub component: String, - /// Return object's verbose_name - #[serde(rename = "verbose_name")] - pub verbose_name: String, - /// Return object's plural verbose_name - #[serde(rename = "verbose_name_plural")] - pub verbose_name_plural: String, - /// Return internal model name - #[serde(rename = "meta_model_name")] - pub meta_model_name: String, - #[serde(rename = "flow_set")] - pub flow_set: Vec, -} - -impl Stage { - /// Stage Serializer - pub fn new( - pk: uuid::Uuid, - name: String, - component: String, - verbose_name: String, - verbose_name_plural: String, - meta_model_name: String, - flow_set: Vec, - ) -> Stage { - Stage { - pk, - name, - component, - verbose_name, - verbose_name_plural, - meta_model_name, - flow_set, - } - } -} diff --git a/packages/client-rust/src/models/stage_mode_enum.rs b/packages/client-rust/src/models/stage_mode_enum.rs deleted file mode 100644 index b141f18e73..0000000000 --- a/packages/client-rust/src/models/stage_mode_enum.rs +++ /dev/null @@ -1,35 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// -#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] -pub enum StageModeEnum { - #[serde(rename = "optional")] - Optional, - #[serde(rename = "required")] - Required, -} - -impl std::fmt::Display for StageModeEnum { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - match self { - Self::Optional => write!(f, "optional"), - Self::Required => write!(f, "required"), - } - } -} - -impl Default for StageModeEnum { - fn default() -> StageModeEnum { - Self::Optional - } -} diff --git a/packages/client-rust/src/models/static_device.rs b/packages/client-rust/src/models/static_device.rs deleted file mode 100644 index 7362aa058a..0000000000 --- a/packages/client-rust/src/models/static_device.rs +++ /dev/null @@ -1,42 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// StaticDevice : Serializer for static authenticator devices -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct StaticDevice { - /// The human-readable name of this device. - #[serde(rename = "name")] - pub name: String, - #[serde(rename = "token_set")] - pub token_set: Vec, - #[serde(rename = "pk")] - pub pk: i32, - #[serde(rename = "user")] - pub user: models::PartialUser, -} - -impl StaticDevice { - /// Serializer for static authenticator devices - pub fn new( - name: String, - token_set: Vec, - pk: i32, - user: models::PartialUser, - ) -> StaticDevice { - StaticDevice { - name, - token_set, - pk, - user, - } - } -} diff --git a/packages/client-rust/src/models/static_device_request.rs b/packages/client-rust/src/models/static_device_request.rs deleted file mode 100644 index 1d465c7542..0000000000 --- a/packages/client-rust/src/models/static_device_request.rs +++ /dev/null @@ -1,26 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// StaticDeviceRequest : Serializer for static authenticator devices -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct StaticDeviceRequest { - /// The human-readable name of this device. - #[serde(rename = "name")] - pub name: String, -} - -impl StaticDeviceRequest { - /// Serializer for static authenticator devices - pub fn new(name: String) -> StaticDeviceRequest { - StaticDeviceRequest { name } - } -} diff --git a/packages/client-rust/src/models/static_device_token.rs b/packages/client-rust/src/models/static_device_token.rs deleted file mode 100644 index 8699312296..0000000000 --- a/packages/client-rust/src/models/static_device_token.rs +++ /dev/null @@ -1,25 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// StaticDeviceToken : Serializer for static device's tokens -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct StaticDeviceToken { - #[serde(rename = "token")] - pub token: String, -} - -impl StaticDeviceToken { - /// Serializer for static device's tokens - pub fn new(token: String) -> StaticDeviceToken { - StaticDeviceToken { token } - } -} diff --git a/packages/client-rust/src/models/sub_mode_enum.rs b/packages/client-rust/src/models/sub_mode_enum.rs deleted file mode 100644 index 5438fc532b..0000000000 --- a/packages/client-rust/src/models/sub_mode_enum.rs +++ /dev/null @@ -1,47 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// -#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] -pub enum SubModeEnum { - #[serde(rename = "hashed_user_id")] - HashedUserId, - #[serde(rename = "user_id")] - UserId, - #[serde(rename = "user_uuid")] - UserUuid, - #[serde(rename = "user_username")] - UserUsername, - #[serde(rename = "user_email")] - UserEmail, - #[serde(rename = "user_upn")] - UserUpn, -} - -impl std::fmt::Display for SubModeEnum { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - match self { - Self::HashedUserId => write!(f, "hashed_user_id"), - Self::UserId => write!(f, "user_id"), - Self::UserUuid => write!(f, "user_uuid"), - Self::UserUsername => write!(f, "user_username"), - Self::UserEmail => write!(f, "user_email"), - Self::UserUpn => write!(f, "user_upn"), - } - } -} - -impl Default for SubModeEnum { - fn default() -> SubModeEnum { - Self::HashedUserId - } -} diff --git a/packages/client-rust/src/models/sync_object_model_enum.rs b/packages/client-rust/src/models/sync_object_model_enum.rs deleted file mode 100644 index d73ef4bc50..0000000000 --- a/packages/client-rust/src/models/sync_object_model_enum.rs +++ /dev/null @@ -1,35 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// -#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] -pub enum SyncObjectModelEnum { - #[serde(rename = "authentik.core.models.User")] - AuthentikCoreModelsUser, - #[serde(rename = "authentik.core.models.Group")] - AuthentikCoreModelsGroup, -} - -impl std::fmt::Display for SyncObjectModelEnum { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - match self { - Self::AuthentikCoreModelsUser => write!(f, "authentik.core.models.User"), - Self::AuthentikCoreModelsGroup => write!(f, "authentik.core.models.Group"), - } - } -} - -impl Default for SyncObjectModelEnum { - fn default() -> SyncObjectModelEnum { - Self::AuthentikCoreModelsUser - } -} diff --git a/packages/client-rust/src/models/sync_object_request.rs b/packages/client-rust/src/models/sync_object_request.rs deleted file mode 100644 index fd63756c83..0000000000 --- a/packages/client-rust/src/models/sync_object_request.rs +++ /dev/null @@ -1,36 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// SyncObjectRequest : Sync object serializer -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct SyncObjectRequest { - #[serde(rename = "sync_object_model")] - pub sync_object_model: models::SyncObjectModelEnum, - #[serde(rename = "sync_object_id")] - pub sync_object_id: String, - #[serde(rename = "override_dry_run", skip_serializing_if = "Option::is_none")] - pub override_dry_run: Option, -} - -impl SyncObjectRequest { - /// Sync object serializer - pub fn new( - sync_object_model: models::SyncObjectModelEnum, - sync_object_id: String, - ) -> SyncObjectRequest { - SyncObjectRequest { - sync_object_model, - sync_object_id, - override_dry_run: None, - } - } -} diff --git a/packages/client-rust/src/models/sync_object_result.rs b/packages/client-rust/src/models/sync_object_result.rs deleted file mode 100644 index 982be6cf43..0000000000 --- a/packages/client-rust/src/models/sync_object_result.rs +++ /dev/null @@ -1,25 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// SyncObjectResult : Result of a single object sync -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct SyncObjectResult { - #[serde(rename = "messages")] - pub messages: Vec, -} - -impl SyncObjectResult { - /// Result of a single object sync - pub fn new(messages: Vec) -> SyncObjectResult { - SyncObjectResult { messages } - } -} diff --git a/packages/client-rust/src/models/sync_outgoing_trigger_mode_enum.rs b/packages/client-rust/src/models/sync_outgoing_trigger_mode_enum.rs deleted file mode 100644 index ad7bd1fe08..0000000000 --- a/packages/client-rust/src/models/sync_outgoing_trigger_mode_enum.rs +++ /dev/null @@ -1,38 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// -#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] -pub enum SyncOutgoingTriggerModeEnum { - #[serde(rename = "none")] - None, - #[serde(rename = "immediate")] - Immediate, - #[serde(rename = "deferred_end")] - DeferredEnd, -} - -impl std::fmt::Display for SyncOutgoingTriggerModeEnum { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - match self { - Self::None => write!(f, "none"), - Self::Immediate => write!(f, "immediate"), - Self::DeferredEnd => write!(f, "deferred_end"), - } - } -} - -impl Default for SyncOutgoingTriggerModeEnum { - fn default() -> SyncOutgoingTriggerModeEnum { - Self::None - } -} diff --git a/packages/client-rust/src/models/sync_status.rs b/packages/client-rust/src/models/sync_status.rs deleted file mode 100644 index 8b3369e7c5..0000000000 --- a/packages/client-rust/src/models/sync_status.rs +++ /dev/null @@ -1,36 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// SyncStatus : Provider/source sync status -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct SyncStatus { - #[serde(rename = "is_running")] - pub is_running: bool, - #[serde( - rename = "last_successful_sync", - skip_serializing_if = "Option::is_none" - )] - pub last_successful_sync: Option, - #[serde(rename = "last_sync_status", skip_serializing_if = "Option::is_none")] - pub last_sync_status: Option, -} - -impl SyncStatus { - /// Provider/source sync status - pub fn new(is_running: bool) -> SyncStatus { - SyncStatus { - is_running, - last_successful_sync: None, - last_sync_status: None, - } - } -} diff --git a/packages/client-rust/src/models/system_info.rs b/packages/client-rust/src/models/system_info.rs deleted file mode 100644 index ccde367a14..0000000000 --- a/packages/client-rust/src/models/system_info.rs +++ /dev/null @@ -1,64 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// SystemInfo : Get system information. -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct SystemInfo { - /// Get HTTP Request headers - #[serde(rename = "http_headers")] - pub http_headers: std::collections::HashMap, - /// Get HTTP host - #[serde(rename = "http_host")] - pub http_host: String, - /// Get HTTP Secure flag - #[serde(rename = "http_is_secure")] - pub http_is_secure: bool, - #[serde(rename = "runtime")] - pub runtime: models::SystemInfoRuntime, - /// Currently active brand - #[serde(rename = "brand")] - pub brand: String, - /// Current server time - #[serde(rename = "server_time")] - pub server_time: String, - /// Whether the embedded outpost is disabled - #[serde(rename = "embedded_outpost_disabled")] - pub embedded_outpost_disabled: bool, - /// Get the FQDN configured on the embedded outpost - #[serde(rename = "embedded_outpost_host")] - pub embedded_outpost_host: String, -} - -impl SystemInfo { - /// Get system information. - pub fn new( - http_headers: std::collections::HashMap, - http_host: String, - http_is_secure: bool, - runtime: models::SystemInfoRuntime, - brand: String, - server_time: String, - embedded_outpost_disabled: bool, - embedded_outpost_host: String, - ) -> SystemInfo { - SystemInfo { - http_headers, - http_host, - http_is_secure, - runtime, - brand, - server_time, - embedded_outpost_disabled, - embedded_outpost_host, - } - } -} diff --git a/packages/client-rust/src/models/system_info_runtime.rs b/packages/client-rust/src/models/system_info_runtime.rs deleted file mode 100644 index 018540a755..0000000000 --- a/packages/client-rust/src/models/system_info_runtime.rs +++ /dev/null @@ -1,60 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// SystemInfoRuntime : Get versions -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct SystemInfoRuntime { - #[serde(rename = "python_version")] - pub python_version: String, - #[serde(rename = "environment")] - pub environment: String, - #[serde(rename = "architecture")] - pub architecture: String, - #[serde(rename = "platform")] - pub platform: String, - #[serde(rename = "uname")] - pub uname: String, - #[serde(rename = "openssl_version")] - pub openssl_version: String, - #[serde( - rename = "openssl_fips_enabled", - deserialize_with = "Option::deserialize" - )] - pub openssl_fips_enabled: Option, - #[serde(rename = "authentik_version")] - pub authentik_version: String, -} - -impl SystemInfoRuntime { - /// Get versions - pub fn new( - python_version: String, - environment: String, - architecture: String, - platform: String, - uname: String, - openssl_version: String, - openssl_fips_enabled: Option, - authentik_version: String, - ) -> SystemInfoRuntime { - SystemInfoRuntime { - python_version, - environment, - architecture, - platform, - uname, - openssl_version, - openssl_fips_enabled, - authentik_version, - } - } -} diff --git a/packages/client-rust/src/models/task.rs b/packages/client-rust/src/models/task.rs deleted file mode 100644 index 766d9b5d9b..0000000000 --- a/packages/client-rust/src/models/task.rs +++ /dev/null @@ -1,92 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct Task { - #[serde(rename = "message_id", skip_serializing_if = "Option::is_none")] - pub message_id: Option, - /// Queue name - #[serde(rename = "queue_name", skip_serializing_if = "Option::is_none")] - pub queue_name: Option, - /// Dramatiq actor name - #[serde(rename = "actor_name")] - pub actor_name: String, - /// Task status - #[serde(rename = "state", skip_serializing_if = "Option::is_none")] - pub state: Option, - /// Task last modified time - #[serde(rename = "mtime", skip_serializing_if = "Option::is_none")] - pub mtime: Option, - /// Number of retries - #[serde(rename = "retries", skip_serializing_if = "Option::is_none")] - pub retries: Option, - /// Planned execution time - #[serde( - rename = "eta", - default, - with = "::serde_with::rust::double_option", - skip_serializing_if = "Option::is_none" - )] - pub eta: Option>, - #[serde(rename = "rel_obj_app_label")] - pub rel_obj_app_label: String, - #[serde(rename = "rel_obj_model")] - pub rel_obj_model: String, - #[serde( - rename = "rel_obj_id", - default, - with = "::serde_with::rust::double_option", - skip_serializing_if = "Option::is_none" - )] - pub rel_obj_id: Option>, - #[serde(rename = "uid")] - pub uid: String, - #[serde(rename = "logs")] - pub logs: Vec, - #[serde(rename = "previous_logs")] - pub previous_logs: Vec, - #[serde(rename = "aggregated_status")] - pub aggregated_status: models::TaskAggregatedStatusEnum, - #[serde(rename = "description", deserialize_with = "Option::deserialize")] - pub description: Option, -} - -impl Task { - pub fn new( - actor_name: String, - rel_obj_app_label: String, - rel_obj_model: String, - uid: String, - logs: Vec, - previous_logs: Vec, - aggregated_status: models::TaskAggregatedStatusEnum, - description: Option, - ) -> Task { - Task { - message_id: None, - queue_name: None, - actor_name, - state: None, - mtime: None, - retries: None, - eta: None, - rel_obj_app_label, - rel_obj_model, - rel_obj_id: None, - uid, - logs, - previous_logs, - aggregated_status, - description, - } - } -} diff --git a/packages/client-rust/src/models/task_aggregated_status_enum.rs b/packages/client-rust/src/models/task_aggregated_status_enum.rs deleted file mode 100644 index 59e0330136..0000000000 --- a/packages/client-rust/src/models/task_aggregated_status_enum.rs +++ /dev/null @@ -1,59 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// -#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] -pub enum TaskAggregatedStatusEnum { - #[serde(rename = "queued")] - Queued, - #[serde(rename = "consumed")] - Consumed, - #[serde(rename = "preprocess")] - Preprocess, - #[serde(rename = "running")] - Running, - #[serde(rename = "postprocess")] - Postprocess, - #[serde(rename = "rejected")] - Rejected, - #[serde(rename = "done")] - Done, - #[serde(rename = "info")] - Info, - #[serde(rename = "warning")] - Warning, - #[serde(rename = "error")] - Error, -} - -impl std::fmt::Display for TaskAggregatedStatusEnum { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - match self { - Self::Queued => write!(f, "queued"), - Self::Consumed => write!(f, "consumed"), - Self::Preprocess => write!(f, "preprocess"), - Self::Running => write!(f, "running"), - Self::Postprocess => write!(f, "postprocess"), - Self::Rejected => write!(f, "rejected"), - Self::Done => write!(f, "done"), - Self::Info => write!(f, "info"), - Self::Warning => write!(f, "warning"), - Self::Error => write!(f, "error"), - } - } -} - -impl Default for TaskAggregatedStatusEnum { - fn default() -> TaskAggregatedStatusEnum { - Self::Queued - } -} diff --git a/packages/client-rust/src/models/task_status_enum.rs b/packages/client-rust/src/models/task_status_enum.rs deleted file mode 100644 index 9c8370ea75..0000000000 --- a/packages/client-rust/src/models/task_status_enum.rs +++ /dev/null @@ -1,50 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// -#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] -pub enum TaskStatusEnum { - #[serde(rename = "queued")] - Queued, - #[serde(rename = "consumed")] - Consumed, - #[serde(rename = "preprocess")] - Preprocess, - #[serde(rename = "running")] - Running, - #[serde(rename = "postprocess")] - Postprocess, - #[serde(rename = "rejected")] - Rejected, - #[serde(rename = "done")] - Done, -} - -impl std::fmt::Display for TaskStatusEnum { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - match self { - Self::Queued => write!(f, "queued"), - Self::Consumed => write!(f, "consumed"), - Self::Preprocess => write!(f, "preprocess"), - Self::Running => write!(f, "running"), - Self::Postprocess => write!(f, "postprocess"), - Self::Rejected => write!(f, "rejected"), - Self::Done => write!(f, "done"), - } - } -} - -impl Default for TaskStatusEnum { - fn default() -> TaskStatusEnum { - Self::Queued - } -} diff --git a/packages/client-rust/src/models/telegram_auth_request.rs b/packages/client-rust/src/models/telegram_auth_request.rs deleted file mode 100644 index 891f38ec63..0000000000 --- a/packages/client-rust/src/models/telegram_auth_request.rs +++ /dev/null @@ -1,43 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct TelegramAuthRequest { - #[serde(rename = "id")] - pub id: i32, - #[serde(rename = "first_name", skip_serializing_if = "Option::is_none")] - pub first_name: Option, - #[serde(rename = "last_name", skip_serializing_if = "Option::is_none")] - pub last_name: Option, - #[serde(rename = "username", skip_serializing_if = "Option::is_none")] - pub username: Option, - #[serde(rename = "photo_url", skip_serializing_if = "Option::is_none")] - pub photo_url: Option, - #[serde(rename = "auth_date")] - pub auth_date: i32, - #[serde(rename = "hash")] - pub hash: String, -} - -impl TelegramAuthRequest { - pub fn new(id: i32, auth_date: i32, hash: String) -> TelegramAuthRequest { - TelegramAuthRequest { - id, - first_name: None, - last_name: None, - username: None, - photo_url: None, - auth_date, - hash, - } - } -} diff --git a/packages/client-rust/src/models/telegram_source.rs b/packages/client-rust/src/models/telegram_source.rs deleted file mode 100644 index 7c56f665a9..0000000000 --- a/packages/client-rust/src/models/telegram_source.rs +++ /dev/null @@ -1,143 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// TelegramSource : Source Serializer -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct TelegramSource { - #[serde(rename = "pk")] - pub pk: uuid::Uuid, - /// Source's display Name. - #[serde(rename = "name")] - pub name: String, - /// Internal source name, used in URLs. - #[serde(rename = "slug")] - pub slug: String, - #[serde(rename = "enabled", skip_serializing_if = "Option::is_none")] - pub enabled: Option, - /// When enabled, this source will be displayed as a prominent button on the login page, - /// instead of a small icon. - #[serde(rename = "promoted", skip_serializing_if = "Option::is_none")] - pub promoted: Option, - /// Flow to use when authenticating existing users. - #[serde( - rename = "authentication_flow", - default, - with = "::serde_with::rust::double_option", - skip_serializing_if = "Option::is_none" - )] - pub authentication_flow: Option>, - /// Flow to use when enrolling new users. - #[serde( - rename = "enrollment_flow", - default, - with = "::serde_with::rust::double_option", - skip_serializing_if = "Option::is_none" - )] - pub enrollment_flow: Option>, - #[serde( - rename = "user_property_mappings", - skip_serializing_if = "Option::is_none" - )] - pub user_property_mappings: Option>, - #[serde( - rename = "group_property_mappings", - skip_serializing_if = "Option::is_none" - )] - pub group_property_mappings: Option>, - /// Get object component so that we know how to edit the object - #[serde(rename = "component")] - pub component: String, - /// Return object's verbose_name - #[serde(rename = "verbose_name")] - pub verbose_name: String, - /// Return object's plural verbose_name - #[serde(rename = "verbose_name_plural")] - pub verbose_name_plural: String, - /// Return internal model name - #[serde(rename = "meta_model_name")] - pub meta_model_name: String, - #[serde(rename = "policy_engine_mode", skip_serializing_if = "Option::is_none")] - pub policy_engine_mode: Option, - /// How the source determines if an existing user should be authenticated or a new user - /// enrolled. - #[serde(rename = "user_matching_mode", skip_serializing_if = "Option::is_none")] - pub user_matching_mode: Option, - /// 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. - #[serde(rename = "managed", deserialize_with = "Option::deserialize")] - pub managed: Option, - #[serde(rename = "user_path_template", skip_serializing_if = "Option::is_none")] - pub user_path_template: Option, - #[serde(rename = "icon", skip_serializing_if = "Option::is_none")] - pub icon: Option, - #[serde(rename = "icon_url", deserialize_with = "Option::deserialize")] - pub icon_url: Option, - #[serde(rename = "icon_themed_urls", deserialize_with = "Option::deserialize")] - pub icon_themed_urls: Option, - /// Telegram bot username - #[serde(rename = "bot_username")] - pub bot_username: String, - /// Request access to send messages from your bot. - #[serde( - rename = "request_message_access", - skip_serializing_if = "Option::is_none" - )] - pub request_message_access: Option, - /// Flow used before authentication. - #[serde(rename = "pre_authentication_flow")] - pub pre_authentication_flow: uuid::Uuid, -} - -impl TelegramSource { - /// Source Serializer - pub fn new( - pk: uuid::Uuid, - name: String, - slug: String, - component: String, - verbose_name: String, - verbose_name_plural: String, - meta_model_name: String, - managed: Option, - icon_url: Option, - icon_themed_urls: Option, - bot_username: String, - pre_authentication_flow: uuid::Uuid, - ) -> TelegramSource { - TelegramSource { - pk, - name, - slug, - enabled: None, - promoted: None, - authentication_flow: None, - enrollment_flow: None, - user_property_mappings: None, - group_property_mappings: None, - component, - verbose_name, - verbose_name_plural, - meta_model_name, - policy_engine_mode: None, - user_matching_mode: None, - managed, - user_path_template: None, - icon: None, - icon_url, - icon_themed_urls, - bot_username, - request_message_access: None, - pre_authentication_flow, - } - } -} diff --git a/packages/client-rust/src/models/telegram_source_property_mapping.rs b/packages/client-rust/src/models/telegram_source_property_mapping.rs deleted file mode 100644 index 4c6b0076e4..0000000000 --- a/packages/client-rust/src/models/telegram_source_property_mapping.rs +++ /dev/null @@ -1,68 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// TelegramSourcePropertyMapping : TelegramSourcePropertyMapping Serializer -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct TelegramSourcePropertyMapping { - #[serde(rename = "pk")] - pub pk: uuid::Uuid, - /// 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. - #[serde( - rename = "managed", - default, - with = "::serde_with::rust::double_option", - skip_serializing_if = "Option::is_none" - )] - pub managed: Option>, - #[serde(rename = "name")] - pub name: String, - #[serde(rename = "expression")] - pub expression: String, - /// Get object's component so that we know how to edit the object - #[serde(rename = "component")] - pub component: String, - /// Return object's verbose_name - #[serde(rename = "verbose_name")] - pub verbose_name: String, - /// Return object's plural verbose_name - #[serde(rename = "verbose_name_plural")] - pub verbose_name_plural: String, - /// Return internal model name - #[serde(rename = "meta_model_name")] - pub meta_model_name: String, -} - -impl TelegramSourcePropertyMapping { - /// TelegramSourcePropertyMapping Serializer - pub fn new( - pk: uuid::Uuid, - name: String, - expression: String, - component: String, - verbose_name: String, - verbose_name_plural: String, - meta_model_name: String, - ) -> TelegramSourcePropertyMapping { - TelegramSourcePropertyMapping { - pk, - managed: None, - name, - expression, - component, - verbose_name, - verbose_name_plural, - meta_model_name, - } - } -} diff --git a/packages/client-rust/src/models/telegram_source_property_mapping_request.rs b/packages/client-rust/src/models/telegram_source_property_mapping_request.rs deleted file mode 100644 index 4b7e0ee46c..0000000000 --- a/packages/client-rust/src/models/telegram_source_property_mapping_request.rs +++ /dev/null @@ -1,41 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// TelegramSourcePropertyMappingRequest : TelegramSourcePropertyMapping Serializer -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct TelegramSourcePropertyMappingRequest { - /// 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. - #[serde( - rename = "managed", - default, - with = "::serde_with::rust::double_option", - skip_serializing_if = "Option::is_none" - )] - pub managed: Option>, - #[serde(rename = "name")] - pub name: String, - #[serde(rename = "expression")] - pub expression: String, -} - -impl TelegramSourcePropertyMappingRequest { - /// TelegramSourcePropertyMapping Serializer - pub fn new(name: String, expression: String) -> TelegramSourcePropertyMappingRequest { - TelegramSourcePropertyMappingRequest { - managed: None, - name, - expression, - } - } -} diff --git a/packages/client-rust/src/models/telegram_source_request.rs b/packages/client-rust/src/models/telegram_source_request.rs deleted file mode 100644 index 987bbd2a86..0000000000 --- a/packages/client-rust/src/models/telegram_source_request.rs +++ /dev/null @@ -1,109 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// TelegramSourceRequest : Source Serializer -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct TelegramSourceRequest { - /// Source's display Name. - #[serde(rename = "name")] - pub name: String, - /// Internal source name, used in URLs. - #[serde(rename = "slug")] - pub slug: String, - #[serde(rename = "enabled", skip_serializing_if = "Option::is_none")] - pub enabled: Option, - /// When enabled, this source will be displayed as a prominent button on the login page, - /// instead of a small icon. - #[serde(rename = "promoted", skip_serializing_if = "Option::is_none")] - pub promoted: Option, - /// Flow to use when authenticating existing users. - #[serde( - rename = "authentication_flow", - default, - with = "::serde_with::rust::double_option", - skip_serializing_if = "Option::is_none" - )] - pub authentication_flow: Option>, - /// Flow to use when enrolling new users. - #[serde( - rename = "enrollment_flow", - default, - with = "::serde_with::rust::double_option", - skip_serializing_if = "Option::is_none" - )] - pub enrollment_flow: Option>, - #[serde( - rename = "user_property_mappings", - skip_serializing_if = "Option::is_none" - )] - pub user_property_mappings: Option>, - #[serde( - rename = "group_property_mappings", - skip_serializing_if = "Option::is_none" - )] - pub group_property_mappings: Option>, - #[serde(rename = "policy_engine_mode", skip_serializing_if = "Option::is_none")] - pub policy_engine_mode: Option, - /// How the source determines if an existing user should be authenticated or a new user - /// enrolled. - #[serde(rename = "user_matching_mode", skip_serializing_if = "Option::is_none")] - pub user_matching_mode: Option, - #[serde(rename = "user_path_template", skip_serializing_if = "Option::is_none")] - pub user_path_template: Option, - #[serde(rename = "icon", skip_serializing_if = "Option::is_none")] - pub icon: Option, - /// Telegram bot username - #[serde(rename = "bot_username")] - pub bot_username: String, - /// Telegram bot token - #[serde(rename = "bot_token")] - pub bot_token: String, - /// Request access to send messages from your bot. - #[serde( - rename = "request_message_access", - skip_serializing_if = "Option::is_none" - )] - pub request_message_access: Option, - /// Flow used before authentication. - #[serde(rename = "pre_authentication_flow")] - pub pre_authentication_flow: uuid::Uuid, -} - -impl TelegramSourceRequest { - /// Source Serializer - pub fn new( - name: String, - slug: String, - bot_username: String, - bot_token: String, - pre_authentication_flow: uuid::Uuid, - ) -> TelegramSourceRequest { - TelegramSourceRequest { - name, - slug, - enabled: None, - promoted: None, - authentication_flow: None, - enrollment_flow: None, - user_property_mappings: None, - group_property_mappings: None, - policy_engine_mode: None, - user_matching_mode: None, - user_path_template: None, - icon: None, - bot_username, - bot_token, - request_message_access: None, - pre_authentication_flow, - } - } -} diff --git a/packages/client-rust/src/models/tenant.rs b/packages/client-rust/src/models/tenant.rs deleted file mode 100644 index 1777f9532e..0000000000 --- a/packages/client-rust/src/models/tenant.rs +++ /dev/null @@ -1,36 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// Tenant : Tenant Serializer -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct Tenant { - #[serde(rename = "tenant_uuid")] - pub tenant_uuid: uuid::Uuid, - #[serde(rename = "schema_name")] - pub schema_name: String, - #[serde(rename = "name")] - pub name: String, - #[serde(rename = "ready", skip_serializing_if = "Option::is_none")] - pub ready: Option, -} - -impl Tenant { - /// Tenant Serializer - pub fn new(tenant_uuid: uuid::Uuid, schema_name: String, name: String) -> Tenant { - Tenant { - tenant_uuid, - schema_name, - name, - ready: None, - } - } -} diff --git a/packages/client-rust/src/models/tenant_admin_group_request_request.rs b/packages/client-rust/src/models/tenant_admin_group_request_request.rs deleted file mode 100644 index 6bbe5815f4..0000000000 --- a/packages/client-rust/src/models/tenant_admin_group_request_request.rs +++ /dev/null @@ -1,25 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// TenantAdminGroupRequestRequest : Tenant admin group creation request serializer -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct TenantAdminGroupRequestRequest { - #[serde(rename = "user")] - pub user: String, -} - -impl TenantAdminGroupRequestRequest { - /// Tenant admin group creation request serializer - pub fn new(user: String) -> TenantAdminGroupRequestRequest { - TenantAdminGroupRequestRequest { user } - } -} diff --git a/packages/client-rust/src/models/tenant_recovery_key_request_request.rs b/packages/client-rust/src/models/tenant_recovery_key_request_request.rs deleted file mode 100644 index 4b46e7d984..0000000000 --- a/packages/client-rust/src/models/tenant_recovery_key_request_request.rs +++ /dev/null @@ -1,30 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// TenantRecoveryKeyRequestRequest : Tenant recovery key creation request serializer -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct TenantRecoveryKeyRequestRequest { - #[serde(rename = "user")] - pub user: String, - #[serde(rename = "duration_days")] - pub duration_days: i32, -} - -impl TenantRecoveryKeyRequestRequest { - /// Tenant recovery key creation request serializer - pub fn new(user: String, duration_days: i32) -> TenantRecoveryKeyRequestRequest { - TenantRecoveryKeyRequestRequest { - user, - duration_days, - } - } -} diff --git a/packages/client-rust/src/models/tenant_recovery_key_response.rs b/packages/client-rust/src/models/tenant_recovery_key_response.rs deleted file mode 100644 index 5a8bcecb31..0000000000 --- a/packages/client-rust/src/models/tenant_recovery_key_response.rs +++ /dev/null @@ -1,27 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// TenantRecoveryKeyResponse : Tenant recovery key creation response serializer -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct TenantRecoveryKeyResponse { - #[serde(rename = "expiry")] - pub expiry: String, - #[serde(rename = "url")] - pub url: String, -} - -impl TenantRecoveryKeyResponse { - /// Tenant recovery key creation response serializer - pub fn new(expiry: String, url: String) -> TenantRecoveryKeyResponse { - TenantRecoveryKeyResponse { expiry, url } - } -} diff --git a/packages/client-rust/src/models/tenant_request.rs b/packages/client-rust/src/models/tenant_request.rs deleted file mode 100644 index e59c3b3fdb..0000000000 --- a/packages/client-rust/src/models/tenant_request.rs +++ /dev/null @@ -1,33 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// TenantRequest : Tenant Serializer -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct TenantRequest { - #[serde(rename = "schema_name")] - pub schema_name: String, - #[serde(rename = "name")] - pub name: String, - #[serde(rename = "ready", skip_serializing_if = "Option::is_none")] - pub ready: Option, -} - -impl TenantRequest { - /// Tenant Serializer - pub fn new(schema_name: String, name: String) -> TenantRequest { - TenantRequest { - schema_name, - name, - ready: None, - } - } -} diff --git a/packages/client-rust/src/models/token.rs b/packages/client-rust/src/models/token.rs deleted file mode 100644 index d52644202f..0000000000 --- a/packages/client-rust/src/models/token.rs +++ /dev/null @@ -1,64 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// Token : Token Serializer -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct Token { - #[serde(rename = "pk")] - pub pk: uuid::Uuid, - /// 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. - #[serde( - rename = "managed", - default, - with = "::serde_with::rust::double_option", - skip_serializing_if = "Option::is_none" - )] - pub managed: Option>, - #[serde(rename = "identifier")] - pub identifier: String, - #[serde(rename = "intent", skip_serializing_if = "Option::is_none")] - pub intent: Option, - #[serde(rename = "user", skip_serializing_if = "Option::is_none")] - pub user: Option, - #[serde(rename = "user_obj")] - pub user_obj: models::User, - #[serde(rename = "description", skip_serializing_if = "Option::is_none")] - pub description: Option, - #[serde( - rename = "expires", - default, - with = "::serde_with::rust::double_option", - skip_serializing_if = "Option::is_none" - )] - pub expires: Option>, - #[serde(rename = "expiring", skip_serializing_if = "Option::is_none")] - pub expiring: Option, -} - -impl Token { - /// Token Serializer - pub fn new(pk: uuid::Uuid, identifier: String, user_obj: models::User) -> Token { - Token { - pk, - managed: None, - identifier, - intent: None, - user: None, - user_obj, - description: None, - expires: None, - expiring: None, - } - } -} diff --git a/packages/client-rust/src/models/token_model.rs b/packages/client-rust/src/models/token_model.rs deleted file mode 100644 index 1e7b8cd67a..0000000000 --- a/packages/client-rust/src/models/token_model.rs +++ /dev/null @@ -1,62 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// TokenModel : Serializer for BaseGrantModel and RefreshToken -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct TokenModel { - #[serde(rename = "pk")] - pub pk: i32, - #[serde(rename = "provider")] - pub provider: models::OAuth2Provider, - #[serde(rename = "user")] - pub user: models::User, - /// Check if token is expired yet. - #[serde(rename = "is_expired")] - pub is_expired: bool, - #[serde( - rename = "expires", - default, - with = "::serde_with::rust::double_option", - skip_serializing_if = "Option::is_none" - )] - pub expires: Option>, - #[serde(rename = "scope")] - pub scope: Vec, - /// Get the token's id_token as JSON String - #[serde(rename = "id_token")] - pub id_token: String, - #[serde(rename = "revoked", skip_serializing_if = "Option::is_none")] - pub revoked: Option, -} - -impl TokenModel { - /// Serializer for BaseGrantModel and RefreshToken - pub fn new( - pk: i32, - provider: models::OAuth2Provider, - user: models::User, - is_expired: bool, - scope: Vec, - id_token: String, - ) -> TokenModel { - TokenModel { - pk, - provider, - user, - is_expired, - expires: None, - scope, - id_token, - revoked: None, - } - } -} diff --git a/packages/client-rust/src/models/token_request.rs b/packages/client-rust/src/models/token_request.rs deleted file mode 100644 index 10d70c8eef..0000000000 --- a/packages/client-rust/src/models/token_request.rs +++ /dev/null @@ -1,58 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// TokenRequest : Token Serializer -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct TokenRequest { - /// 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. - #[serde( - rename = "managed", - default, - with = "::serde_with::rust::double_option", - skip_serializing_if = "Option::is_none" - )] - pub managed: Option>, - #[serde(rename = "identifier")] - pub identifier: String, - #[serde(rename = "intent", skip_serializing_if = "Option::is_none")] - pub intent: Option, - #[serde(rename = "user", skip_serializing_if = "Option::is_none")] - pub user: Option, - #[serde(rename = "description", skip_serializing_if = "Option::is_none")] - pub description: Option, - #[serde( - rename = "expires", - default, - with = "::serde_with::rust::double_option", - skip_serializing_if = "Option::is_none" - )] - pub expires: Option>, - #[serde(rename = "expiring", skip_serializing_if = "Option::is_none")] - pub expiring: Option, -} - -impl TokenRequest { - /// Token Serializer - pub fn new(identifier: String) -> TokenRequest { - TokenRequest { - managed: None, - identifier, - intent: None, - user: None, - description: None, - expires: None, - expiring: None, - } - } -} diff --git a/packages/client-rust/src/models/token_set_key_request.rs b/packages/client-rust/src/models/token_set_key_request.rs deleted file mode 100644 index 54fc507c03..0000000000 --- a/packages/client-rust/src/models/token_set_key_request.rs +++ /dev/null @@ -1,25 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// TokenSetKeyRequest : Set token's key -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct TokenSetKeyRequest { - #[serde(rename = "key")] - pub key: String, -} - -impl TokenSetKeyRequest { - /// Set token's key - pub fn new(key: String) -> TokenSetKeyRequest { - TokenSetKeyRequest { key } - } -} diff --git a/packages/client-rust/src/models/token_view.rs b/packages/client-rust/src/models/token_view.rs deleted file mode 100644 index d94d5fb76f..0000000000 --- a/packages/client-rust/src/models/token_view.rs +++ /dev/null @@ -1,25 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// TokenView : Show token's current key -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct TokenView { - #[serde(rename = "key")] - pub key: String, -} - -impl TokenView { - /// Show token's current key - pub fn new(key: String) -> TokenView { - TokenView { key } - } -} diff --git a/packages/client-rust/src/models/totp_device.rs b/packages/client-rust/src/models/totp_device.rs deleted file mode 100644 index 3c641c8a17..0000000000 --- a/packages/client-rust/src/models/totp_device.rs +++ /dev/null @@ -1,30 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// TotpDevice : Serializer for totp authenticator devices -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct TotpDevice { - /// The human-readable name of this device. - #[serde(rename = "name")] - pub name: String, - #[serde(rename = "pk")] - pub pk: i32, - #[serde(rename = "user")] - pub user: models::PartialUser, -} - -impl TotpDevice { - /// Serializer for totp authenticator devices - pub fn new(name: String, pk: i32, user: models::PartialUser) -> TotpDevice { - TotpDevice { name, pk, user } - } -} diff --git a/packages/client-rust/src/models/totp_device_request.rs b/packages/client-rust/src/models/totp_device_request.rs deleted file mode 100644 index be509dd9d9..0000000000 --- a/packages/client-rust/src/models/totp_device_request.rs +++ /dev/null @@ -1,26 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// TotpDeviceRequest : Serializer for totp authenticator devices -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct TotpDeviceRequest { - /// The human-readable name of this device. - #[serde(rename = "name")] - pub name: String, -} - -impl TotpDeviceRequest { - /// Serializer for totp authenticator devices - pub fn new(name: String) -> TotpDeviceRequest { - TotpDeviceRequest { name } - } -} diff --git a/packages/client-rust/src/models/transaction_application_request.rs b/packages/client-rust/src/models/transaction_application_request.rs deleted file mode 100644 index d8812255fb..0000000000 --- a/packages/client-rust/src/models/transaction_application_request.rs +++ /dev/null @@ -1,41 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// TransactionApplicationRequest : Serializer for creating a provider and an application in one -/// transaction -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct TransactionApplicationRequest { - #[serde(rename = "app")] - pub app: models::ApplicationRequest, - #[serde(rename = "provider_model")] - pub provider_model: models::ProviderModelEnum, - #[serde(rename = "provider")] - pub provider: models::ModelRequest, - #[serde(rename = "policy_bindings", skip_serializing_if = "Option::is_none")] - pub policy_bindings: Option>, -} - -impl TransactionApplicationRequest { - /// Serializer for creating a provider and an application in one transaction - pub fn new( - app: models::ApplicationRequest, - provider_model: models::ProviderModelEnum, - provider: models::ModelRequest, - ) -> TransactionApplicationRequest { - TransactionApplicationRequest { - app, - provider_model, - provider, - policy_bindings: None, - } - } -} diff --git a/packages/client-rust/src/models/transaction_application_response.rs b/packages/client-rust/src/models/transaction_application_response.rs deleted file mode 100644 index 7c2c77cf7d..0000000000 --- a/packages/client-rust/src/models/transaction_application_response.rs +++ /dev/null @@ -1,27 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// TransactionApplicationResponse : Transactional creation response -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct TransactionApplicationResponse { - #[serde(rename = "applied")] - pub applied: bool, - #[serde(rename = "logs")] - pub logs: Vec, -} - -impl TransactionApplicationResponse { - /// Transactional creation response - pub fn new(applied: bool, logs: Vec) -> TransactionApplicationResponse { - TransactionApplicationResponse { applied, logs } - } -} diff --git a/packages/client-rust/src/models/transaction_policy_binding_request.rs b/packages/client-rust/src/models/transaction_policy_binding_request.rs deleted file mode 100644 index b7aefe4658..0000000000 --- a/packages/client-rust/src/models/transaction_policy_binding_request.rs +++ /dev/null @@ -1,67 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// TransactionPolicyBindingRequest : PolicyBindingSerializer which does not require target as -/// target is set implicitly -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct TransactionPolicyBindingRequest { - #[serde( - rename = "policy", - default, - with = "::serde_with::rust::double_option", - skip_serializing_if = "Option::is_none" - )] - pub policy: Option>, - #[serde( - rename = "group", - default, - with = "::serde_with::rust::double_option", - skip_serializing_if = "Option::is_none" - )] - pub group: Option>, - #[serde( - rename = "user", - default, - with = "::serde_with::rust::double_option", - skip_serializing_if = "Option::is_none" - )] - pub user: Option>, - /// Negates the outcome of the policy. Messages are unaffected. - #[serde(rename = "negate", skip_serializing_if = "Option::is_none")] - pub negate: Option, - #[serde(rename = "enabled", skip_serializing_if = "Option::is_none")] - pub enabled: Option, - #[serde(rename = "order")] - pub order: i32, - /// Timeout after which Policy execution is terminated. - #[serde(rename = "timeout", skip_serializing_if = "Option::is_none")] - pub timeout: Option, - /// Result if the Policy execution fails. - #[serde(rename = "failure_result", skip_serializing_if = "Option::is_none")] - pub failure_result: Option, -} - -impl TransactionPolicyBindingRequest { - /// PolicyBindingSerializer which does not require target as target is set implicitly - pub fn new(order: i32) -> TransactionPolicyBindingRequest { - TransactionPolicyBindingRequest { - policy: None, - group: None, - user: None, - negate: None, - enabled: None, - order, - timeout: None, - failure_result: None, - } - } -} diff --git a/packages/client-rust/src/models/transport_mode_enum.rs b/packages/client-rust/src/models/transport_mode_enum.rs deleted file mode 100644 index 35608336bd..0000000000 --- a/packages/client-rust/src/models/transport_mode_enum.rs +++ /dev/null @@ -1,41 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// -#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] -pub enum TransportModeEnum { - #[serde(rename = "local")] - Local, - #[serde(rename = "webhook")] - Webhook, - #[serde(rename = "webhook_slack")] - WebhookSlack, - #[serde(rename = "email")] - Email, -} - -impl std::fmt::Display for TransportModeEnum { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - match self { - Self::Local => write!(f, "local"), - Self::Webhook => write!(f, "webhook"), - Self::WebhookSlack => write!(f, "webhook_slack"), - Self::Email => write!(f, "email"), - } - } -} - -impl Default for TransportModeEnum { - fn default() -> TransportModeEnum { - Self::Local - } -} diff --git a/packages/client-rust/src/models/type_create.rs b/packages/client-rust/src/models/type_create.rs deleted file mode 100644 index c38da386eb..0000000000 --- a/packages/client-rust/src/models/type_create.rs +++ /dev/null @@ -1,53 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// TypeCreate : Types of an object that can be created -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct TypeCreate { - #[serde(rename = "name")] - pub name: String, - #[serde(rename = "description")] - pub description: String, - #[serde(rename = "component")] - pub component: String, - #[serde(rename = "model_name")] - pub model_name: String, - #[serde(rename = "icon_url", skip_serializing_if = "Option::is_none")] - pub icon_url: Option, - #[serde( - rename = "requires_enterprise", - skip_serializing_if = "Option::is_none" - )] - pub requires_enterprise: Option, - #[serde(rename = "deprecated", skip_serializing_if = "Option::is_none")] - pub deprecated: Option, -} - -impl TypeCreate { - /// Types of an object that can be created - pub fn new( - name: String, - description: String, - component: String, - model_name: String, - ) -> TypeCreate { - TypeCreate { - name, - description, - component, - model_name, - icon_url: None, - requires_enterprise: None, - deprecated: None, - } - } -} diff --git a/packages/client-rust/src/models/ui_theme_enum.rs b/packages/client-rust/src/models/ui_theme_enum.rs deleted file mode 100644 index 961a53e099..0000000000 --- a/packages/client-rust/src/models/ui_theme_enum.rs +++ /dev/null @@ -1,38 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// -#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] -pub enum UiThemeEnum { - #[serde(rename = "automatic")] - Automatic, - #[serde(rename = "light")] - Light, - #[serde(rename = "dark")] - Dark, -} - -impl std::fmt::Display for UiThemeEnum { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - match self { - Self::Automatic => write!(f, "automatic"), - Self::Light => write!(f, "light"), - Self::Dark => write!(f, "dark"), - } - } -} - -impl Default for UiThemeEnum { - fn default() -> UiThemeEnum { - Self::Automatic - } -} diff --git a/packages/client-rust/src/models/unique_password_policy.rs b/packages/client-rust/src/models/unique_password_policy.rs deleted file mode 100644 index deb29ebb6f..0000000000 --- a/packages/client-rust/src/models/unique_password_policy.rs +++ /dev/null @@ -1,74 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// UniquePasswordPolicy : Password Uniqueness Policy Serializer -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct UniquePasswordPolicy { - #[serde(rename = "pk")] - pub pk: uuid::Uuid, - #[serde(rename = "name")] - pub name: String, - /// When this option is enabled, all executions of this policy will be logged. By default, only - /// execution errors are logged. - #[serde(rename = "execution_logging", skip_serializing_if = "Option::is_none")] - pub execution_logging: Option, - /// Get object component so that we know how to edit the object - #[serde(rename = "component")] - pub component: String, - /// Return object's verbose_name - #[serde(rename = "verbose_name")] - pub verbose_name: String, - /// Return object's plural verbose_name - #[serde(rename = "verbose_name_plural")] - pub verbose_name_plural: String, - /// Return internal model name - #[serde(rename = "meta_model_name")] - pub meta_model_name: String, - /// Return objects policy is bound to - #[serde(rename = "bound_to")] - pub bound_to: i32, - /// Field key to check, field keys defined in Prompt stages are available. - #[serde(rename = "password_field", skip_serializing_if = "Option::is_none")] - pub password_field: Option, - /// Number of passwords to check against. - #[serde( - rename = "num_historical_passwords", - skip_serializing_if = "Option::is_none" - )] - pub num_historical_passwords: Option, -} - -impl UniquePasswordPolicy { - /// Password Uniqueness Policy Serializer - pub fn new( - pk: uuid::Uuid, - name: String, - component: String, - verbose_name: String, - verbose_name_plural: String, - meta_model_name: String, - bound_to: i32, - ) -> UniquePasswordPolicy { - UniquePasswordPolicy { - pk, - name, - execution_logging: None, - component, - verbose_name, - verbose_name_plural, - meta_model_name, - bound_to, - password_field: None, - num_historical_passwords: None, - } - } -} diff --git a/packages/client-rust/src/models/unique_password_policy_request.rs b/packages/client-rust/src/models/unique_password_policy_request.rs deleted file mode 100644 index 7720a98019..0000000000 --- a/packages/client-rust/src/models/unique_password_policy_request.rs +++ /dev/null @@ -1,43 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// UniquePasswordPolicyRequest : Password Uniqueness Policy Serializer -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct UniquePasswordPolicyRequest { - #[serde(rename = "name")] - pub name: String, - /// When this option is enabled, all executions of this policy will be logged. By default, only - /// execution errors are logged. - #[serde(rename = "execution_logging", skip_serializing_if = "Option::is_none")] - pub execution_logging: Option, - /// Field key to check, field keys defined in Prompt stages are available. - #[serde(rename = "password_field", skip_serializing_if = "Option::is_none")] - pub password_field: Option, - /// Number of passwords to check against. - #[serde( - rename = "num_historical_passwords", - skip_serializing_if = "Option::is_none" - )] - pub num_historical_passwords: Option, -} - -impl UniquePasswordPolicyRequest { - /// Password Uniqueness Policy Serializer - pub fn new(name: String) -> UniquePasswordPolicyRequest { - UniquePasswordPolicyRequest { - name, - execution_logging: None, - password_field: None, - num_historical_passwords: None, - } - } -} diff --git a/packages/client-rust/src/models/usage_enum.rs b/packages/client-rust/src/models/usage_enum.rs deleted file mode 100644 index 6d3f091943..0000000000 --- a/packages/client-rust/src/models/usage_enum.rs +++ /dev/null @@ -1,32 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// -#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] -pub enum UsageEnum { - #[serde(rename = "media")] - Media, -} - -impl std::fmt::Display for UsageEnum { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - match self { - Self::Media => write!(f, "media"), - } - } -} - -impl Default for UsageEnum { - fn default() -> UsageEnum { - Self::Media - } -} diff --git a/packages/client-rust/src/models/used_by.rs b/packages/client-rust/src/models/used_by.rs deleted file mode 100644 index b6dca32fe4..0000000000 --- a/packages/client-rust/src/models/used_by.rs +++ /dev/null @@ -1,45 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// UsedBy : A list of all objects referencing the queried object -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct UsedBy { - #[serde(rename = "app")] - pub app: String, - #[serde(rename = "model_name")] - pub model_name: String, - #[serde(rename = "pk")] - pub pk: String, - #[serde(rename = "name")] - pub name: String, - #[serde(rename = "action")] - pub action: models::UsedByActionEnum, -} - -impl UsedBy { - /// A list of all objects referencing the queried object - pub fn new( - app: String, - model_name: String, - pk: String, - name: String, - action: models::UsedByActionEnum, - ) -> UsedBy { - UsedBy { - app, - model_name, - pk, - name, - action, - } - } -} diff --git a/packages/client-rust/src/models/used_by_action_enum.rs b/packages/client-rust/src/models/used_by_action_enum.rs deleted file mode 100644 index 6543a50d1a..0000000000 --- a/packages/client-rust/src/models/used_by_action_enum.rs +++ /dev/null @@ -1,44 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// -#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] -pub enum UsedByActionEnum { - #[serde(rename = "cascade")] - Cascade, - #[serde(rename = "cascade_many")] - CascadeMany, - #[serde(rename = "set_null")] - SetNull, - #[serde(rename = "set_default")] - SetDefault, - #[serde(rename = "left_dangling")] - LeftDangling, -} - -impl std::fmt::Display for UsedByActionEnum { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - match self { - Self::Cascade => write!(f, "cascade"), - Self::CascadeMany => write!(f, "cascade_many"), - Self::SetNull => write!(f, "set_null"), - Self::SetDefault => write!(f, "set_default"), - Self::LeftDangling => write!(f, "left_dangling"), - } - } -} - -impl Default for UsedByActionEnum { - fn default() -> UsedByActionEnum { - Self::Cascade - } -} diff --git a/packages/client-rust/src/models/user_account_request.rs b/packages/client-rust/src/models/user_account_request.rs deleted file mode 100644 index 97de2c081a..0000000000 --- a/packages/client-rust/src/models/user_account_request.rs +++ /dev/null @@ -1,25 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// UserAccountRequest : Account adding/removing operations -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct UserAccountRequest { - #[serde(rename = "pk")] - pub pk: i32, -} - -impl UserAccountRequest { - /// Account adding/removing operations - pub fn new(pk: i32) -> UserAccountRequest { - UserAccountRequest { pk } - } -} diff --git a/packages/client-rust/src/models/user_account_serializer_for_role_request.rs b/packages/client-rust/src/models/user_account_serializer_for_role_request.rs deleted file mode 100644 index 6d5a3936f5..0000000000 --- a/packages/client-rust/src/models/user_account_serializer_for_role_request.rs +++ /dev/null @@ -1,25 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// UserAccountSerializerForRoleRequest : Account adding/removing operations -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct UserAccountSerializerForRoleRequest { - #[serde(rename = "pk")] - pub pk: i32, -} - -impl UserAccountSerializerForRoleRequest { - /// Account adding/removing operations - pub fn new(pk: i32) -> UserAccountSerializerForRoleRequest { - UserAccountSerializerForRoleRequest { pk } - } -} diff --git a/packages/client-rust/src/models/user_attribute_enum.rs b/packages/client-rust/src/models/user_attribute_enum.rs deleted file mode 100644 index 9a99c3bb7e..0000000000 --- a/packages/client-rust/src/models/user_attribute_enum.rs +++ /dev/null @@ -1,35 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// -#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] -pub enum UserAttributeEnum { - #[serde(rename = "username")] - Username, - #[serde(rename = "email")] - Email, -} - -impl std::fmt::Display for UserAttributeEnum { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - match self { - Self::Username => write!(f, "username"), - Self::Email => write!(f, "email"), - } - } -} - -impl Default for UserAttributeEnum { - fn default() -> UserAttributeEnum { - Self::Username - } -} diff --git a/packages/client-rust/src/models/user_consent.rs b/packages/client-rust/src/models/user_consent.rs deleted file mode 100644 index 16d91365c3..0000000000 --- a/packages/client-rust/src/models/user_consent.rs +++ /dev/null @@ -1,47 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// UserConsent : UserConsent Serializer -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct UserConsent { - #[serde(rename = "pk")] - pub pk: i32, - #[serde( - rename = "expires", - default, - with = "::serde_with::rust::double_option", - skip_serializing_if = "Option::is_none" - )] - pub expires: Option>, - #[serde(rename = "expiring", skip_serializing_if = "Option::is_none")] - pub expiring: Option, - #[serde(rename = "user")] - pub user: models::User, - #[serde(rename = "application")] - pub application: models::Application, - #[serde(rename = "permissions", skip_serializing_if = "Option::is_none")] - pub permissions: Option, -} - -impl UserConsent { - /// UserConsent Serializer - pub fn new(pk: i32, user: models::User, application: models::Application) -> UserConsent { - UserConsent { - pk, - expires: None, - expiring: None, - user, - application, - permissions: None, - } - } -} diff --git a/packages/client-rust/src/models/user_creation_mode_enum.rs b/packages/client-rust/src/models/user_creation_mode_enum.rs deleted file mode 100644 index 41e581df88..0000000000 --- a/packages/client-rust/src/models/user_creation_mode_enum.rs +++ /dev/null @@ -1,38 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// -#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] -pub enum UserCreationModeEnum { - #[serde(rename = "never_create")] - NeverCreate, - #[serde(rename = "create_when_required")] - CreateWhenRequired, - #[serde(rename = "always_create")] - AlwaysCreate, -} - -impl std::fmt::Display for UserCreationModeEnum { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - match self { - Self::NeverCreate => write!(f, "never_create"), - Self::CreateWhenRequired => write!(f, "create_when_required"), - Self::AlwaysCreate => write!(f, "always_create"), - } - } -} - -impl Default for UserCreationModeEnum { - fn default() -> UserCreationModeEnum { - Self::NeverCreate - } -} diff --git a/packages/client-rust/src/models/user_delete_stage.rs b/packages/client-rust/src/models/user_delete_stage.rs deleted file mode 100644 index 731c7d30f2..0000000000 --- a/packages/client-rust/src/models/user_delete_stage.rs +++ /dev/null @@ -1,57 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// UserDeleteStage : UserDeleteStage Serializer -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct UserDeleteStage { - #[serde(rename = "pk")] - pub pk: uuid::Uuid, - #[serde(rename = "name")] - pub name: String, - /// Get object type so that we know how to edit the object - #[serde(rename = "component")] - pub component: String, - /// Return object's verbose_name - #[serde(rename = "verbose_name")] - pub verbose_name: String, - /// Return object's plural verbose_name - #[serde(rename = "verbose_name_plural")] - pub verbose_name_plural: String, - /// Return internal model name - #[serde(rename = "meta_model_name")] - pub meta_model_name: String, - #[serde(rename = "flow_set")] - pub flow_set: Vec, -} - -impl UserDeleteStage { - /// UserDeleteStage Serializer - pub fn new( - pk: uuid::Uuid, - name: String, - component: String, - verbose_name: String, - verbose_name_plural: String, - meta_model_name: String, - flow_set: Vec, - ) -> UserDeleteStage { - UserDeleteStage { - pk, - name, - component, - verbose_name, - verbose_name_plural, - meta_model_name, - flow_set, - } - } -} diff --git a/packages/client-rust/src/models/user_delete_stage_request.rs b/packages/client-rust/src/models/user_delete_stage_request.rs deleted file mode 100644 index 9c1412cd57..0000000000 --- a/packages/client-rust/src/models/user_delete_stage_request.rs +++ /dev/null @@ -1,25 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// UserDeleteStageRequest : UserDeleteStage Serializer -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct UserDeleteStageRequest { - #[serde(rename = "name")] - pub name: String, -} - -impl UserDeleteStageRequest { - /// UserDeleteStage Serializer - pub fn new(name: String) -> UserDeleteStageRequest { - UserDeleteStageRequest { name } - } -} diff --git a/packages/client-rust/src/models/user_fields_enum.rs b/packages/client-rust/src/models/user_fields_enum.rs deleted file mode 100644 index 23454ac978..0000000000 --- a/packages/client-rust/src/models/user_fields_enum.rs +++ /dev/null @@ -1,38 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// -#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] -pub enum UserFieldsEnum { - #[serde(rename = "email")] - Email, - #[serde(rename = "username")] - Username, - #[serde(rename = "upn")] - Upn, -} - -impl std::fmt::Display for UserFieldsEnum { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - match self { - Self::Email => write!(f, "email"), - Self::Username => write!(f, "username"), - Self::Upn => write!(f, "upn"), - } - } -} - -impl Default for UserFieldsEnum { - fn default() -> UserFieldsEnum { - Self::Email - } -} diff --git a/packages/client-rust/src/models/user_kerberos_source_connection.rs b/packages/client-rust/src/models/user_kerberos_source_connection.rs deleted file mode 100644 index eb48a1580a..0000000000 --- a/packages/client-rust/src/models/user_kerberos_source_connection.rs +++ /dev/null @@ -1,53 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// UserKerberosSourceConnection : User source connection -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct UserKerberosSourceConnection { - #[serde(rename = "pk")] - pub pk: i32, - #[serde(rename = "user")] - pub user: i32, - #[serde(rename = "source")] - pub source: uuid::Uuid, - #[serde(rename = "source_obj")] - pub source_obj: models::Source, - #[serde(rename = "identifier")] - pub identifier: String, - #[serde(rename = "created")] - pub created: String, - #[serde(rename = "last_updated")] - pub last_updated: String, -} - -impl UserKerberosSourceConnection { - /// User source connection - pub fn new( - pk: i32, - user: i32, - source: uuid::Uuid, - source_obj: models::Source, - identifier: String, - created: String, - last_updated: String, - ) -> UserKerberosSourceConnection { - UserKerberosSourceConnection { - pk, - user, - source, - source_obj, - identifier, - created, - last_updated, - } - } -} diff --git a/packages/client-rust/src/models/user_kerberos_source_connection_request.rs b/packages/client-rust/src/models/user_kerberos_source_connection_request.rs deleted file mode 100644 index 3e2350f268..0000000000 --- a/packages/client-rust/src/models/user_kerberos_source_connection_request.rs +++ /dev/null @@ -1,37 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// UserKerberosSourceConnectionRequest : User source connection -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct UserKerberosSourceConnectionRequest { - #[serde(rename = "user")] - pub user: i32, - #[serde(rename = "source")] - pub source: uuid::Uuid, - #[serde(rename = "identifier")] - pub identifier: String, -} - -impl UserKerberosSourceConnectionRequest { - /// User source connection - pub fn new( - user: i32, - source: uuid::Uuid, - identifier: String, - ) -> UserKerberosSourceConnectionRequest { - UserKerberosSourceConnectionRequest { - user, - source, - identifier, - } - } -} diff --git a/packages/client-rust/src/models/user_ldap_source_connection.rs b/packages/client-rust/src/models/user_ldap_source_connection.rs deleted file mode 100644 index 6e7139309d..0000000000 --- a/packages/client-rust/src/models/user_ldap_source_connection.rs +++ /dev/null @@ -1,57 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// UserLdapSourceConnection : User source connection -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct UserLdapSourceConnection { - #[serde(rename = "pk")] - pub pk: i32, - #[serde(rename = "user")] - pub user: i32, - #[serde(rename = "source")] - pub source: uuid::Uuid, - #[serde(rename = "source_obj")] - pub source_obj: models::Source, - #[serde(rename = "identifier")] - pub identifier: String, - #[serde(rename = "created")] - pub created: String, - #[serde(rename = "last_updated")] - pub last_updated: String, - #[serde(rename = "user_obj")] - pub user_obj: models::PartialUser, -} - -impl UserLdapSourceConnection { - /// User source connection - pub fn new( - pk: i32, - user: i32, - source: uuid::Uuid, - source_obj: models::Source, - identifier: String, - created: String, - last_updated: String, - user_obj: models::PartialUser, - ) -> UserLdapSourceConnection { - UserLdapSourceConnection { - pk, - user, - source, - source_obj, - identifier, - created, - last_updated, - user_obj, - } - } -} diff --git a/packages/client-rust/src/models/user_ldap_source_connection_request.rs b/packages/client-rust/src/models/user_ldap_source_connection_request.rs deleted file mode 100644 index f311f4ddd2..0000000000 --- a/packages/client-rust/src/models/user_ldap_source_connection_request.rs +++ /dev/null @@ -1,37 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// UserLdapSourceConnectionRequest : User source connection -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct UserLdapSourceConnectionRequest { - #[serde(rename = "user")] - pub user: i32, - #[serde(rename = "source")] - pub source: uuid::Uuid, - #[serde(rename = "identifier")] - pub identifier: String, -} - -impl UserLdapSourceConnectionRequest { - /// User source connection - pub fn new( - user: i32, - source: uuid::Uuid, - identifier: String, - ) -> UserLdapSourceConnectionRequest { - UserLdapSourceConnectionRequest { - user, - source, - identifier, - } - } -} diff --git a/packages/client-rust/src/models/user_login_stage.rs b/packages/client-rust/src/models/user_login_stage.rs deleted file mode 100644 index 0d22b91ae2..0000000000 --- a/packages/client-rust/src/models/user_login_stage.rs +++ /dev/null @@ -1,88 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// UserLoginStage : UserLoginStage Serializer -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct UserLoginStage { - #[serde(rename = "pk")] - pub pk: uuid::Uuid, - #[serde(rename = "name")] - pub name: String, - /// Get object type so that we know how to edit the object - #[serde(rename = "component")] - pub component: String, - /// Return object's verbose_name - #[serde(rename = "verbose_name")] - pub verbose_name: String, - /// Return object's plural verbose_name - #[serde(rename = "verbose_name_plural")] - pub verbose_name_plural: String, - /// Return internal model name - #[serde(rename = "meta_model_name")] - pub meta_model_name: String, - #[serde(rename = "flow_set")] - pub flow_set: Vec, - /// 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) - #[serde(rename = "session_duration", skip_serializing_if = "Option::is_none")] - pub session_duration: Option, - /// Terminate all other sessions of the user logging in. - #[serde( - rename = "terminate_other_sessions", - skip_serializing_if = "Option::is_none" - )] - pub terminate_other_sessions: Option, - /// 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) - #[serde(rename = "remember_me_offset", skip_serializing_if = "Option::is_none")] - pub remember_me_offset: Option, - /// Bind sessions created by this stage to the configured network - #[serde(rename = "network_binding", skip_serializing_if = "Option::is_none")] - pub network_binding: Option, - /// Bind sessions created by this stage to the configured GeoIP location - #[serde(rename = "geoip_binding", skip_serializing_if = "Option::is_none")] - pub geoip_binding: Option, - /// 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) - #[serde(rename = "remember_device", skip_serializing_if = "Option::is_none")] - pub remember_device: Option, -} - -impl UserLoginStage { - /// UserLoginStage Serializer - pub fn new( - pk: uuid::Uuid, - name: String, - component: String, - verbose_name: String, - verbose_name_plural: String, - meta_model_name: String, - flow_set: Vec, - ) -> UserLoginStage { - UserLoginStage { - pk, - name, - component, - verbose_name, - verbose_name_plural, - meta_model_name, - flow_set, - session_duration: None, - terminate_other_sessions: None, - remember_me_offset: None, - network_binding: None, - geoip_binding: None, - remember_device: None, - } - } -} diff --git a/packages/client-rust/src/models/user_login_stage_request.rs b/packages/client-rust/src/models/user_login_stage_request.rs deleted file mode 100644 index ace35d9acc..0000000000 --- a/packages/client-rust/src/models/user_login_stage_request.rs +++ /dev/null @@ -1,58 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// UserLoginStageRequest : UserLoginStage Serializer -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct UserLoginStageRequest { - #[serde(rename = "name")] - pub name: String, - /// 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) - #[serde(rename = "session_duration", skip_serializing_if = "Option::is_none")] - pub session_duration: Option, - /// Terminate all other sessions of the user logging in. - #[serde( - rename = "terminate_other_sessions", - skip_serializing_if = "Option::is_none" - )] - pub terminate_other_sessions: Option, - /// 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) - #[serde(rename = "remember_me_offset", skip_serializing_if = "Option::is_none")] - pub remember_me_offset: Option, - /// Bind sessions created by this stage to the configured network - #[serde(rename = "network_binding", skip_serializing_if = "Option::is_none")] - pub network_binding: Option, - /// Bind sessions created by this stage to the configured GeoIP location - #[serde(rename = "geoip_binding", skip_serializing_if = "Option::is_none")] - pub geoip_binding: Option, - /// 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) - #[serde(rename = "remember_device", skip_serializing_if = "Option::is_none")] - pub remember_device: Option, -} - -impl UserLoginStageRequest { - /// UserLoginStage Serializer - pub fn new(name: String) -> UserLoginStageRequest { - UserLoginStageRequest { - name, - session_duration: None, - terminate_other_sessions: None, - remember_me_offset: None, - network_binding: None, - geoip_binding: None, - remember_device: None, - } - } -} diff --git a/packages/client-rust/src/models/user_logout_stage.rs b/packages/client-rust/src/models/user_logout_stage.rs deleted file mode 100644 index 43366a6b0c..0000000000 --- a/packages/client-rust/src/models/user_logout_stage.rs +++ /dev/null @@ -1,57 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// UserLogoutStage : UserLogoutStage Serializer -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct UserLogoutStage { - #[serde(rename = "pk")] - pub pk: uuid::Uuid, - #[serde(rename = "name")] - pub name: String, - /// Get object type so that we know how to edit the object - #[serde(rename = "component")] - pub component: String, - /// Return object's verbose_name - #[serde(rename = "verbose_name")] - pub verbose_name: String, - /// Return object's plural verbose_name - #[serde(rename = "verbose_name_plural")] - pub verbose_name_plural: String, - /// Return internal model name - #[serde(rename = "meta_model_name")] - pub meta_model_name: String, - #[serde(rename = "flow_set")] - pub flow_set: Vec, -} - -impl UserLogoutStage { - /// UserLogoutStage Serializer - pub fn new( - pk: uuid::Uuid, - name: String, - component: String, - verbose_name: String, - verbose_name_plural: String, - meta_model_name: String, - flow_set: Vec, - ) -> UserLogoutStage { - UserLogoutStage { - pk, - name, - component, - verbose_name, - verbose_name_plural, - meta_model_name, - flow_set, - } - } -} diff --git a/packages/client-rust/src/models/user_logout_stage_request.rs b/packages/client-rust/src/models/user_logout_stage_request.rs deleted file mode 100644 index c31b273008..0000000000 --- a/packages/client-rust/src/models/user_logout_stage_request.rs +++ /dev/null @@ -1,25 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// UserLogoutStageRequest : UserLogoutStage Serializer -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct UserLogoutStageRequest { - #[serde(rename = "name")] - pub name: String, -} - -impl UserLogoutStageRequest { - /// UserLogoutStage Serializer - pub fn new(name: String) -> UserLogoutStageRequest { - UserLogoutStageRequest { name } - } -} diff --git a/packages/client-rust/src/models/user_matching_mode_enum.rs b/packages/client-rust/src/models/user_matching_mode_enum.rs deleted file mode 100644 index abc8b90f5f..0000000000 --- a/packages/client-rust/src/models/user_matching_mode_enum.rs +++ /dev/null @@ -1,44 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// -#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] -pub enum UserMatchingModeEnum { - #[serde(rename = "identifier")] - Identifier, - #[serde(rename = "email_link")] - EmailLink, - #[serde(rename = "email_deny")] - EmailDeny, - #[serde(rename = "username_link")] - UsernameLink, - #[serde(rename = "username_deny")] - UsernameDeny, -} - -impl std::fmt::Display for UserMatchingModeEnum { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - match self { - Self::Identifier => write!(f, "identifier"), - Self::EmailLink => write!(f, "email_link"), - Self::EmailDeny => write!(f, "email_deny"), - Self::UsernameLink => write!(f, "username_link"), - Self::UsernameDeny => write!(f, "username_deny"), - } - } -} - -impl Default for UserMatchingModeEnum { - fn default() -> UserMatchingModeEnum { - Self::Identifier - } -} diff --git a/packages/client-rust/src/models/user_o_auth_source_connection.rs b/packages/client-rust/src/models/user_o_auth_source_connection.rs deleted file mode 100644 index acce0747fc..0000000000 --- a/packages/client-rust/src/models/user_o_auth_source_connection.rs +++ /dev/null @@ -1,56 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// UserOAuthSourceConnection : User source connection -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct UserOAuthSourceConnection { - #[serde(rename = "pk")] - pub pk: i32, - #[serde(rename = "user")] - pub user: i32, - #[serde(rename = "source")] - pub source: uuid::Uuid, - #[serde(rename = "source_obj")] - pub source_obj: models::Source, - #[serde(rename = "identifier")] - pub identifier: String, - #[serde(rename = "created")] - pub created: String, - #[serde(rename = "last_updated")] - pub last_updated: String, - #[serde(rename = "expires", skip_serializing_if = "Option::is_none")] - pub expires: Option, -} - -impl UserOAuthSourceConnection { - /// User source connection - pub fn new( - pk: i32, - user: i32, - source: uuid::Uuid, - source_obj: models::Source, - identifier: String, - created: String, - last_updated: String, - ) -> UserOAuthSourceConnection { - UserOAuthSourceConnection { - pk, - user, - source, - source_obj, - identifier, - created, - last_updated, - expires: None, - } - } -} diff --git a/packages/client-rust/src/models/user_o_auth_source_connection_request.rs b/packages/client-rust/src/models/user_o_auth_source_connection_request.rs deleted file mode 100644 index 1624fb30b7..0000000000 --- a/packages/client-rust/src/models/user_o_auth_source_connection_request.rs +++ /dev/null @@ -1,48 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// UserOAuthSourceConnectionRequest : User source connection -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct UserOAuthSourceConnectionRequest { - #[serde(rename = "user")] - pub user: i32, - #[serde(rename = "source")] - pub source: uuid::Uuid, - #[serde(rename = "identifier")] - pub identifier: String, - #[serde( - rename = "access_token", - default, - with = "::serde_with::rust::double_option", - skip_serializing_if = "Option::is_none" - )] - pub access_token: Option>, - #[serde(rename = "expires", skip_serializing_if = "Option::is_none")] - pub expires: Option, -} - -impl UserOAuthSourceConnectionRequest { - /// User source connection - pub fn new( - user: i32, - source: uuid::Uuid, - identifier: String, - ) -> UserOAuthSourceConnectionRequest { - UserOAuthSourceConnectionRequest { - user, - source, - identifier, - access_token: None, - expires: None, - } - } -} diff --git a/packages/client-rust/src/models/user_password_set_request.rs b/packages/client-rust/src/models/user_password_set_request.rs deleted file mode 100644 index 061064a9ee..0000000000 --- a/packages/client-rust/src/models/user_password_set_request.rs +++ /dev/null @@ -1,25 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// UserPasswordSetRequest : Payload to set a users' password directly -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct UserPasswordSetRequest { - #[serde(rename = "password")] - pub password: String, -} - -impl UserPasswordSetRequest { - /// Payload to set a users' password directly - pub fn new(password: String) -> UserPasswordSetRequest { - UserPasswordSetRequest { password } - } -} diff --git a/packages/client-rust/src/models/user_path.rs b/packages/client-rust/src/models/user_path.rs deleted file mode 100644 index 8e31fa7dee..0000000000 --- a/packages/client-rust/src/models/user_path.rs +++ /dev/null @@ -1,23 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct UserPath { - #[serde(rename = "paths")] - pub paths: Vec, -} - -impl UserPath { - pub fn new(paths: Vec) -> UserPath { - UserPath { paths } - } -} diff --git a/packages/client-rust/src/models/user_plex_source_connection.rs b/packages/client-rust/src/models/user_plex_source_connection.rs deleted file mode 100644 index b9374091a7..0000000000 --- a/packages/client-rust/src/models/user_plex_source_connection.rs +++ /dev/null @@ -1,53 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// UserPlexSourceConnection : User source connection -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct UserPlexSourceConnection { - #[serde(rename = "pk")] - pub pk: i32, - #[serde(rename = "user")] - pub user: i32, - #[serde(rename = "source")] - pub source: uuid::Uuid, - #[serde(rename = "source_obj")] - pub source_obj: models::Source, - #[serde(rename = "identifier")] - pub identifier: String, - #[serde(rename = "created")] - pub created: String, - #[serde(rename = "last_updated")] - pub last_updated: String, -} - -impl UserPlexSourceConnection { - /// User source connection - pub fn new( - pk: i32, - user: i32, - source: uuid::Uuid, - source_obj: models::Source, - identifier: String, - created: String, - last_updated: String, - ) -> UserPlexSourceConnection { - UserPlexSourceConnection { - pk, - user, - source, - source_obj, - identifier, - created, - last_updated, - } - } -} diff --git a/packages/client-rust/src/models/user_plex_source_connection_request.rs b/packages/client-rust/src/models/user_plex_source_connection_request.rs deleted file mode 100644 index 5d4ef8fc9a..0000000000 --- a/packages/client-rust/src/models/user_plex_source_connection_request.rs +++ /dev/null @@ -1,41 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// UserPlexSourceConnectionRequest : User source connection -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct UserPlexSourceConnectionRequest { - #[serde(rename = "user")] - pub user: i32, - #[serde(rename = "source")] - pub source: uuid::Uuid, - #[serde(rename = "identifier")] - pub identifier: String, - #[serde(rename = "plex_token")] - pub plex_token: String, -} - -impl UserPlexSourceConnectionRequest { - /// User source connection - pub fn new( - user: i32, - source: uuid::Uuid, - identifier: String, - plex_token: String, - ) -> UserPlexSourceConnectionRequest { - UserPlexSourceConnectionRequest { - user, - source, - identifier, - plex_token, - } - } -} diff --git a/packages/client-rust/src/models/user_recovery_email_request.rs b/packages/client-rust/src/models/user_recovery_email_request.rs deleted file mode 100644 index e3d64062f3..0000000000 --- a/packages/client-rust/src/models/user_recovery_email_request.rs +++ /dev/null @@ -1,30 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// UserRecoveryEmailRequest : Payload to create and email a recovery link -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct UserRecoveryEmailRequest { - #[serde(rename = "token_duration", skip_serializing_if = "Option::is_none")] - pub token_duration: Option, - #[serde(rename = "email_stage")] - pub email_stage: uuid::Uuid, -} - -impl UserRecoveryEmailRequest { - /// Payload to create and email a recovery link - pub fn new(email_stage: uuid::Uuid) -> UserRecoveryEmailRequest { - UserRecoveryEmailRequest { - token_duration: None, - email_stage, - } - } -} diff --git a/packages/client-rust/src/models/user_recovery_link_request.rs b/packages/client-rust/src/models/user_recovery_link_request.rs deleted file mode 100644 index 6aa28544d8..0000000000 --- a/packages/client-rust/src/models/user_recovery_link_request.rs +++ /dev/null @@ -1,27 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// UserRecoveryLinkRequest : Payload to create a recovery link -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct UserRecoveryLinkRequest { - #[serde(rename = "token_duration", skip_serializing_if = "Option::is_none")] - pub token_duration: Option, -} - -impl UserRecoveryLinkRequest { - /// Payload to create a recovery link - pub fn new() -> UserRecoveryLinkRequest { - UserRecoveryLinkRequest { - token_duration: None, - } - } -} diff --git a/packages/client-rust/src/models/user_request.rs b/packages/client-rust/src/models/user_request.rs deleted file mode 100644 index ce26ee070c..0000000000 --- a/packages/client-rust/src/models/user_request.rs +++ /dev/null @@ -1,62 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// UserRequest : User Serializer -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct UserRequest { - #[serde(rename = "username")] - pub username: String, - /// User's display name. - #[serde(rename = "name")] - pub name: String, - /// Designates whether this user should be treated as active. Unselect this instead of deleting - /// accounts. - #[serde(rename = "is_active", skip_serializing_if = "Option::is_none")] - pub is_active: Option, - #[serde( - rename = "last_login", - default, - with = "::serde_with::rust::double_option", - skip_serializing_if = "Option::is_none" - )] - pub last_login: Option>, - #[serde(rename = "groups", skip_serializing_if = "Option::is_none")] - pub groups: Option>, - #[serde(rename = "roles", skip_serializing_if = "Option::is_none")] - pub roles: Option>, - #[serde(rename = "email", skip_serializing_if = "Option::is_none")] - pub email: Option, - #[serde(rename = "attributes", skip_serializing_if = "Option::is_none")] - pub attributes: Option>, - #[serde(rename = "path", skip_serializing_if = "Option::is_none")] - pub path: Option, - #[serde(rename = "type", skip_serializing_if = "Option::is_none")] - pub r#type: Option, -} - -impl UserRequest { - /// User Serializer - pub fn new(username: String, name: String) -> UserRequest { - UserRequest { - username, - name, - is_active: None, - last_login: None, - groups: None, - roles: None, - email: None, - attributes: None, - path: None, - r#type: None, - } - } -} diff --git a/packages/client-rust/src/models/user_saml_source_connection.rs b/packages/client-rust/src/models/user_saml_source_connection.rs deleted file mode 100644 index 6e62431e8f..0000000000 --- a/packages/client-rust/src/models/user_saml_source_connection.rs +++ /dev/null @@ -1,53 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// UserSamlSourceConnection : User source connection -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct UserSamlSourceConnection { - #[serde(rename = "pk")] - pub pk: i32, - #[serde(rename = "user")] - pub user: i32, - #[serde(rename = "source")] - pub source: uuid::Uuid, - #[serde(rename = "source_obj")] - pub source_obj: models::Source, - #[serde(rename = "identifier")] - pub identifier: String, - #[serde(rename = "created")] - pub created: String, - #[serde(rename = "last_updated")] - pub last_updated: String, -} - -impl UserSamlSourceConnection { - /// User source connection - pub fn new( - pk: i32, - user: i32, - source: uuid::Uuid, - source_obj: models::Source, - identifier: String, - created: String, - last_updated: String, - ) -> UserSamlSourceConnection { - UserSamlSourceConnection { - pk, - user, - source, - source_obj, - identifier, - created, - last_updated, - } - } -} diff --git a/packages/client-rust/src/models/user_saml_source_connection_request.rs b/packages/client-rust/src/models/user_saml_source_connection_request.rs deleted file mode 100644 index cd55324ead..0000000000 --- a/packages/client-rust/src/models/user_saml_source_connection_request.rs +++ /dev/null @@ -1,37 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// UserSamlSourceConnectionRequest : User source connection -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct UserSamlSourceConnectionRequest { - #[serde(rename = "user")] - pub user: i32, - #[serde(rename = "source")] - pub source: uuid::Uuid, - #[serde(rename = "identifier")] - pub identifier: String, -} - -impl UserSamlSourceConnectionRequest { - /// User source connection - pub fn new( - user: i32, - source: uuid::Uuid, - identifier: String, - ) -> UserSamlSourceConnectionRequest { - UserSamlSourceConnectionRequest { - user, - source, - identifier, - } - } -} diff --git a/packages/client-rust/src/models/user_service_account_request.rs b/packages/client-rust/src/models/user_service_account_request.rs deleted file mode 100644 index 70930a20d0..0000000000 --- a/packages/client-rust/src/models/user_service_account_request.rs +++ /dev/null @@ -1,37 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// UserServiceAccountRequest : Payload to create a service account -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct UserServiceAccountRequest { - #[serde(rename = "name")] - pub name: String, - #[serde(rename = "create_group", skip_serializing_if = "Option::is_none")] - pub create_group: Option, - #[serde(rename = "expiring", skip_serializing_if = "Option::is_none")] - pub expiring: Option, - /// If not provided, valid for 360 days - #[serde(rename = "expires", skip_serializing_if = "Option::is_none")] - pub expires: Option, -} - -impl UserServiceAccountRequest { - /// Payload to create a service account - pub fn new(name: String) -> UserServiceAccountRequest { - UserServiceAccountRequest { - name, - create_group: None, - expiring: None, - expires: None, - } - } -} diff --git a/packages/client-rust/src/models/user_service_account_response.rs b/packages/client-rust/src/models/user_service_account_response.rs deleted file mode 100644 index 8a6245dd35..0000000000 --- a/packages/client-rust/src/models/user_service_account_response.rs +++ /dev/null @@ -1,42 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct UserServiceAccountResponse { - #[serde(rename = "username")] - pub username: String, - #[serde(rename = "token")] - pub token: String, - #[serde(rename = "user_uid")] - pub user_uid: String, - #[serde(rename = "user_pk")] - pub user_pk: i32, - #[serde(rename = "group_pk", skip_serializing_if = "Option::is_none")] - pub group_pk: Option, -} - -impl UserServiceAccountResponse { - pub fn new( - username: String, - token: String, - user_uid: String, - user_pk: i32, - ) -> UserServiceAccountResponse { - UserServiceAccountResponse { - username, - token, - user_uid, - user_pk, - group_pk: None, - } - } -} diff --git a/packages/client-rust/src/models/user_setting.rs b/packages/client-rust/src/models/user_setting.rs deleted file mode 100644 index 834fff5966..0000000000 --- a/packages/client-rust/src/models/user_setting.rs +++ /dev/null @@ -1,39 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// UserSetting : Serializer for User settings for stages and sources -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct UserSetting { - #[serde(rename = "object_uid")] - pub object_uid: String, - #[serde(rename = "component")] - pub component: String, - #[serde(rename = "title")] - pub title: String, - #[serde(rename = "configure_url", skip_serializing_if = "Option::is_none")] - pub configure_url: Option, - #[serde(rename = "icon_url", skip_serializing_if = "Option::is_none")] - pub icon_url: Option, -} - -impl UserSetting { - /// Serializer for User settings for stages and sources - pub fn new(object_uid: String, component: String, title: String) -> UserSetting { - UserSetting { - object_uid, - component, - title, - configure_url: None, - icon_url: None, - } - } -} diff --git a/packages/client-rust/src/models/user_source_connection.rs b/packages/client-rust/src/models/user_source_connection.rs deleted file mode 100644 index 2109ac3efe..0000000000 --- a/packages/client-rust/src/models/user_source_connection.rs +++ /dev/null @@ -1,53 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// UserSourceConnection : User source connection -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct UserSourceConnection { - #[serde(rename = "pk")] - pub pk: i32, - #[serde(rename = "user")] - pub user: i32, - #[serde(rename = "source")] - pub source: uuid::Uuid, - #[serde(rename = "source_obj")] - pub source_obj: models::Source, - #[serde(rename = "identifier")] - pub identifier: String, - #[serde(rename = "created")] - pub created: String, - #[serde(rename = "last_updated")] - pub last_updated: String, -} - -impl UserSourceConnection { - /// User source connection - pub fn new( - pk: i32, - user: i32, - source: uuid::Uuid, - source_obj: models::Source, - identifier: String, - created: String, - last_updated: String, - ) -> UserSourceConnection { - UserSourceConnection { - pk, - user, - source, - source_obj, - identifier, - created, - last_updated, - } - } -} diff --git a/packages/client-rust/src/models/user_source_connection_request.rs b/packages/client-rust/src/models/user_source_connection_request.rs deleted file mode 100644 index 4c691ed4ce..0000000000 --- a/packages/client-rust/src/models/user_source_connection_request.rs +++ /dev/null @@ -1,33 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// UserSourceConnectionRequest : User source connection -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct UserSourceConnectionRequest { - #[serde(rename = "user")] - pub user: i32, - #[serde(rename = "source")] - pub source: uuid::Uuid, - #[serde(rename = "identifier")] - pub identifier: String, -} - -impl UserSourceConnectionRequest { - /// User source connection - pub fn new(user: i32, source: uuid::Uuid, identifier: String) -> UserSourceConnectionRequest { - UserSourceConnectionRequest { - user, - source, - identifier, - } - } -} diff --git a/packages/client-rust/src/models/user_telegram_source_connection.rs b/packages/client-rust/src/models/user_telegram_source_connection.rs deleted file mode 100644 index 8a5792294f..0000000000 --- a/packages/client-rust/src/models/user_telegram_source_connection.rs +++ /dev/null @@ -1,53 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// UserTelegramSourceConnection : User source connection -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct UserTelegramSourceConnection { - #[serde(rename = "pk")] - pub pk: i32, - #[serde(rename = "user")] - pub user: i32, - #[serde(rename = "source")] - pub source: uuid::Uuid, - #[serde(rename = "source_obj")] - pub source_obj: models::Source, - #[serde(rename = "identifier")] - pub identifier: String, - #[serde(rename = "created")] - pub created: String, - #[serde(rename = "last_updated")] - pub last_updated: String, -} - -impl UserTelegramSourceConnection { - /// User source connection - pub fn new( - pk: i32, - user: i32, - source: uuid::Uuid, - source_obj: models::Source, - identifier: String, - created: String, - last_updated: String, - ) -> UserTelegramSourceConnection { - UserTelegramSourceConnection { - pk, - user, - source, - source_obj, - identifier, - created, - last_updated, - } - } -} diff --git a/packages/client-rust/src/models/user_telegram_source_connection_request.rs b/packages/client-rust/src/models/user_telegram_source_connection_request.rs deleted file mode 100644 index 3a3ecc2bbf..0000000000 --- a/packages/client-rust/src/models/user_telegram_source_connection_request.rs +++ /dev/null @@ -1,37 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// UserTelegramSourceConnectionRequest : User source connection -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct UserTelegramSourceConnectionRequest { - #[serde(rename = "user")] - pub user: i32, - #[serde(rename = "source")] - pub source: uuid::Uuid, - #[serde(rename = "identifier")] - pub identifier: String, -} - -impl UserTelegramSourceConnectionRequest { - /// User source connection - pub fn new( - user: i32, - source: uuid::Uuid, - identifier: String, - ) -> UserTelegramSourceConnectionRequest { - UserTelegramSourceConnectionRequest { - user, - source, - identifier, - } - } -} diff --git a/packages/client-rust/src/models/user_verification_enum.rs b/packages/client-rust/src/models/user_verification_enum.rs deleted file mode 100644 index 4a78efe8a3..0000000000 --- a/packages/client-rust/src/models/user_verification_enum.rs +++ /dev/null @@ -1,38 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// -#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] -pub enum UserVerificationEnum { - #[serde(rename = "required")] - Required, - #[serde(rename = "preferred")] - Preferred, - #[serde(rename = "discouraged")] - Discouraged, -} - -impl std::fmt::Display for UserVerificationEnum { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - match self { - Self::Required => write!(f, "required"), - Self::Preferred => write!(f, "preferred"), - Self::Discouraged => write!(f, "discouraged"), - } - } -} - -impl Default for UserVerificationEnum { - fn default() -> UserVerificationEnum { - Self::Required - } -} diff --git a/packages/client-rust/src/models/user_write_stage.rs b/packages/client-rust/src/models/user_write_stage.rs deleted file mode 100644 index dcd752c49d..0000000000 --- a/packages/client-rust/src/models/user_write_stage.rs +++ /dev/null @@ -1,82 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// UserWriteStage : UserWriteStage Serializer -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct UserWriteStage { - #[serde(rename = "pk")] - pub pk: uuid::Uuid, - #[serde(rename = "name")] - pub name: String, - /// Get object type so that we know how to edit the object - #[serde(rename = "component")] - pub component: String, - /// Return object's verbose_name - #[serde(rename = "verbose_name")] - pub verbose_name: String, - /// Return object's plural verbose_name - #[serde(rename = "verbose_name_plural")] - pub verbose_name_plural: String, - /// Return internal model name - #[serde(rename = "meta_model_name")] - pub meta_model_name: String, - #[serde(rename = "flow_set")] - pub flow_set: Vec, - #[serde(rename = "user_creation_mode", skip_serializing_if = "Option::is_none")] - pub user_creation_mode: Option, - /// When set, newly created users are inactive and cannot login. - #[serde( - rename = "create_users_as_inactive", - skip_serializing_if = "Option::is_none" - )] - pub create_users_as_inactive: Option, - /// Optionally add newly created users to this group. - #[serde( - rename = "create_users_group", - default, - with = "::serde_with::rust::double_option", - skip_serializing_if = "Option::is_none" - )] - pub create_users_group: Option>, - #[serde(rename = "user_type", skip_serializing_if = "Option::is_none")] - pub user_type: Option, - #[serde(rename = "user_path_template", skip_serializing_if = "Option::is_none")] - pub user_path_template: Option, -} - -impl UserWriteStage { - /// UserWriteStage Serializer - pub fn new( - pk: uuid::Uuid, - name: String, - component: String, - verbose_name: String, - verbose_name_plural: String, - meta_model_name: String, - flow_set: Vec, - ) -> UserWriteStage { - UserWriteStage { - pk, - name, - component, - verbose_name, - verbose_name_plural, - meta_model_name, - flow_set, - user_creation_mode: None, - create_users_as_inactive: None, - create_users_group: None, - user_type: None, - user_path_template: None, - } - } -} diff --git a/packages/client-rust/src/models/user_write_stage_request.rs b/packages/client-rust/src/models/user_write_stage_request.rs deleted file mode 100644 index 42d262a459..0000000000 --- a/packages/client-rust/src/models/user_write_stage_request.rs +++ /dev/null @@ -1,52 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// UserWriteStageRequest : UserWriteStage Serializer -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct UserWriteStageRequest { - #[serde(rename = "name")] - pub name: String, - #[serde(rename = "user_creation_mode", skip_serializing_if = "Option::is_none")] - pub user_creation_mode: Option, - /// When set, newly created users are inactive and cannot login. - #[serde( - rename = "create_users_as_inactive", - skip_serializing_if = "Option::is_none" - )] - pub create_users_as_inactive: Option, - /// Optionally add newly created users to this group. - #[serde( - rename = "create_users_group", - default, - with = "::serde_with::rust::double_option", - skip_serializing_if = "Option::is_none" - )] - pub create_users_group: Option>, - #[serde(rename = "user_type", skip_serializing_if = "Option::is_none")] - pub user_type: Option, - #[serde(rename = "user_path_template", skip_serializing_if = "Option::is_none")] - pub user_path_template: Option, -} - -impl UserWriteStageRequest { - /// UserWriteStage Serializer - pub fn new(name: String) -> UserWriteStageRequest { - UserWriteStageRequest { - name, - user_creation_mode: None, - create_users_as_inactive: None, - create_users_group: None, - user_type: None, - user_path_template: None, - } - } -} diff --git a/packages/client-rust/src/models/vendor_enum.rs b/packages/client-rust/src/models/vendor_enum.rs deleted file mode 100644 index 9170412a19..0000000000 --- a/packages/client-rust/src/models/vendor_enum.rs +++ /dev/null @@ -1,41 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// -#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] -pub enum VendorEnum { - #[serde(rename = "goauthentik.io/@merged")] - GoauthentikIoSlashAtMerged, - #[serde(rename = "goauthentik.io/platform")] - GoauthentikIoSlashPlatform, - #[serde(rename = "fleetdm.com")] - FleetdmCom, - #[serde(rename = "chrome.google.com")] - ChromeGoogleCom, -} - -impl std::fmt::Display for VendorEnum { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - match self { - Self::GoauthentikIoSlashAtMerged => write!(f, "goauthentik.io/@merged"), - Self::GoauthentikIoSlashPlatform => write!(f, "goauthentik.io/platform"), - Self::FleetdmCom => write!(f, "fleetdm.com"), - Self::ChromeGoogleCom => write!(f, "chrome.google.com"), - } - } -} - -impl Default for VendorEnum { - fn default() -> VendorEnum { - Self::GoauthentikIoSlashAtMerged - } -} diff --git a/packages/client-rust/src/models/version.rs b/packages/client-rust/src/models/version.rs deleted file mode 100644 index 95de7901cc..0000000000 --- a/packages/client-rust/src/models/version.rs +++ /dev/null @@ -1,55 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// Version : Get running and latest version. -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct Version { - /// Get current version - #[serde(rename = "version_current")] - pub version_current: String, - /// Get latest version from cache - #[serde(rename = "version_latest")] - pub version_latest: String, - /// Check if latest version is valid - #[serde(rename = "version_latest_valid")] - pub version_latest_valid: bool, - /// Get build hash, if version is not latest or released - #[serde(rename = "build_hash")] - pub build_hash: String, - /// Check if we're running the latest version - #[serde(rename = "outdated")] - pub outdated: bool, - /// Check if any outpost is outdated/has a version mismatch - #[serde(rename = "outpost_outdated")] - pub outpost_outdated: bool, -} - -impl Version { - /// Get running and latest version. - pub fn new( - version_current: String, - version_latest: String, - version_latest_valid: bool, - build_hash: String, - outdated: bool, - outpost_outdated: bool, - ) -> Version { - Version { - version_current, - version_latest, - version_latest_valid, - build_hash, - outdated, - outpost_outdated, - } - } -} diff --git a/packages/client-rust/src/models/version_history.rs b/packages/client-rust/src/models/version_history.rs deleted file mode 100644 index 72447c699e..0000000000 --- a/packages/client-rust/src/models/version_history.rs +++ /dev/null @@ -1,36 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// VersionHistory : VersionHistory Serializer -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct VersionHistory { - #[serde(rename = "id")] - pub id: i32, - #[serde(rename = "timestamp")] - pub timestamp: String, - #[serde(rename = "version")] - pub version: String, - #[serde(rename = "build")] - pub build: String, -} - -impl VersionHistory { - /// VersionHistory Serializer - pub fn new(id: i32, timestamp: String, version: String, build: String) -> VersionHistory { - VersionHistory { - id, - timestamp, - version, - build, - } - } -} diff --git a/packages/client-rust/src/models/web_authn_device.rs b/packages/client-rust/src/models/web_authn_device.rs deleted file mode 100644 index 524863acde..0000000000 --- a/packages/client-rust/src/models/web_authn_device.rs +++ /dev/null @@ -1,49 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// WebAuthnDevice : Serializer for WebAuthn authenticator devices -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct WebAuthnDevice { - #[serde(rename = "pk")] - pub pk: i32, - #[serde(rename = "name")] - pub name: String, - #[serde(rename = "created_on")] - pub created_on: String, - #[serde(rename = "device_type", deserialize_with = "Option::deserialize")] - pub device_type: Option, - #[serde(rename = "aaguid")] - pub aaguid: String, - #[serde(rename = "user")] - pub user: models::PartialUser, -} - -impl WebAuthnDevice { - /// Serializer for WebAuthn authenticator devices - pub fn new( - pk: i32, - name: String, - created_on: String, - device_type: Option, - aaguid: String, - user: models::PartialUser, - ) -> WebAuthnDevice { - WebAuthnDevice { - pk, - name, - created_on, - device_type, - aaguid, - user, - } - } -} diff --git a/packages/client-rust/src/models/web_authn_device_request.rs b/packages/client-rust/src/models/web_authn_device_request.rs deleted file mode 100644 index 3e7b58d653..0000000000 --- a/packages/client-rust/src/models/web_authn_device_request.rs +++ /dev/null @@ -1,25 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// WebAuthnDeviceRequest : Serializer for WebAuthn authenticator devices -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct WebAuthnDeviceRequest { - #[serde(rename = "name")] - pub name: String, -} - -impl WebAuthnDeviceRequest { - /// Serializer for WebAuthn authenticator devices - pub fn new(name: String) -> WebAuthnDeviceRequest { - WebAuthnDeviceRequest { name } - } -} diff --git a/packages/client-rust/src/models/web_authn_device_type.rs b/packages/client-rust/src/models/web_authn_device_type.rs deleted file mode 100644 index 10f9ece44c..0000000000 --- a/packages/client-rust/src/models/web_authn_device_type.rs +++ /dev/null @@ -1,30 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// WebAuthnDeviceType : WebAuthnDeviceType Serializer -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct WebAuthnDeviceType { - #[serde(rename = "aaguid")] - pub aaguid: uuid::Uuid, - #[serde(rename = "description")] - pub description: String, -} - -impl WebAuthnDeviceType { - /// WebAuthnDeviceType Serializer - pub fn new(aaguid: uuid::Uuid, description: String) -> WebAuthnDeviceType { - WebAuthnDeviceType { - aaguid, - description, - } - } -} diff --git a/packages/client-rust/src/models/web_authn_hint_enum.rs b/packages/client-rust/src/models/web_authn_hint_enum.rs deleted file mode 100644 index d16373715a..0000000000 --- a/packages/client-rust/src/models/web_authn_hint_enum.rs +++ /dev/null @@ -1,38 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// -#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] -pub enum WebAuthnHintEnum { - #[serde(rename = "security-key")] - SecurityKey, - #[serde(rename = "client-device")] - ClientDevice, - #[serde(rename = "hybrid")] - Hybrid, -} - -impl std::fmt::Display for WebAuthnHintEnum { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - match self { - Self::SecurityKey => write!(f, "security-key"), - Self::ClientDevice => write!(f, "client-device"), - Self::Hybrid => write!(f, "hybrid"), - } - } -} - -impl Default for WebAuthnHintEnum { - fn default() -> WebAuthnHintEnum { - Self::SecurityKey - } -} diff --git a/packages/client-rust/src/models/worker.rs b/packages/client-rust/src/models/worker.rs deleted file mode 100644 index 3a9143e0f5..0000000000 --- a/packages/client-rust/src/models/worker.rs +++ /dev/null @@ -1,31 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct Worker { - #[serde(rename = "worker_id")] - pub worker_id: String, - #[serde(rename = "version")] - pub version: String, - #[serde(rename = "version_matching")] - pub version_matching: bool, -} - -impl Worker { - pub fn new(worker_id: String, version: String, version_matching: bool) -> Worker { - Worker { - worker_id, - version, - version_matching, - } - } -} diff --git a/packages/client-rust/src/models/ws_federation_provider.rs b/packages/client-rust/src/models/ws_federation_provider.rs deleted file mode 100644 index 96c7fe3d25..0000000000 --- a/packages/client-rust/src/models/ws_federation_provider.rs +++ /dev/null @@ -1,214 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// WsFederationProvider : WSFederationProvider Serializer -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct WsFederationProvider { - #[serde(rename = "pk")] - pub pk: i32, - #[serde(rename = "name")] - pub name: String, - /// Flow used for authentication when the associated application is accessed by an - /// un-authenticated user. - #[serde( - rename = "authentication_flow", - default, - with = "::serde_with::rust::double_option", - skip_serializing_if = "Option::is_none" - )] - pub authentication_flow: Option>, - /// Flow used when authorizing this provider. - #[serde(rename = "authorization_flow")] - pub authorization_flow: uuid::Uuid, - /// Flow used ending the session from a provider. - #[serde(rename = "invalidation_flow")] - pub invalidation_flow: uuid::Uuid, - #[serde(rename = "property_mappings", skip_serializing_if = "Option::is_none")] - pub property_mappings: Option>, - /// Get object component so that we know how to edit the object - #[serde(rename = "component")] - pub component: String, - /// Internal application name, used in URLs. - #[serde( - rename = "assigned_application_slug", - deserialize_with = "Option::deserialize" - )] - pub assigned_application_slug: Option, - /// Application's display Name. - #[serde( - rename = "assigned_application_name", - deserialize_with = "Option::deserialize" - )] - pub assigned_application_name: Option, - /// Internal application name, used in URLs. - #[serde( - rename = "assigned_backchannel_application_slug", - deserialize_with = "Option::deserialize" - )] - pub assigned_backchannel_application_slug: Option, - /// Application's display Name. - #[serde( - rename = "assigned_backchannel_application_name", - deserialize_with = "Option::deserialize" - )] - pub assigned_backchannel_application_name: Option, - /// Return object's verbose_name - #[serde(rename = "verbose_name")] - pub verbose_name: String, - /// Return object's plural verbose_name - #[serde(rename = "verbose_name_plural")] - pub verbose_name_plural: String, - /// Return internal model name - #[serde(rename = "meta_model_name")] - pub meta_model_name: String, - #[serde(rename = "reply_url")] - pub reply_url: String, - #[serde(rename = "wtrealm")] - pub wtrealm: String, - /// Assertion valid not before current time + this value (Format: - /// hours=-1;minutes=-2;seconds=-3). - #[serde( - rename = "assertion_valid_not_before", - skip_serializing_if = "Option::is_none" - )] - pub assertion_valid_not_before: Option, - /// Assertion not valid on or after current time + this value (Format: - /// hours=1;minutes=2;seconds=3). - #[serde( - rename = "assertion_valid_not_on_or_after", - skip_serializing_if = "Option::is_none" - )] - pub assertion_valid_not_on_or_after: Option, - /// Session not valid on or after current time + this value (Format: - /// hours=1;minutes=2;seconds=3). - #[serde( - rename = "session_valid_not_on_or_after", - skip_serializing_if = "Option::is_none" - )] - pub session_valid_not_on_or_after: Option, - /// Configure how the NameID value will be created. When left empty, the NameIDPolicy of the - /// incoming request will be considered - #[serde( - rename = "name_id_mapping", - default, - with = "::serde_with::rust::double_option", - skip_serializing_if = "Option::is_none" - )] - pub name_id_mapping: Option>, - /// 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. - #[serde( - rename = "authn_context_class_ref_mapping", - default, - with = "::serde_with::rust::double_option", - skip_serializing_if = "Option::is_none" - )] - pub authn_context_class_ref_mapping: Option>, - #[serde(rename = "digest_algorithm", skip_serializing_if = "Option::is_none")] - pub digest_algorithm: Option, - #[serde( - rename = "signature_algorithm", - skip_serializing_if = "Option::is_none" - )] - pub signature_algorithm: Option, - /// Keypair used to sign outgoing Responses going to the Service Provider. - #[serde( - rename = "signing_kp", - default, - with = "::serde_with::rust::double_option", - skip_serializing_if = "Option::is_none" - )] - pub signing_kp: Option>, - /// 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. - #[serde( - rename = "encryption_kp", - default, - with = "::serde_with::rust::double_option", - skip_serializing_if = "Option::is_none" - )] - pub encryption_kp: Option>, - #[serde(rename = "sign_assertion", skip_serializing_if = "Option::is_none")] - pub sign_assertion: Option, - #[serde( - rename = "sign_logout_request", - skip_serializing_if = "Option::is_none" - )] - pub sign_logout_request: Option, - #[serde( - rename = "default_name_id_policy", - skip_serializing_if = "Option::is_none" - )] - pub default_name_id_policy: Option, - /// Get metadata download URL - #[serde(rename = "url_download_metadata")] - pub url_download_metadata: String, - /// Get WS-Fed url - #[serde(rename = "url_wsfed")] - pub url_wsfed: String, -} - -impl WsFederationProvider { - /// WSFederationProvider Serializer - pub fn new( - pk: i32, - name: String, - authorization_flow: uuid::Uuid, - invalidation_flow: uuid::Uuid, - component: String, - assigned_application_slug: Option, - assigned_application_name: Option, - assigned_backchannel_application_slug: Option, - assigned_backchannel_application_name: Option, - verbose_name: String, - verbose_name_plural: String, - meta_model_name: String, - reply_url: String, - wtrealm: String, - url_download_metadata: String, - url_wsfed: String, - ) -> WsFederationProvider { - WsFederationProvider { - pk, - name, - authentication_flow: None, - authorization_flow, - invalidation_flow, - property_mappings: None, - 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, - assertion_valid_not_before: None, - assertion_valid_not_on_or_after: None, - session_valid_not_on_or_after: None, - name_id_mapping: None, - authn_context_class_ref_mapping: None, - digest_algorithm: None, - signature_algorithm: None, - signing_kp: None, - encryption_kp: None, - sign_assertion: None, - sign_logout_request: None, - default_name_id_policy: None, - url_download_metadata, - url_wsfed, - } - } -} diff --git a/packages/client-rust/src/models/ws_federation_provider_request.rs b/packages/client-rust/src/models/ws_federation_provider_request.rs deleted file mode 100644 index 300682a804..0000000000 --- a/packages/client-rust/src/models/ws_federation_provider_request.rs +++ /dev/null @@ -1,148 +0,0 @@ -// authentik -// -// Making authentication simple. -// -// The version of the OpenAPI document: 2026.5.0-rc1 -// Contact: hello@goauthentik.io -// Generated by: https://openapi-generator.tech - -use serde::{Deserialize, Serialize}; - -use crate::models; - -/// WsFederationProviderRequest : WSFederationProvider Serializer -#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] -pub struct WsFederationProviderRequest { - #[serde(rename = "name")] - pub name: String, - /// Flow used for authentication when the associated application is accessed by an - /// un-authenticated user. - #[serde( - rename = "authentication_flow", - default, - with = "::serde_with::rust::double_option", - skip_serializing_if = "Option::is_none" - )] - pub authentication_flow: Option>, - /// Flow used when authorizing this provider. - #[serde(rename = "authorization_flow")] - pub authorization_flow: uuid::Uuid, - /// Flow used ending the session from a provider. - #[serde(rename = "invalidation_flow")] - pub invalidation_flow: uuid::Uuid, - #[serde(rename = "property_mappings", skip_serializing_if = "Option::is_none")] - pub property_mappings: Option>, - #[serde(rename = "reply_url")] - pub reply_url: String, - #[serde(rename = "wtrealm")] - pub wtrealm: String, - /// Assertion valid not before current time + this value (Format: - /// hours=-1;minutes=-2;seconds=-3). - #[serde( - rename = "assertion_valid_not_before", - skip_serializing_if = "Option::is_none" - )] - pub assertion_valid_not_before: Option, - /// Assertion not valid on or after current time + this value (Format: - /// hours=1;minutes=2;seconds=3). - #[serde( - rename = "assertion_valid_not_on_or_after", - skip_serializing_if = "Option::is_none" - )] - pub assertion_valid_not_on_or_after: Option, - /// Session not valid on or after current time + this value (Format: - /// hours=1;minutes=2;seconds=3). - #[serde( - rename = "session_valid_not_on_or_after", - skip_serializing_if = "Option::is_none" - )] - pub session_valid_not_on_or_after: Option, - /// Configure how the NameID value will be created. When left empty, the NameIDPolicy of the - /// incoming request will be considered - #[serde( - rename = "name_id_mapping", - default, - with = "::serde_with::rust::double_option", - skip_serializing_if = "Option::is_none" - )] - pub name_id_mapping: Option>, - /// 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. - #[serde( - rename = "authn_context_class_ref_mapping", - default, - with = "::serde_with::rust::double_option", - skip_serializing_if = "Option::is_none" - )] - pub authn_context_class_ref_mapping: Option>, - #[serde(rename = "digest_algorithm", skip_serializing_if = "Option::is_none")] - pub digest_algorithm: Option, - #[serde( - rename = "signature_algorithm", - skip_serializing_if = "Option::is_none" - )] - pub signature_algorithm: Option, - /// Keypair used to sign outgoing Responses going to the Service Provider. - #[serde( - rename = "signing_kp", - default, - with = "::serde_with::rust::double_option", - skip_serializing_if = "Option::is_none" - )] - pub signing_kp: Option>, - /// 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. - #[serde( - rename = "encryption_kp", - default, - with = "::serde_with::rust::double_option", - skip_serializing_if = "Option::is_none" - )] - pub encryption_kp: Option>, - #[serde(rename = "sign_assertion", skip_serializing_if = "Option::is_none")] - pub sign_assertion: Option, - #[serde( - rename = "sign_logout_request", - skip_serializing_if = "Option::is_none" - )] - pub sign_logout_request: Option, - #[serde( - rename = "default_name_id_policy", - skip_serializing_if = "Option::is_none" - )] - pub default_name_id_policy: Option, -} - -impl WsFederationProviderRequest { - /// WSFederationProvider Serializer - pub fn new( - name: String, - authorization_flow: uuid::Uuid, - invalidation_flow: uuid::Uuid, - reply_url: String, - wtrealm: String, - ) -> WsFederationProviderRequest { - WsFederationProviderRequest { - name, - authentication_flow: None, - authorization_flow, - invalidation_flow, - property_mappings: None, - reply_url, - wtrealm, - assertion_valid_not_before: None, - assertion_valid_not_on_or_after: None, - session_valid_not_on_or_after: None, - name_id_mapping: None, - authn_context_class_ref_mapping: None, - digest_algorithm: None, - signature_algorithm: None, - signing_kp: None, - encryption_kp: None, - sign_assertion: None, - sign_logout_request: None, - default_name_id_policy: None, - } - } -} diff --git a/scripts/api_filter_schema.py b/scripts/api_filter_schema.py new file mode 100755 index 0000000000..f78885f5d1 --- /dev/null +++ b/scripts/api_filter_schema.py @@ -0,0 +1,122 @@ +#!/usr/bin/env python3 + +import re +import sys +from copy import deepcopy +from pathlib import Path +from typing import Any + +from yaml import dump, safe_load + + +def collect_refs(obj: Any, refs: set[str]) -> None: + """Recursively collect all $ref strings from a schema object.""" + if isinstance(obj, dict): + if "$ref" in obj: + refs.add(obj["$ref"]) + for value in obj.values(): + collect_refs(value, refs) + elif isinstance(obj, list): + for item in obj: + collect_refs(item, refs) + + +def resolve_component_refs(schema: dict[str, Any], refs: set[str]) -> None: + """ + Expand refs by also collecting refs from the referenced components themselves, + handling transitive dependencies. + """ + components = schema.get("components", {}) + visited: set[str] = set() + + def expand(ref_set: set[str]) -> None: + new_refs = ref_set - visited + if not new_refs: + return + visited.update(new_refs) + next_refs: set[str] = set() + for ref in new_refs: + # Only handle local $refs like #/components/schemas/Foo + match = re.match(r"^#/components/(\w+)/(.+)$", ref) + if match: + section, name = match.group(1), match.group(2) + component = components.get(section, {}).get(name) + if component: + collect_refs(component, next_refs) + expand(next_refs) + + expand(refs) + refs.update(visited) + + +def filter_components(schema: dict[str, Any], refs: set[str]) -> dict[str, Any]: + """Return a filtered components dict containing only referenced entries.""" + components = schema.get("components", {}) + filtered = {} + + for section, entries in components.items(): + if not isinstance(entries, dict): + continue + kept = {} + for name, definition in entries.items(): + ref_key = f"#/components/{section}/{name}" + if ref_key in refs: + kept[name] = definition + if kept: + filtered[section] = kept + + return filtered + + +def filter_schema(schema: dict[str, Any], operation_ids: set[str]) -> dict[str, Any]: + filtered_paths = {} + all_refs: set[str] = set() + + for path, path_item in schema.get("paths", {}).items(): + filtered_methods = {} + for method, operation in path_item.items(): + if not isinstance(operation, dict): + continue + if operation.get("operationId") in operation_ids: + filtered_methods[method] = operation + collect_refs(operation, all_refs) + + # Preserve path-level fields (parameters, servers, summary) if any + # operation in this path was kept + if filtered_methods: + path_level = { + k: v + for k, v in path_item.items() + if k not in ("get", "put", "post", "delete", "options", "head", "patch", "trace") + } + collect_refs(path_level, all_refs) + filtered_paths[path] = {**path_level, **filtered_methods} + + # Resolve transitive component references + resolve_component_refs(schema, all_refs) + + result = {key: schema[key] for key in ("openapi", "info", "servers") if key in schema} + result["paths"] = filtered_paths + + filtered_components = filter_components(schema, all_refs) + if filtered_components: + result["components"] = filtered_components + + return result + + +def main(input_path: str, output_path: str, ids_path: str) -> None: + schema = safe_load(Path(input_path).read_text()) + operation_ids = { + line.strip() for line in Path(ids_path).read_text().splitlines() if line.strip() + } + + filtered = filter_schema(deepcopy(schema), operation_ids) + Path(output_path).write_text(dump(filtered, allow_unicode=True, sort_keys=False)) + + +if __name__ == "__main__": + if len(sys.argv) != 4: # noqa: PLR2004 + print("Usage: python filter_openapi.py ") + sys.exit(1) + main(*sys.argv[1:])