diff --git a/.openapi-generator/FILES b/.openapi-generator/FILES index 473d08501..110cbcd8b 100644 --- a/.openapi-generator/FILES +++ b/.openapi-generator/FILES @@ -743,7 +743,7 @@ docs/WebAuthnDeviceDeviceType.md docs/WebAuthnDeviceRequest.md docs/WebAuthnDeviceType.md docs/WebAuthnDeviceTypeRequest.md -docs/Workers.md +docs/Worker.md git_push.sh go.mod go.sum @@ -1446,6 +1446,6 @@ model_web_authn_device_device_type.go model_web_authn_device_request.go model_web_authn_device_type.go model_web_authn_device_type_request.go -model_workers.go +model_worker.go response.go utils.go diff --git a/README.md b/README.md index f650caf14..ee297a0bc 100644 --- a/README.md +++ b/README.md @@ -48,7 +48,7 @@ Class | Method | HTTP request | Description *AdminApi* | [**AdminVersionHistoryList**](docs/AdminApi.md#adminversionhistorylist) | **Get** /admin/version/history/ | *AdminApi* | [**AdminVersionHistoryRetrieve**](docs/AdminApi.md#adminversionhistoryretrieve) | **Get** /admin/version/history/{id}/ | *AdminApi* | [**AdminVersionRetrieve**](docs/AdminApi.md#adminversionretrieve) | **Get** /admin/version/ | -*AdminApi* | [**AdminWorkersRetrieve**](docs/AdminApi.md#adminworkersretrieve) | **Get** /admin/workers/ | +*AdminApi* | [**AdminWorkersList**](docs/AdminApi.md#adminworkerslist) | **Get** /admin/workers/ | *AuthenticatorsApi* | [**AuthenticatorsAdminAllList**](docs/AuthenticatorsApi.md#authenticatorsadminalllist) | **Get** /authenticators/admin/all/ | *AuthenticatorsApi* | [**AuthenticatorsAdminDuoCreate**](docs/AuthenticatorsApi.md#authenticatorsadminduocreate) | **Post** /authenticators/admin/duo/ | *AuthenticatorsApi* | [**AuthenticatorsAdminDuoDestroy**](docs/AuthenticatorsApi.md#authenticatorsadminduodestroy) | **Delete** /authenticators/admin/duo/{id}/ | @@ -1675,7 +1675,7 @@ Class | Method | HTTP request | Description - [WebAuthnDeviceRequest](docs/WebAuthnDeviceRequest.md) - [WebAuthnDeviceType](docs/WebAuthnDeviceType.md) - [WebAuthnDeviceTypeRequest](docs/WebAuthnDeviceTypeRequest.md) - - [Workers](docs/Workers.md) + - [Worker](docs/Worker.md) ## Documentation For Authorization diff --git a/api/openapi.yaml b/api/openapi.yaml index ce8003963..b9fcfa394 100644 --- a/api/openapi.yaml +++ b/api/openapi.yaml @@ -364,13 +364,15 @@ paths: /admin/workers/: get: description: Get currently connected worker count. - operationId: admin_workers_retrieve + operationId: admin_workers_list responses: "200": content: application/json: schema: - $ref: '#/components/schemas/Workers' + items: + $ref: '#/components/schemas/Worker' + type: array description: "" "400": content: @@ -73490,14 +73492,22 @@ components: - aaguid - description type: object - Workers: + Worker: example: - count: 0 + version: version + version_matching: true + worker_id: worker_id properties: - count: - type: integer + worker_id: + type: string + version: + type: string + version_matching: + type: boolean required: - - count + - version + - version_matching + - worker_id type: object modelRequest: discriminator: diff --git a/api_admin.go b/api_admin.go index f7b1dee42..cdc668982 100644 --- a/api_admin.go +++ b/api_admin.go @@ -1390,25 +1390,25 @@ func (a *AdminApiService) AdminVersionRetrieveExecute(r ApiAdminVersionRetrieveR return localVarReturnValue, localVarHTTPResponse, nil } -type ApiAdminWorkersRetrieveRequest struct { +type ApiAdminWorkersListRequest struct { ctx context.Context ApiService *AdminApiService } -func (r ApiAdminWorkersRetrieveRequest) Execute() (*Workers, *http.Response, error) { - return r.ApiService.AdminWorkersRetrieveExecute(r) +func (r ApiAdminWorkersListRequest) Execute() ([]Worker, *http.Response, error) { + return r.ApiService.AdminWorkersListExecute(r) } /* -AdminWorkersRetrieve Method for AdminWorkersRetrieve +AdminWorkersList Method for AdminWorkersList Get currently connected worker count. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @return ApiAdminWorkersRetrieveRequest + @return ApiAdminWorkersListRequest */ -func (a *AdminApiService) AdminWorkersRetrieve(ctx context.Context) ApiAdminWorkersRetrieveRequest { - return ApiAdminWorkersRetrieveRequest{ +func (a *AdminApiService) AdminWorkersList(ctx context.Context) ApiAdminWorkersListRequest { + return ApiAdminWorkersListRequest{ ApiService: a, ctx: ctx, } @@ -1416,16 +1416,16 @@ func (a *AdminApiService) AdminWorkersRetrieve(ctx context.Context) ApiAdminWork // Execute executes the request // -// @return Workers -func (a *AdminApiService) AdminWorkersRetrieveExecute(r ApiAdminWorkersRetrieveRequest) (*Workers, *http.Response, error) { +// @return []Worker +func (a *AdminApiService) AdminWorkersListExecute(r ApiAdminWorkersListRequest) ([]Worker, *http.Response, error) { var ( localVarHTTPMethod = http.MethodGet localVarPostBody interface{} formFiles []formFile - localVarReturnValue *Workers + localVarReturnValue []Worker ) - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "AdminApiService.AdminWorkersRetrieve") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "AdminApiService.AdminWorkersList") if err != nil { return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} } diff --git a/docs/AdminApi.md b/docs/AdminApi.md index 0b46d9745..5e0aca38a 100644 --- a/docs/AdminApi.md +++ b/docs/AdminApi.md @@ -15,7 +15,7 @@ Method | HTTP request | Description [**AdminVersionHistoryList**](AdminApi.md#AdminVersionHistoryList) | **Get** /admin/version/history/ | [**AdminVersionHistoryRetrieve**](AdminApi.md#AdminVersionHistoryRetrieve) | **Get** /admin/version/history/{id}/ | [**AdminVersionRetrieve**](AdminApi.md#AdminVersionRetrieve) | **Get** /admin/version/ | -[**AdminWorkersRetrieve**](AdminApi.md#AdminWorkersRetrieve) | **Get** /admin/workers/ | +[**AdminWorkersList**](AdminApi.md#AdminWorkersList) | **Get** /admin/workers/ | @@ -720,9 +720,9 @@ Other parameters are passed through a pointer to a apiAdminVersionRetrieveReques [[Back to README]](../README.md) -## AdminWorkersRetrieve +## AdminWorkersList -> Workers AdminWorkersRetrieve(ctx).Execute() +> []Worker AdminWorkersList(ctx).Execute() @@ -744,13 +744,13 @@ func main() { configuration := openapiclient.NewConfiguration() apiClient := openapiclient.NewAPIClient(configuration) - resp, r, err := apiClient.AdminApi.AdminWorkersRetrieve(context.Background()).Execute() + resp, r, err := apiClient.AdminApi.AdminWorkersList(context.Background()).Execute() if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `AdminApi.AdminWorkersRetrieve``: %v\n", err) + fmt.Fprintf(os.Stderr, "Error when calling `AdminApi.AdminWorkersList``: %v\n", err) fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) } - // response from `AdminWorkersRetrieve`: Workers - fmt.Fprintf(os.Stdout, "Response from `AdminApi.AdminWorkersRetrieve`: %v\n", resp) + // response from `AdminWorkersList`: []Worker + fmt.Fprintf(os.Stdout, "Response from `AdminApi.AdminWorkersList`: %v\n", resp) } ``` @@ -760,12 +760,12 @@ This endpoint does not need any parameter. ### Other Parameters -Other parameters are passed through a pointer to a apiAdminWorkersRetrieveRequest struct via the builder pattern +Other parameters are passed through a pointer to a apiAdminWorkersListRequest struct via the builder pattern ### Return type -[**Workers**](Workers.md) +[**[]Worker**](Worker.md) ### Authorization diff --git a/docs/Worker.md b/docs/Worker.md new file mode 100644 index 000000000..3f82bbdf1 --- /dev/null +++ b/docs/Worker.md @@ -0,0 +1,93 @@ +# Worker + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**WorkerId** | **string** | | +**Version** | **string** | | +**VersionMatching** | **bool** | | + +## Methods + +### NewWorker + +`func NewWorker(workerId string, version string, versionMatching bool, ) *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 + +### NewWorkerWithDefaults + +`func NewWorkerWithDefaults() *Worker` + +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 + +### GetWorkerId + +`func (o *Worker) GetWorkerId() string` + +GetWorkerId returns the WorkerId field if non-nil, zero value otherwise. + +### GetWorkerIdOk + +`func (o *Worker) GetWorkerIdOk() (*string, bool)` + +GetWorkerIdOk returns a tuple with the WorkerId field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetWorkerId + +`func (o *Worker) SetWorkerId(v string)` + +SetWorkerId sets WorkerId field to given value. + + +### GetVersion + +`func (o *Worker) GetVersion() string` + +GetVersion returns the Version field if non-nil, zero value otherwise. + +### GetVersionOk + +`func (o *Worker) GetVersionOk() (*string, bool)` + +GetVersionOk returns a tuple with the Version field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetVersion + +`func (o *Worker) SetVersion(v string)` + +SetVersion sets Version field to given value. + + +### GetVersionMatching + +`func (o *Worker) GetVersionMatching() bool` + +GetVersionMatching returns the VersionMatching field if non-nil, zero value otherwise. + +### GetVersionMatchingOk + +`func (o *Worker) GetVersionMatchingOk() (*bool, bool)` + +GetVersionMatchingOk returns a tuple with the VersionMatching field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetVersionMatching + +`func (o *Worker) SetVersionMatching(v bool)` + +SetVersionMatching sets VersionMatching field to given value. + + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/Workers.md b/docs/Workers.md deleted file mode 100644 index b78df9557..000000000 --- a/docs/Workers.md +++ /dev/null @@ -1,51 +0,0 @@ -# Workers - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**Count** | **int32** | | - -## Methods - -### NewWorkers - -`func NewWorkers(count int32, ) *Workers` - -NewWorkers instantiates a new Workers object -This constructor will assign default values to properties that have it defined, -and makes sure properties required by API are set, but the set of arguments -will change when the set of required properties is changed - -### NewWorkersWithDefaults - -`func NewWorkersWithDefaults() *Workers` - -NewWorkersWithDefaults instantiates a new Workers object -This constructor will only assign default values to properties that have it defined, -but it doesn't guarantee that properties required by API are set - -### GetCount - -`func (o *Workers) GetCount() int32` - -GetCount returns the Count field if non-nil, zero value otherwise. - -### GetCountOk - -`func (o *Workers) GetCountOk() (*int32, bool)` - -GetCountOk returns a tuple with the Count field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetCount - -`func (o *Workers) SetCount(v int32)` - -SetCount sets Count field to given value. - - - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/model_worker.go b/model_worker.go new file mode 100644 index 000000000..098e4c14f --- /dev/null +++ b/model_worker.go @@ -0,0 +1,165 @@ +/* +authentik + +Making authentication simple. + +API version: 2024.12.1 +Contact: hello@goauthentik.io +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package api + +import ( + "encoding/json" +) + +// Worker struct for Worker +type Worker struct { + WorkerId string `json:"worker_id"` + Version string `json:"version"` + VersionMatching bool `json:"version_matching"` +} + +// 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 := map[string]interface{}{} + if true { + toSerialize["worker_id"] = o.WorkerId + } + if true { + toSerialize["version"] = o.Version + } + if true { + toSerialize["version_matching"] = o.VersionMatching + } + return json.Marshal(toSerialize) +} + +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/model_workers.go b/model_workers.go deleted file mode 100644 index ee511ea7f..000000000 --- a/model_workers.go +++ /dev/null @@ -1,107 +0,0 @@ -/* -authentik - -Making authentication simple. - -API version: 2024.12.1 -Contact: hello@goauthentik.io -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package api - -import ( - "encoding/json" -) - -// Workers struct for Workers -type Workers struct { - Count int32 `json:"count"` -} - -// NewWorkers instantiates a new Workers object -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed -func NewWorkers(count int32) *Workers { - this := Workers{} - this.Count = count - return &this -} - -// NewWorkersWithDefaults instantiates a new Workers object -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set -func NewWorkersWithDefaults() *Workers { - this := Workers{} - return &this -} - -// GetCount returns the Count field value -func (o *Workers) 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 *Workers) GetCountOk() (*int32, bool) { - if o == nil { - return nil, false - } - return &o.Count, true -} - -// SetCount sets field value -func (o *Workers) SetCount(v int32) { - o.Count = v -} - -func (o Workers) MarshalJSON() ([]byte, error) { - toSerialize := map[string]interface{}{} - if true { - toSerialize["count"] = o.Count - } - return json.Marshal(toSerialize) -} - -type NullableWorkers struct { - value *Workers - isSet bool -} - -func (v NullableWorkers) Get() *Workers { - return v.value -} - -func (v *NullableWorkers) Set(val *Workers) { - v.value = val - v.isSet = true -} - -func (v NullableWorkers) IsSet() bool { - return v.isSet -} - -func (v *NullableWorkers) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableWorkers(val *Workers) *NullableWorkers { - return &NullableWorkers{value: val, isSet: true} -} - -func (v NullableWorkers) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableWorkers) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/schema.yml b/schema.yml index b33a64345..bcbe961d1 100644 --- a/schema.yml +++ b/schema.yml @@ -349,7 +349,7 @@ paths: description: '' /admin/workers/: get: - operationId: admin_workers_retrieve + operationId: admin_workers_list description: Get currently connected worker count. tags: - admin @@ -360,7 +360,9 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/Workers' + type: array + items: + $ref: '#/components/schemas/Worker' description: '' '400': content: @@ -56987,13 +56989,19 @@ components: required: - aaguid - description - Workers: + Worker: type: object properties: - count: - type: integer + worker_id: + type: string + version: + type: string + version_matching: + type: boolean required: - - count + - version + - version_matching + - worker_id modelRequest: oneOf: - $ref: '#/components/schemas/GoogleWorkspaceProviderRequest'