feat: adding background jobs ui page and apis - requires user is_admin to be set to true

This commit is contained in:
allanice001
2025-11-04 23:52:37 +00:00
parent 91686c1ea4
commit c41af60b26
97 changed files with 11135 additions and 138 deletions

View File

@@ -4,6 +4,7 @@
README.md
api/openapi.yaml
api_annotations.go
api_archer_admin.go
api_auth.go
api_health.go
api_labels.go
@@ -16,23 +17,30 @@ api_taints.go
client.go
configuration.go
docs/AnnotationsAPI.md
docs/ArcherAdminAPI.md
docs/AuthAPI.md
docs/DtoAnnotationResponse.md
docs/DtoAuthStartResponse.md
docs/DtoCreateAnnotationRequest.md
docs/DtoCreateLabelRequest.md
docs/DtoCreateSSHRequest.md
docs/DtoCreateServerRequest.md
docs/DtoCreateTaintRequest.md
docs/DtoJWK.md
docs/DtoJWKS.md
docs/DtoJob.md
docs/DtoJobStatus.md
docs/DtoLabelResponse.md
docs/DtoLogoutRequest.md
docs/DtoPageJob.md
docs/DtoQueueInfo.md
docs/DtoRefreshRequest.md
docs/DtoServerResponse.md
docs/DtoSshResponse.md
docs/DtoSshRevealResponse.md
docs/DtoTaintResponse.md
docs/DtoTokenPair.md
docs/DtoUpdateAnnotationRequest.md
docs/DtoUpdateLabelRequest.md
docs/DtoUpdateServerRequest.md
docs/DtoUpdateTaintRequest.md
@@ -65,20 +73,26 @@ go.mod
go.sum
model_dto_annotation_response.go
model_dto_auth_start_response.go
model_dto_create_annotation_request.go
model_dto_create_label_request.go
model_dto_create_server_request.go
model_dto_create_ssh_request.go
model_dto_create_taint_request.go
model_dto_job.go
model_dto_job_status.go
model_dto_jwk.go
model_dto_jwks.go
model_dto_label_response.go
model_dto_logout_request.go
model_dto_page_job.go
model_dto_queue_info.go
model_dto_refresh_request.go
model_dto_server_response.go
model_dto_ssh_response.go
model_dto_ssh_reveal_response.go
model_dto_taint_response.go
model_dto_token_pair.go
model_dto_update_annotation_request.go
model_dto_update_label_request.go
model_dto_update_server_request.go
model_dto_update_taint_request.go
@@ -100,6 +114,7 @@ model_models_user_email.go
model_utils_error_response.go
response.go
test/api_annotations_test.go
test/api_archer_admin_test.go
test/api_auth_test.go
test/api_health_test.go
test/api_labels_test.go

View File

@@ -78,8 +78,16 @@ All URIs are relative to *http://localhost:8080/api/v1*
Class | Method | HTTP request | Description
------------ | ------------- | ------------- | -------------
*AnnotationsAPI* | [**CreateAnnotation**](docs/AnnotationsAPI.md#createannotation) | **Post** /annotations | Create annotation (org scoped)
*AnnotationsAPI* | [**DeleteAnnotation**](docs/AnnotationsAPI.md#deleteannotation) | **Delete** /annotations/{id} | Delete annotation (org scoped)
*AnnotationsAPI* | [**GetAnnotation**](docs/AnnotationsAPI.md#getannotation) | **Get** /annotations/{id} | Get annotation by ID (org scoped)
*AnnotationsAPI* | [**ListAnnotations**](docs/AnnotationsAPI.md#listannotations) | **Get** /annotations | List annotations (org scoped)
*AnnotationsAPI* | [**UpdateAnnotation**](docs/AnnotationsAPI.md#updateannotation) | **Patch** /annotations/{id} | Update annotation (org scoped)
*ArcherAdminAPI* | [**AdminCancelArcherJob**](docs/ArcherAdminAPI.md#admincancelarcherjob) | **Post** /admin/archer/jobs/{id}/cancel | Cancel an Archer job (admin)
*ArcherAdminAPI* | [**AdminEnqueueArcherJob**](docs/ArcherAdminAPI.md#adminenqueuearcherjob) | **Post** /admin/archer/jobs | Enqueue a new Archer job (admin)
*ArcherAdminAPI* | [**AdminListArcherJobs**](docs/ArcherAdminAPI.md#adminlistarcherjobs) | **Get** /admin/archer/jobs | List Archer jobs (admin)
*ArcherAdminAPI* | [**AdminListArcherQueues**](docs/ArcherAdminAPI.md#adminlistarcherqueues) | **Get** /admin/archer/queues | List Archer queues (admin)
*ArcherAdminAPI* | [**AdminRetryArcherJob**](docs/ArcherAdminAPI.md#adminretryarcherjob) | **Post** /admin/archer/jobs/{id}/retry | Retry a failed/canceled Archer job (admin)
*AuthAPI* | [**AuthCallback**](docs/AuthAPI.md#authcallback) | **Get** /auth/{provider}/callback | Handle social login callback
*AuthAPI* | [**AuthStart**](docs/AuthAPI.md#authstart) | **Post** /auth/{provider}/start | Begin social login
*AuthAPI* | [**GetJWKS**](docs/AuthAPI.md#getjwks) | **Get** /.well-known/jwks.json | Get JWKS
@@ -128,20 +136,26 @@ Class | Method | HTTP request | Description
- [DtoAnnotationResponse](docs/DtoAnnotationResponse.md)
- [DtoAuthStartResponse](docs/DtoAuthStartResponse.md)
- [DtoCreateAnnotationRequest](docs/DtoCreateAnnotationRequest.md)
- [DtoCreateLabelRequest](docs/DtoCreateLabelRequest.md)
- [DtoCreateSSHRequest](docs/DtoCreateSSHRequest.md)
- [DtoCreateServerRequest](docs/DtoCreateServerRequest.md)
- [DtoCreateTaintRequest](docs/DtoCreateTaintRequest.md)
- [DtoJWK](docs/DtoJWK.md)
- [DtoJWKS](docs/DtoJWKS.md)
- [DtoJob](docs/DtoJob.md)
- [DtoJobStatus](docs/DtoJobStatus.md)
- [DtoLabelResponse](docs/DtoLabelResponse.md)
- [DtoLogoutRequest](docs/DtoLogoutRequest.md)
- [DtoPageJob](docs/DtoPageJob.md)
- [DtoQueueInfo](docs/DtoQueueInfo.md)
- [DtoRefreshRequest](docs/DtoRefreshRequest.md)
- [DtoServerResponse](docs/DtoServerResponse.md)
- [DtoSshResponse](docs/DtoSshResponse.md)
- [DtoSshRevealResponse](docs/DtoSshRevealResponse.md)
- [DtoTaintResponse](docs/DtoTaintResponse.md)
- [DtoTokenPair](docs/DtoTokenPair.md)
- [DtoUpdateAnnotationRequest](docs/DtoUpdateAnnotationRequest.md)
- [DtoUpdateLabelRequest](docs/DtoUpdateLabelRequest.md)
- [DtoUpdateServerRequest](docs/DtoUpdateServerRequest.md)
- [DtoUpdateTaintRequest](docs/DtoUpdateTaintRequest.md)

View File

@@ -23,6 +23,258 @@ paths:
summary: Get JWKS
tags:
- Auth
/admin/archer/jobs:
get:
description: "Paginated background jobs with optional filters. Search `q` may\
\ match id, type, error, payload (implementation-dependent)."
operationId: AdminListArcherJobs
parameters:
- description: Filter by status
in: query
name: status
schema:
enum:
- queued
- running
- succeeded
- failed
- canceled
- retrying
- scheduled
type: string
- description: Filter by queue name / worker name
in: query
name: queue
schema:
type: string
- description: Free-text search
in: query
name: q
schema:
type: string
- description: Page number
in: query
name: page
schema:
default: 1
type: integer
- description: Items per page
in: query
name: page_size
schema:
default: 25
maximum: 100
minimum: 1
type: integer
responses:
"200":
content:
application/json:
schema:
$ref: "#/components/schemas/dto.PageJob"
description: OK
"401":
content:
application/json:
schema:
type: string
description: Unauthorized
"403":
content:
application/json:
schema:
type: string
description: forbidden
"500":
content:
application/json:
schema:
type: string
description: internal error
security:
- BearerAuth: []
summary: List Archer jobs (admin)
tags:
- ArcherAdmin
post:
description: Create a job immediately or schedule it for the future via `run_at`.
operationId: AdminEnqueueArcherJob
requestBody:
content:
application/json:
schema:
$ref: "#/components/schemas/dto.EnqueueRequest"
description: Job parameters
required: true
responses:
"200":
content:
application/json:
schema:
$ref: "#/components/schemas/dto.Job"
description: OK
"400":
content:
application/json:
schema:
type: string
description: invalid json or missing fields
"401":
content:
application/json:
schema:
type: string
description: Unauthorized
"403":
content:
application/json:
schema:
type: string
description: forbidden
"500":
content:
application/json:
schema:
type: string
description: internal error
security:
- BearerAuth: []
summary: Enqueue a new Archer job (admin)
tags:
- ArcherAdmin
x-codegen-request-body-name: body
/admin/archer/jobs/{id}/cancel:
post:
description: "Set job status to canceled if cancellable. For running jobs, this\
\ only affects future picks; wire to Archer if you need active kill."
operationId: AdminCancelArcherJob
parameters:
- description: Job ID
in: path
name: id
required: true
schema:
type: string
responses:
"200":
content:
application/json:
schema:
$ref: "#/components/schemas/dto.Job"
description: OK
"400":
content:
application/json:
schema:
type: string
description: invalid job or not cancellable
"401":
content:
application/json:
schema:
type: string
description: Unauthorized
"403":
content:
application/json:
schema:
type: string
description: forbidden
"404":
content:
application/json:
schema:
type: string
description: not found
security:
- BearerAuth: []
summary: Cancel an Archer job (admin)
tags:
- ArcherAdmin
/admin/archer/jobs/{id}/retry:
post:
description: Marks the job retriable (DB flip). Swap this for an Archer admin
call if you expose one.
operationId: AdminRetryArcherJob
parameters:
- description: Job ID
in: path
name: id
required: true
schema:
type: string
responses:
"200":
content:
application/json:
schema:
$ref: "#/components/schemas/dto.Job"
description: OK
"400":
content:
application/json:
schema:
type: string
description: invalid job or not eligible
"401":
content:
application/json:
schema:
type: string
description: Unauthorized
"403":
content:
application/json:
schema:
type: string
description: forbidden
"404":
content:
application/json:
schema:
type: string
description: not found
security:
- BearerAuth: []
summary: Retry a failed/canceled Archer job (admin)
tags:
- ArcherAdmin
/admin/archer/queues:
get:
description: "Summary metrics per queue (pending, running, failed, scheduled)."
operationId: AdminListArcherQueues
responses:
"200":
content:
application/json:
schema:
items:
$ref: "#/components/schemas/dto.QueueInfo"
type: array
description: OK
"401":
content:
application/json:
schema:
type: string
description: Unauthorized
"403":
content:
application/json:
schema:
type: string
description: forbidden
"500":
content:
application/json:
schema:
type: string
description: internal error
security:
- BearerAuth: []
summary: List Archer queues (admin)
tags:
- ArcherAdmin
/annotations:
get:
description: "Returns annotations for the organization in X-Org-ID. Filters:\
@@ -84,7 +336,115 @@ paths:
summary: List annotations (org scoped)
tags:
- Annotations
post:
description: Creates an annotation.
operationId: CreateAnnotation
parameters:
- description: Organization UUID
in: header
name: X-Org-ID
schema:
type: string
requestBody:
content:
application/json:
schema:
$ref: "#/components/schemas/dto.CreateAnnotationRequest"
description: Annotation payload
required: true
responses:
"201":
content:
application/json:
schema:
$ref: "#/components/schemas/dto.AnnotationResponse"
description: Created
"400":
content:
application/json:
schema:
type: string
description: invalid json / missing fields
"401":
content:
application/json:
schema:
type: string
description: Unauthorized
"403":
content:
application/json:
schema:
type: string
description: organization required
"500":
content:
application/json:
schema:
type: string
description: create failed
security:
- BearerAuth: []
- OrgKeyAuth: []
- OrgSecretAuth: []
summary: Create annotation (org scoped)
tags:
- Annotations
x-codegen-request-body-name: body
/annotations/{id}:
delete:
description: Permanently deletes the annotation.
operationId: DeleteAnnotation
parameters:
- description: Organization UUID
in: header
name: X-Org-ID
schema:
type: string
- description: Annotation ID (UUID)
in: path
name: id
required: true
schema:
type: string
responses:
"204":
content:
application/json:
schema:
type: string
description: No Content
"400":
content:
application/json:
schema:
type: string
description: invalid id
"401":
content:
application/json:
schema:
type: string
description: Unauthorized
"403":
content:
application/json:
schema:
type: string
description: organization required
"500":
content:
application/json:
schema:
type: string
description: delete failed
security:
- BearerAuth: []
- OrgKeyAuth: []
- OrgSecretAuth: []
summary: Delete annotation (org scoped)
tags:
- Annotations
get:
description: Returns one annotation. Add `include=node_pools` to include node
pools.
@@ -101,11 +461,6 @@ paths:
required: true
schema:
type: string
- description: "Optional: node_pools"
in: query
name: include
schema:
type: string
responses:
"200":
content:
@@ -150,6 +505,73 @@ paths:
summary: Get annotation by ID (org scoped)
tags:
- Annotations
patch:
description: Partially update annotation fields.
operationId: UpdateAnnotation
parameters:
- description: Organization UUID
in: header
name: X-Org-ID
schema:
type: string
- description: Annotation ID (UUID)
in: path
name: id
required: true
schema:
type: string
requestBody:
content:
application/json:
schema:
$ref: "#/components/schemas/dto.UpdateAnnotationRequest"
description: Fields to update
required: true
responses:
"200":
content:
application/json:
schema:
$ref: "#/components/schemas/dto.AnnotationResponse"
description: OK
"400":
content:
application/json:
schema:
type: string
description: invalid id / invalid json
"401":
content:
application/json:
schema:
type: string
description: Unauthorized
"403":
content:
application/json:
schema:
type: string
description: organization required
"404":
content:
application/json:
schema:
type: string
description: not found
"500":
content:
application/json:
schema:
type: string
description: update failed
security:
- BearerAuth: []
- OrgKeyAuth: []
- OrgSecretAuth: []
summary: Update annotation (org scoped)
tags:
- Annotations
x-codegen-request-body-name: body
/auth/logout:
post:
operationId: Logout
@@ -1911,6 +2333,13 @@ components:
example: https://accounts.google.com/o/oauth2/v2/auth?client_id=...
type: string
type: object
dto.CreateAnnotationRequest:
properties:
key:
type: string
value:
type: string
type: object
dto.CreateLabelRequest:
properties:
key:
@@ -1960,6 +2389,8 @@ components:
value:
type: string
type: object
dto.EnqueueRequest:
type: object
dto.JWK:
example:
kty: RSA
@@ -2013,6 +2444,76 @@ components:
$ref: "#/components/schemas/dto.JWK"
type: array
type: object
dto.Job:
example:
updated_at: updated_at
payload: "{}"
max_attempts: 6
created_at: created_at
id: id
last_error: last_error
run_at: run_at
type: type
queue: queue
attempts: 0
status: "{}"
properties:
attempts:
description: "example: 0"
type: integer
created_at:
description: "example: 2025-11-04T09:30:00Z"
type: string
id:
description: "example: 01HF7SZK8Z8WG1M3J7S2Z8M2N6"
type: string
last_error:
description: "example: dial tcp: i/o timeout"
type: string
max_attempts:
description: "example: 3"
type: integer
payload:
description: arbitrary JSON payload
type: object
queue:
description: "example: default"
type: string
run_at:
description: "example: 2025-11-05T08:00:00Z"
type: string
status:
allOf:
- $ref: "#/components/schemas/dto.JobStatus"
description: |-
enum: queued,running,succeeded,failed,canceled,retrying,scheduled
example: queued
type: object
type:
description: "example: email.send"
type: string
updated_at:
description: "example: 2025-11-04T09:31:00Z"
type: string
type: object
dto.JobStatus:
enum:
- queued
- running
- succeeded
- failed
- canceled
- retrying
- scheduled
type: string
x-enum-varnames:
- StatusQueued
- StatusRunning
- StatusSucceeded
- StatusFailed
- StatusCanceled
- StatusRetrying
- StatusScheduled
dto.LabelResponse:
example:
updated_at: updated_at
@@ -2041,6 +2542,73 @@ components:
example: m0l9o8rT3t0V8d3eFf...
type: string
type: object
dto.PageJob:
example:
total: 5
page: 1
items:
- updated_at: updated_at
payload: "{}"
max_attempts: 6
created_at: created_at
id: id
last_error: last_error
run_at: run_at
type: type
queue: queue
attempts: 0
status: "{}"
- updated_at: updated_at
payload: "{}"
max_attempts: 6
created_at: created_at
id: id
last_error: last_error
run_at: run_at
type: type
queue: queue
attempts: 0
status: "{}"
page_size: 5
properties:
items:
items:
$ref: "#/components/schemas/dto.Job"
type: array
page:
description: "example: 1"
type: integer
page_size:
description: "example: 25"
type: integer
total:
description: "example: 120"
type: integer
type: object
dto.QueueInfo:
example:
running: 1
scheduled: 5
pending: 6
name: name
failed: 0
properties:
failed:
description: "example: 5"
type: integer
name:
description: "example: default"
type: string
pending:
description: "example: 42"
type: integer
running:
description: "example: 3"
type: integer
scheduled:
description: "example: 7"
type: integer
type: object
dto.RefreshRequest:
properties:
refresh_token:
@@ -2182,6 +2750,13 @@ components:
example: Bearer
type: string
type: object
dto.UpdateAnnotationRequest:
properties:
key:
type: string
value:
type: string
type: object
dto.UpdateLabelRequest:
properties:
key:
@@ -2243,6 +2818,7 @@ components:
id: 046b6c7f-0b8a-43b9-b35d-6489e6daee91
is_verified: true
user:
is_admin: true
avatar_url: avatar_url
updated_at: 2000-01-23T04:56:07.000+00:00
is_disabled: true
@@ -2258,6 +2834,7 @@ components:
id: 046b6c7f-0b8a-43b9-b35d-6489e6daee91
is_verified: true
user:
is_admin: true
avatar_url: avatar_url
updated_at: 2000-01-23T04:56:07.000+00:00
is_disabled: true
@@ -2266,6 +2843,7 @@ components:
id: 046b6c7f-0b8a-43b9-b35d-6489e6daee91
display_name: display_name
email: email
is_admin: true
avatar_url: avatar_url
updated_at: 2000-01-23T04:56:07.000+00:00
is_disabled: true
@@ -2300,6 +2878,8 @@ components:
description: "example: 3fa85f64-5717-4562-b3fc-2c963f66afa6"
format: uuid
type: string
is_admin:
type: boolean
is_disabled:
type: boolean
organizations:
@@ -2491,6 +3071,7 @@ components:
type: object
models.User:
example:
is_admin: true
avatar_url: avatar_url
updated_at: 2000-01-23T04:56:07.000+00:00
is_disabled: true
@@ -2510,6 +3091,8 @@ components:
description: "example: 3fa85f64-5717-4562-b3fc-2c963f66afa6"
format: uuid
type: string
is_admin:
type: boolean
is_disabled:
type: boolean
primary_email:
@@ -2527,6 +3110,7 @@ components:
id: 046b6c7f-0b8a-43b9-b35d-6489e6daee91
is_verified: true
user:
is_admin: true
avatar_url: avatar_url
updated_at: 2000-01-23T04:56:07.000+00:00
is_disabled: true

View File

@@ -22,12 +22,417 @@ import (
// AnnotationsAPIService AnnotationsAPI service
type AnnotationsAPIService service
type ApiCreateAnnotationRequest struct {
ctx context.Context
ApiService *AnnotationsAPIService
body *DtoCreateAnnotationRequest
xOrgID *string
}
// Annotation payload
func (r ApiCreateAnnotationRequest) Body(body DtoCreateAnnotationRequest) ApiCreateAnnotationRequest {
r.body = &body
return r
}
// Organization UUID
func (r ApiCreateAnnotationRequest) XOrgID(xOrgID string) ApiCreateAnnotationRequest {
r.xOrgID = &xOrgID
return r
}
func (r ApiCreateAnnotationRequest) Execute() (*DtoAnnotationResponse, *http.Response, error) {
return r.ApiService.CreateAnnotationExecute(r)
}
/*
CreateAnnotation Create annotation (org scoped)
Creates an annotation.
@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
@return ApiCreateAnnotationRequest
*/
func (a *AnnotationsAPIService) CreateAnnotation(ctx context.Context) ApiCreateAnnotationRequest {
return ApiCreateAnnotationRequest{
ApiService: a,
ctx: ctx,
}
}
// Execute executes the request
//
// @return DtoAnnotationResponse
func (a *AnnotationsAPIService) CreateAnnotationExecute(r ApiCreateAnnotationRequest) (*DtoAnnotationResponse, *http.Response, error) {
var (
localVarHTTPMethod = http.MethodPost
localVarPostBody interface{}
formFiles []formFile
localVarReturnValue *DtoAnnotationResponse
)
localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "AnnotationsAPIService.CreateAnnotation")
if err != nil {
return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()}
}
localVarPath := localBasePath + "/annotations"
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}
if r.body == nil {
return localVarReturnValue, nil, reportError("body is required and must be specified")
}
// to determine the Content-Type header
localVarHTTPContentTypes := []string{"application/json"}
// set Content-Type header
localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes)
if localVarHTTPContentType != "" {
localVarHeaderParams["Content-Type"] = localVarHTTPContentType
}
// to determine the Accept header
localVarHTTPHeaderAccepts := []string{"application/json"}
// set Accept header
localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts)
if localVarHTTPHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept
}
if r.xOrgID != nil {
parameterAddToHeaderOrQuery(localVarHeaderParams, "X-Org-ID", r.xOrgID, "", "")
}
// body params
localVarPostBody = r.body
if r.ctx != nil {
// API Key Authentication
if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok {
if apiKey, ok := auth["OrgKeyAuth"]; ok {
var key string
if apiKey.Prefix != "" {
key = apiKey.Prefix + " " + apiKey.Key
} else {
key = apiKey.Key
}
localVarHeaderParams["X-ORG-KEY"] = key
}
}
}
if r.ctx != nil {
// API Key Authentication
if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok {
if apiKey, ok := auth["OrgSecretAuth"]; ok {
var key string
if apiKey.Prefix != "" {
key = apiKey.Prefix + " " + apiKey.Key
} else {
key = apiKey.Key
}
localVarHeaderParams["X-ORG-SECRET"] = key
}
}
}
if r.ctx != nil {
// API Key Authentication
if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok {
if apiKey, ok := auth["BearerAuth"]; ok {
var key string
if apiKey.Prefix != "" {
key = apiKey.Prefix + " " + apiKey.Key
} else {
key = apiKey.Key
}
localVarHeaderParams["Authorization"] = key
}
}
}
req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles)
if err != nil {
return localVarReturnValue, nil, err
}
localVarHTTPResponse, err := a.client.callAPI(req)
if err != nil || localVarHTTPResponse == nil {
return localVarReturnValue, localVarHTTPResponse, err
}
localVarBody, err := io.ReadAll(localVarHTTPResponse.Body)
localVarHTTPResponse.Body.Close()
localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody))
if err != nil {
return localVarReturnValue, localVarHTTPResponse, err
}
if localVarHTTPResponse.StatusCode >= 300 {
newErr := &GenericOpenAPIError{
body: localVarBody,
error: localVarHTTPResponse.Status,
}
if localVarHTTPResponse.StatusCode == 400 {
var v string
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
}
newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v)
newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
}
if localVarHTTPResponse.StatusCode == 401 {
var v string
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
}
newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v)
newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
}
if localVarHTTPResponse.StatusCode == 403 {
var v string
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
}
newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v)
newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
}
if localVarHTTPResponse.StatusCode == 500 {
var v string
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
}
newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v)
newErr.model = v
}
return localVarReturnValue, localVarHTTPResponse, newErr
}
err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr := &GenericOpenAPIError{
body: localVarBody,
error: err.Error(),
}
return localVarReturnValue, localVarHTTPResponse, newErr
}
return localVarReturnValue, localVarHTTPResponse, nil
}
type ApiDeleteAnnotationRequest struct {
ctx context.Context
ApiService *AnnotationsAPIService
id string
xOrgID *string
}
// Organization UUID
func (r ApiDeleteAnnotationRequest) XOrgID(xOrgID string) ApiDeleteAnnotationRequest {
r.xOrgID = &xOrgID
return r
}
func (r ApiDeleteAnnotationRequest) Execute() (string, *http.Response, error) {
return r.ApiService.DeleteAnnotationExecute(r)
}
/*
DeleteAnnotation Delete annotation (org scoped)
Permanently deletes the annotation.
@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
@param id Annotation ID (UUID)
@return ApiDeleteAnnotationRequest
*/
func (a *AnnotationsAPIService) DeleteAnnotation(ctx context.Context, id string) ApiDeleteAnnotationRequest {
return ApiDeleteAnnotationRequest{
ApiService: a,
ctx: ctx,
id: id,
}
}
// Execute executes the request
//
// @return string
func (a *AnnotationsAPIService) DeleteAnnotationExecute(r ApiDeleteAnnotationRequest) (string, *http.Response, error) {
var (
localVarHTTPMethod = http.MethodDelete
localVarPostBody interface{}
formFiles []formFile
localVarReturnValue string
)
localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "AnnotationsAPIService.DeleteAnnotation")
if err != nil {
return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()}
}
localVarPath := localBasePath + "/annotations/{id}"
localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1)
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}
// to determine the Content-Type header
localVarHTTPContentTypes := []string{}
// set Content-Type header
localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes)
if localVarHTTPContentType != "" {
localVarHeaderParams["Content-Type"] = localVarHTTPContentType
}
// to determine the Accept header
localVarHTTPHeaderAccepts := []string{"application/json"}
// set Accept header
localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts)
if localVarHTTPHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept
}
if r.xOrgID != nil {
parameterAddToHeaderOrQuery(localVarHeaderParams, "X-Org-ID", r.xOrgID, "", "")
}
if r.ctx != nil {
// API Key Authentication
if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok {
if apiKey, ok := auth["OrgKeyAuth"]; ok {
var key string
if apiKey.Prefix != "" {
key = apiKey.Prefix + " " + apiKey.Key
} else {
key = apiKey.Key
}
localVarHeaderParams["X-ORG-KEY"] = key
}
}
}
if r.ctx != nil {
// API Key Authentication
if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok {
if apiKey, ok := auth["OrgSecretAuth"]; ok {
var key string
if apiKey.Prefix != "" {
key = apiKey.Prefix + " " + apiKey.Key
} else {
key = apiKey.Key
}
localVarHeaderParams["X-ORG-SECRET"] = key
}
}
}
if r.ctx != nil {
// API Key Authentication
if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok {
if apiKey, ok := auth["BearerAuth"]; ok {
var key string
if apiKey.Prefix != "" {
key = apiKey.Prefix + " " + apiKey.Key
} else {
key = apiKey.Key
}
localVarHeaderParams["Authorization"] = key
}
}
}
req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles)
if err != nil {
return localVarReturnValue, nil, err
}
localVarHTTPResponse, err := a.client.callAPI(req)
if err != nil || localVarHTTPResponse == nil {
return localVarReturnValue, localVarHTTPResponse, err
}
localVarBody, err := io.ReadAll(localVarHTTPResponse.Body)
localVarHTTPResponse.Body.Close()
localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody))
if err != nil {
return localVarReturnValue, localVarHTTPResponse, err
}
if localVarHTTPResponse.StatusCode >= 300 {
newErr := &GenericOpenAPIError{
body: localVarBody,
error: localVarHTTPResponse.Status,
}
if localVarHTTPResponse.StatusCode == 400 {
var v string
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
}
newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v)
newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
}
if localVarHTTPResponse.StatusCode == 401 {
var v string
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
}
newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v)
newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
}
if localVarHTTPResponse.StatusCode == 403 {
var v string
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
}
newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v)
newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
}
if localVarHTTPResponse.StatusCode == 500 {
var v string
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
}
newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v)
newErr.model = v
}
return localVarReturnValue, localVarHTTPResponse, newErr
}
err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr := &GenericOpenAPIError{
body: localVarBody,
error: err.Error(),
}
return localVarReturnValue, localVarHTTPResponse, newErr
}
return localVarReturnValue, localVarHTTPResponse, nil
}
type ApiGetAnnotationRequest struct {
ctx context.Context
ApiService *AnnotationsAPIService
id string
xOrgID *string
include *string
}
// Organization UUID
@@ -36,12 +441,6 @@ func (r ApiGetAnnotationRequest) XOrgID(xOrgID string) ApiGetAnnotationRequest {
return r
}
// Optional: node_pools
func (r ApiGetAnnotationRequest) Include(include string) ApiGetAnnotationRequest {
r.include = &include
return r
}
func (r ApiGetAnnotationRequest) Execute() (*DtoAnnotationResponse, *http.Response, error) {
return r.ApiService.GetAnnotationExecute(r)
}
@@ -86,9 +485,6 @@ func (a *AnnotationsAPIService) GetAnnotationExecute(r ApiGetAnnotationRequest)
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}
if r.include != nil {
parameterAddToHeaderOrQuery(localVarQueryParams, "include", r.include, "", "")
}
// to determine the Content-Type header
localVarHTTPContentTypes := []string{}
@@ -455,3 +851,225 @@ func (a *AnnotationsAPIService) ListAnnotationsExecute(r ApiListAnnotationsReque
return localVarReturnValue, localVarHTTPResponse, nil
}
type ApiUpdateAnnotationRequest struct {
ctx context.Context
ApiService *AnnotationsAPIService
id string
body *DtoUpdateAnnotationRequest
xOrgID *string
}
// Fields to update
func (r ApiUpdateAnnotationRequest) Body(body DtoUpdateAnnotationRequest) ApiUpdateAnnotationRequest {
r.body = &body
return r
}
// Organization UUID
func (r ApiUpdateAnnotationRequest) XOrgID(xOrgID string) ApiUpdateAnnotationRequest {
r.xOrgID = &xOrgID
return r
}
func (r ApiUpdateAnnotationRequest) Execute() (*DtoAnnotationResponse, *http.Response, error) {
return r.ApiService.UpdateAnnotationExecute(r)
}
/*
UpdateAnnotation Update annotation (org scoped)
Partially update annotation fields.
@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
@param id Annotation ID (UUID)
@return ApiUpdateAnnotationRequest
*/
func (a *AnnotationsAPIService) UpdateAnnotation(ctx context.Context, id string) ApiUpdateAnnotationRequest {
return ApiUpdateAnnotationRequest{
ApiService: a,
ctx: ctx,
id: id,
}
}
// Execute executes the request
//
// @return DtoAnnotationResponse
func (a *AnnotationsAPIService) UpdateAnnotationExecute(r ApiUpdateAnnotationRequest) (*DtoAnnotationResponse, *http.Response, error) {
var (
localVarHTTPMethod = http.MethodPatch
localVarPostBody interface{}
formFiles []formFile
localVarReturnValue *DtoAnnotationResponse
)
localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "AnnotationsAPIService.UpdateAnnotation")
if err != nil {
return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()}
}
localVarPath := localBasePath + "/annotations/{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.body == nil {
return localVarReturnValue, nil, reportError("body is required and must be specified")
}
// to determine the Content-Type header
localVarHTTPContentTypes := []string{"application/json"}
// set Content-Type header
localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes)
if localVarHTTPContentType != "" {
localVarHeaderParams["Content-Type"] = localVarHTTPContentType
}
// to determine the Accept header
localVarHTTPHeaderAccepts := []string{"application/json"}
// set Accept header
localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts)
if localVarHTTPHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept
}
if r.xOrgID != nil {
parameterAddToHeaderOrQuery(localVarHeaderParams, "X-Org-ID", r.xOrgID, "", "")
}
// body params
localVarPostBody = r.body
if r.ctx != nil {
// API Key Authentication
if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok {
if apiKey, ok := auth["OrgKeyAuth"]; ok {
var key string
if apiKey.Prefix != "" {
key = apiKey.Prefix + " " + apiKey.Key
} else {
key = apiKey.Key
}
localVarHeaderParams["X-ORG-KEY"] = key
}
}
}
if r.ctx != nil {
// API Key Authentication
if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok {
if apiKey, ok := auth["OrgSecretAuth"]; ok {
var key string
if apiKey.Prefix != "" {
key = apiKey.Prefix + " " + apiKey.Key
} else {
key = apiKey.Key
}
localVarHeaderParams["X-ORG-SECRET"] = key
}
}
}
if r.ctx != nil {
// API Key Authentication
if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok {
if apiKey, ok := auth["BearerAuth"]; ok {
var key string
if apiKey.Prefix != "" {
key = apiKey.Prefix + " " + apiKey.Key
} else {
key = apiKey.Key
}
localVarHeaderParams["Authorization"] = key
}
}
}
req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles)
if err != nil {
return localVarReturnValue, nil, err
}
localVarHTTPResponse, err := a.client.callAPI(req)
if err != nil || localVarHTTPResponse == nil {
return localVarReturnValue, localVarHTTPResponse, err
}
localVarBody, err := io.ReadAll(localVarHTTPResponse.Body)
localVarHTTPResponse.Body.Close()
localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody))
if err != nil {
return localVarReturnValue, localVarHTTPResponse, err
}
if localVarHTTPResponse.StatusCode >= 300 {
newErr := &GenericOpenAPIError{
body: localVarBody,
error: localVarHTTPResponse.Status,
}
if localVarHTTPResponse.StatusCode == 400 {
var v string
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
}
newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v)
newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
}
if localVarHTTPResponse.StatusCode == 401 {
var v string
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
}
newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v)
newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
}
if localVarHTTPResponse.StatusCode == 403 {
var v string
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
}
newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v)
newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
}
if localVarHTTPResponse.StatusCode == 404 {
var v string
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
}
newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v)
newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
}
if localVarHTTPResponse.StatusCode == 500 {
var v string
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
}
newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v)
newErr.model = v
}
return localVarReturnValue, localVarHTTPResponse, newErr
}
err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr := &GenericOpenAPIError{
body: localVarBody,
error: err.Error(),
}
return localVarReturnValue, localVarHTTPResponse, newErr
}
return localVarReturnValue, localVarHTTPResponse, nil
}

864
sdk/go/api_archer_admin.go Normal file
View File

@@ -0,0 +1,864 @@
/*
AutoGlue API
API for managing K3s clusters across cloud providers
API version: 1.0
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
package autoglue
import (
"bytes"
"context"
"io"
"net/http"
"net/url"
"strings"
)
// ArcherAdminAPIService ArcherAdminAPI service
type ArcherAdminAPIService service
type ApiAdminCancelArcherJobRequest struct {
ctx context.Context
ApiService *ArcherAdminAPIService
id string
}
func (r ApiAdminCancelArcherJobRequest) Execute() (*DtoJob, *http.Response, error) {
return r.ApiService.AdminCancelArcherJobExecute(r)
}
/*
AdminCancelArcherJob Cancel an Archer job (admin)
Set job status to canceled if cancellable. For running jobs, this only affects future picks; wire to Archer if you need active kill.
@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
@param id Job ID
@return ApiAdminCancelArcherJobRequest
*/
func (a *ArcherAdminAPIService) AdminCancelArcherJob(ctx context.Context, id string) ApiAdminCancelArcherJobRequest {
return ApiAdminCancelArcherJobRequest{
ApiService: a,
ctx: ctx,
id: id,
}
}
// Execute executes the request
//
// @return DtoJob
func (a *ArcherAdminAPIService) AdminCancelArcherJobExecute(r ApiAdminCancelArcherJobRequest) (*DtoJob, *http.Response, error) {
var (
localVarHTTPMethod = http.MethodPost
localVarPostBody interface{}
formFiles []formFile
localVarReturnValue *DtoJob
)
localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ArcherAdminAPIService.AdminCancelArcherJob")
if err != nil {
return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()}
}
localVarPath := localBasePath + "/admin/archer/jobs/{id}/cancel"
localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1)
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}
// to determine the Content-Type header
localVarHTTPContentTypes := []string{}
// set Content-Type header
localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes)
if localVarHTTPContentType != "" {
localVarHeaderParams["Content-Type"] = localVarHTTPContentType
}
// to determine the Accept header
localVarHTTPHeaderAccepts := []string{"application/json"}
// set Accept header
localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts)
if localVarHTTPHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept
}
if r.ctx != nil {
// API Key Authentication
if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok {
if apiKey, ok := auth["BearerAuth"]; ok {
var key string
if apiKey.Prefix != "" {
key = apiKey.Prefix + " " + apiKey.Key
} else {
key = apiKey.Key
}
localVarHeaderParams["Authorization"] = key
}
}
}
req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles)
if err != nil {
return localVarReturnValue, nil, err
}
localVarHTTPResponse, err := a.client.callAPI(req)
if err != nil || localVarHTTPResponse == nil {
return localVarReturnValue, localVarHTTPResponse, err
}
localVarBody, err := io.ReadAll(localVarHTTPResponse.Body)
localVarHTTPResponse.Body.Close()
localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody))
if err != nil {
return localVarReturnValue, localVarHTTPResponse, err
}
if localVarHTTPResponse.StatusCode >= 300 {
newErr := &GenericOpenAPIError{
body: localVarBody,
error: localVarHTTPResponse.Status,
}
if localVarHTTPResponse.StatusCode == 400 {
var v string
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
}
newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v)
newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
}
if localVarHTTPResponse.StatusCode == 401 {
var v string
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
}
newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v)
newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
}
if localVarHTTPResponse.StatusCode == 403 {
var v string
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
}
newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v)
newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
}
if localVarHTTPResponse.StatusCode == 404 {
var v string
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
}
newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v)
newErr.model = v
}
return localVarReturnValue, localVarHTTPResponse, newErr
}
err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr := &GenericOpenAPIError{
body: localVarBody,
error: err.Error(),
}
return localVarReturnValue, localVarHTTPResponse, newErr
}
return localVarReturnValue, localVarHTTPResponse, nil
}
type ApiAdminEnqueueArcherJobRequest struct {
ctx context.Context
ApiService *ArcherAdminAPIService
body *map[string]interface{}
}
// Job parameters
func (r ApiAdminEnqueueArcherJobRequest) Body(body map[string]interface{}) ApiAdminEnqueueArcherJobRequest {
r.body = &body
return r
}
func (r ApiAdminEnqueueArcherJobRequest) Execute() (*DtoJob, *http.Response, error) {
return r.ApiService.AdminEnqueueArcherJobExecute(r)
}
/*
AdminEnqueueArcherJob Enqueue a new Archer job (admin)
Create a job immediately or schedule it for the future via `run_at`.
@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
@return ApiAdminEnqueueArcherJobRequest
*/
func (a *ArcherAdminAPIService) AdminEnqueueArcherJob(ctx context.Context) ApiAdminEnqueueArcherJobRequest {
return ApiAdminEnqueueArcherJobRequest{
ApiService: a,
ctx: ctx,
}
}
// Execute executes the request
//
// @return DtoJob
func (a *ArcherAdminAPIService) AdminEnqueueArcherJobExecute(r ApiAdminEnqueueArcherJobRequest) (*DtoJob, *http.Response, error) {
var (
localVarHTTPMethod = http.MethodPost
localVarPostBody interface{}
formFiles []formFile
localVarReturnValue *DtoJob
)
localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ArcherAdminAPIService.AdminEnqueueArcherJob")
if err != nil {
return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()}
}
localVarPath := localBasePath + "/admin/archer/jobs"
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}
if r.body == nil {
return localVarReturnValue, nil, reportError("body is required and must be specified")
}
// to determine the Content-Type header
localVarHTTPContentTypes := []string{"application/json"}
// set Content-Type header
localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes)
if localVarHTTPContentType != "" {
localVarHeaderParams["Content-Type"] = localVarHTTPContentType
}
// to determine the Accept header
localVarHTTPHeaderAccepts := []string{"application/json"}
// set Accept header
localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts)
if localVarHTTPHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept
}
// body params
localVarPostBody = r.body
if r.ctx != nil {
// API Key Authentication
if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok {
if apiKey, ok := auth["BearerAuth"]; ok {
var key string
if apiKey.Prefix != "" {
key = apiKey.Prefix + " " + apiKey.Key
} else {
key = apiKey.Key
}
localVarHeaderParams["Authorization"] = key
}
}
}
req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles)
if err != nil {
return localVarReturnValue, nil, err
}
localVarHTTPResponse, err := a.client.callAPI(req)
if err != nil || localVarHTTPResponse == nil {
return localVarReturnValue, localVarHTTPResponse, err
}
localVarBody, err := io.ReadAll(localVarHTTPResponse.Body)
localVarHTTPResponse.Body.Close()
localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody))
if err != nil {
return localVarReturnValue, localVarHTTPResponse, err
}
if localVarHTTPResponse.StatusCode >= 300 {
newErr := &GenericOpenAPIError{
body: localVarBody,
error: localVarHTTPResponse.Status,
}
if localVarHTTPResponse.StatusCode == 400 {
var v string
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
}
newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v)
newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
}
if localVarHTTPResponse.StatusCode == 401 {
var v string
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
}
newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v)
newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
}
if localVarHTTPResponse.StatusCode == 403 {
var v string
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
}
newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v)
newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
}
if localVarHTTPResponse.StatusCode == 500 {
var v string
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
}
newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v)
newErr.model = v
}
return localVarReturnValue, localVarHTTPResponse, newErr
}
err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr := &GenericOpenAPIError{
body: localVarBody,
error: err.Error(),
}
return localVarReturnValue, localVarHTTPResponse, newErr
}
return localVarReturnValue, localVarHTTPResponse, nil
}
type ApiAdminListArcherJobsRequest struct {
ctx context.Context
ApiService *ArcherAdminAPIService
status *string
queue *string
q *string
page *int32
pageSize *int32
}
// Filter by status
func (r ApiAdminListArcherJobsRequest) Status(status string) ApiAdminListArcherJobsRequest {
r.status = &status
return r
}
// Filter by queue name / worker name
func (r ApiAdminListArcherJobsRequest) Queue(queue string) ApiAdminListArcherJobsRequest {
r.queue = &queue
return r
}
// Free-text search
func (r ApiAdminListArcherJobsRequest) Q(q string) ApiAdminListArcherJobsRequest {
r.q = &q
return r
}
// Page number
func (r ApiAdminListArcherJobsRequest) Page(page int32) ApiAdminListArcherJobsRequest {
r.page = &page
return r
}
// Items per page
func (r ApiAdminListArcherJobsRequest) PageSize(pageSize int32) ApiAdminListArcherJobsRequest {
r.pageSize = &pageSize
return r
}
func (r ApiAdminListArcherJobsRequest) Execute() (*DtoPageJob, *http.Response, error) {
return r.ApiService.AdminListArcherJobsExecute(r)
}
/*
AdminListArcherJobs List Archer jobs (admin)
Paginated background jobs with optional filters. Search `q` may match id, type, error, payload (implementation-dependent).
@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
@return ApiAdminListArcherJobsRequest
*/
func (a *ArcherAdminAPIService) AdminListArcherJobs(ctx context.Context) ApiAdminListArcherJobsRequest {
return ApiAdminListArcherJobsRequest{
ApiService: a,
ctx: ctx,
}
}
// Execute executes the request
//
// @return DtoPageJob
func (a *ArcherAdminAPIService) AdminListArcherJobsExecute(r ApiAdminListArcherJobsRequest) (*DtoPageJob, *http.Response, error) {
var (
localVarHTTPMethod = http.MethodGet
localVarPostBody interface{}
formFiles []formFile
localVarReturnValue *DtoPageJob
)
localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ArcherAdminAPIService.AdminListArcherJobs")
if err != nil {
return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()}
}
localVarPath := localBasePath + "/admin/archer/jobs"
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}
if r.status != nil {
parameterAddToHeaderOrQuery(localVarQueryParams, "status", r.status, "", "")
}
if r.queue != nil {
parameterAddToHeaderOrQuery(localVarQueryParams, "queue", r.queue, "", "")
}
if r.q != nil {
parameterAddToHeaderOrQuery(localVarQueryParams, "q", r.q, "", "")
}
if r.page != nil {
parameterAddToHeaderOrQuery(localVarQueryParams, "page", r.page, "", "")
} else {
var defaultValue int32 = 1
parameterAddToHeaderOrQuery(localVarQueryParams, "page", defaultValue, "", "")
r.page = &defaultValue
}
if r.pageSize != nil {
parameterAddToHeaderOrQuery(localVarQueryParams, "page_size", r.pageSize, "", "")
} else {
var defaultValue int32 = 25
parameterAddToHeaderOrQuery(localVarQueryParams, "page_size", defaultValue, "", "")
r.pageSize = &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
}
if r.ctx != nil {
// API Key Authentication
if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok {
if apiKey, ok := auth["BearerAuth"]; ok {
var key string
if apiKey.Prefix != "" {
key = apiKey.Prefix + " " + apiKey.Key
} else {
key = apiKey.Key
}
localVarHeaderParams["Authorization"] = key
}
}
}
req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles)
if err != nil {
return localVarReturnValue, nil, err
}
localVarHTTPResponse, err := a.client.callAPI(req)
if err != nil || localVarHTTPResponse == nil {
return localVarReturnValue, localVarHTTPResponse, err
}
localVarBody, err := io.ReadAll(localVarHTTPResponse.Body)
localVarHTTPResponse.Body.Close()
localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody))
if err != nil {
return localVarReturnValue, localVarHTTPResponse, err
}
if localVarHTTPResponse.StatusCode >= 300 {
newErr := &GenericOpenAPIError{
body: localVarBody,
error: localVarHTTPResponse.Status,
}
if localVarHTTPResponse.StatusCode == 401 {
var v string
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
}
newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v)
newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
}
if localVarHTTPResponse.StatusCode == 403 {
var v string
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
}
newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v)
newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
}
if localVarHTTPResponse.StatusCode == 500 {
var v string
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
}
newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v)
newErr.model = v
}
return localVarReturnValue, localVarHTTPResponse, newErr
}
err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr := &GenericOpenAPIError{
body: localVarBody,
error: err.Error(),
}
return localVarReturnValue, localVarHTTPResponse, newErr
}
return localVarReturnValue, localVarHTTPResponse, nil
}
type ApiAdminListArcherQueuesRequest struct {
ctx context.Context
ApiService *ArcherAdminAPIService
}
func (r ApiAdminListArcherQueuesRequest) Execute() ([]DtoQueueInfo, *http.Response, error) {
return r.ApiService.AdminListArcherQueuesExecute(r)
}
/*
AdminListArcherQueues List Archer queues (admin)
Summary metrics per queue (pending, running, failed, scheduled).
@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
@return ApiAdminListArcherQueuesRequest
*/
func (a *ArcherAdminAPIService) AdminListArcherQueues(ctx context.Context) ApiAdminListArcherQueuesRequest {
return ApiAdminListArcherQueuesRequest{
ApiService: a,
ctx: ctx,
}
}
// Execute executes the request
//
// @return []DtoQueueInfo
func (a *ArcherAdminAPIService) AdminListArcherQueuesExecute(r ApiAdminListArcherQueuesRequest) ([]DtoQueueInfo, *http.Response, error) {
var (
localVarHTTPMethod = http.MethodGet
localVarPostBody interface{}
formFiles []formFile
localVarReturnValue []DtoQueueInfo
)
localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ArcherAdminAPIService.AdminListArcherQueues")
if err != nil {
return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()}
}
localVarPath := localBasePath + "/admin/archer/queues"
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}
// to determine the Content-Type header
localVarHTTPContentTypes := []string{}
// set Content-Type header
localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes)
if localVarHTTPContentType != "" {
localVarHeaderParams["Content-Type"] = localVarHTTPContentType
}
// to determine the Accept header
localVarHTTPHeaderAccepts := []string{"application/json"}
// set Accept header
localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts)
if localVarHTTPHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept
}
if r.ctx != nil {
// API Key Authentication
if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok {
if apiKey, ok := auth["BearerAuth"]; ok {
var key string
if apiKey.Prefix != "" {
key = apiKey.Prefix + " " + apiKey.Key
} else {
key = apiKey.Key
}
localVarHeaderParams["Authorization"] = key
}
}
}
req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles)
if err != nil {
return localVarReturnValue, nil, err
}
localVarHTTPResponse, err := a.client.callAPI(req)
if err != nil || localVarHTTPResponse == nil {
return localVarReturnValue, localVarHTTPResponse, err
}
localVarBody, err := io.ReadAll(localVarHTTPResponse.Body)
localVarHTTPResponse.Body.Close()
localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody))
if err != nil {
return localVarReturnValue, localVarHTTPResponse, err
}
if localVarHTTPResponse.StatusCode >= 300 {
newErr := &GenericOpenAPIError{
body: localVarBody,
error: localVarHTTPResponse.Status,
}
if localVarHTTPResponse.StatusCode == 401 {
var v string
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
}
newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v)
newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
}
if localVarHTTPResponse.StatusCode == 403 {
var v string
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
}
newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v)
newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
}
if localVarHTTPResponse.StatusCode == 500 {
var v string
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
}
newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v)
newErr.model = v
}
return localVarReturnValue, localVarHTTPResponse, newErr
}
err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr := &GenericOpenAPIError{
body: localVarBody,
error: err.Error(),
}
return localVarReturnValue, localVarHTTPResponse, newErr
}
return localVarReturnValue, localVarHTTPResponse, nil
}
type ApiAdminRetryArcherJobRequest struct {
ctx context.Context
ApiService *ArcherAdminAPIService
id string
}
func (r ApiAdminRetryArcherJobRequest) Execute() (*DtoJob, *http.Response, error) {
return r.ApiService.AdminRetryArcherJobExecute(r)
}
/*
AdminRetryArcherJob Retry a failed/canceled Archer job (admin)
Marks the job retriable (DB flip). Swap this for an Archer admin call if you expose one.
@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
@param id Job ID
@return ApiAdminRetryArcherJobRequest
*/
func (a *ArcherAdminAPIService) AdminRetryArcherJob(ctx context.Context, id string) ApiAdminRetryArcherJobRequest {
return ApiAdminRetryArcherJobRequest{
ApiService: a,
ctx: ctx,
id: id,
}
}
// Execute executes the request
//
// @return DtoJob
func (a *ArcherAdminAPIService) AdminRetryArcherJobExecute(r ApiAdminRetryArcherJobRequest) (*DtoJob, *http.Response, error) {
var (
localVarHTTPMethod = http.MethodPost
localVarPostBody interface{}
formFiles []formFile
localVarReturnValue *DtoJob
)
localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "ArcherAdminAPIService.AdminRetryArcherJob")
if err != nil {
return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()}
}
localVarPath := localBasePath + "/admin/archer/jobs/{id}/retry"
localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1)
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := url.Values{}
// to determine the Content-Type header
localVarHTTPContentTypes := []string{}
// set Content-Type header
localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes)
if localVarHTTPContentType != "" {
localVarHeaderParams["Content-Type"] = localVarHTTPContentType
}
// to determine the Accept header
localVarHTTPHeaderAccepts := []string{"application/json"}
// set Accept header
localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts)
if localVarHTTPHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept
}
if r.ctx != nil {
// API Key Authentication
if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok {
if apiKey, ok := auth["BearerAuth"]; ok {
var key string
if apiKey.Prefix != "" {
key = apiKey.Prefix + " " + apiKey.Key
} else {
key = apiKey.Key
}
localVarHeaderParams["Authorization"] = key
}
}
}
req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles)
if err != nil {
return localVarReturnValue, nil, err
}
localVarHTTPResponse, err := a.client.callAPI(req)
if err != nil || localVarHTTPResponse == nil {
return localVarReturnValue, localVarHTTPResponse, err
}
localVarBody, err := io.ReadAll(localVarHTTPResponse.Body)
localVarHTTPResponse.Body.Close()
localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody))
if err != nil {
return localVarReturnValue, localVarHTTPResponse, err
}
if localVarHTTPResponse.StatusCode >= 300 {
newErr := &GenericOpenAPIError{
body: localVarBody,
error: localVarHTTPResponse.Status,
}
if localVarHTTPResponse.StatusCode == 400 {
var v string
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
}
newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v)
newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
}
if localVarHTTPResponse.StatusCode == 401 {
var v string
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
}
newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v)
newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
}
if localVarHTTPResponse.StatusCode == 403 {
var v string
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
}
newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v)
newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
}
if localVarHTTPResponse.StatusCode == 404 {
var v string
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr.error = err.Error()
return localVarReturnValue, localVarHTTPResponse, newErr
}
newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v)
newErr.model = v
}
return localVarReturnValue, localVarHTTPResponse, newErr
}
err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr := &GenericOpenAPIError{
body: localVarBody,
error: err.Error(),
}
return localVarReturnValue, localVarHTTPResponse, newErr
}
return localVarReturnValue, localVarHTTPResponse, nil
}

View File

@@ -50,6 +50,8 @@ type APIClient struct {
AnnotationsAPI *AnnotationsAPIService
ArcherAdminAPI *ArcherAdminAPIService
AuthAPI *AuthAPIService
HealthAPI *HealthAPIService
@@ -86,6 +88,7 @@ func NewAPIClient(cfg *Configuration) *APIClient {
// API Services
c.AnnotationsAPI = (*AnnotationsAPIService)(&c.common)
c.ArcherAdminAPI = (*ArcherAdminAPIService)(&c.common)
c.AuthAPI = (*AuthAPIService)(&c.common)
c.HealthAPI = (*HealthAPIService)(&c.common)
c.LabelsAPI = (*LabelsAPIService)(&c.common)

View File

@@ -4,14 +4,157 @@ All URIs are relative to *http://localhost:8080/api/v1*
Method | HTTP request | Description
------------- | ------------- | -------------
[**CreateAnnotation**](AnnotationsAPI.md#CreateAnnotation) | **Post** /annotations | Create annotation (org scoped)
[**DeleteAnnotation**](AnnotationsAPI.md#DeleteAnnotation) | **Delete** /annotations/{id} | Delete annotation (org scoped)
[**GetAnnotation**](AnnotationsAPI.md#GetAnnotation) | **Get** /annotations/{id} | Get annotation by ID (org scoped)
[**ListAnnotations**](AnnotationsAPI.md#ListAnnotations) | **Get** /annotations | List annotations (org scoped)
[**UpdateAnnotation**](AnnotationsAPI.md#UpdateAnnotation) | **Patch** /annotations/{id} | Update annotation (org scoped)
## CreateAnnotation
> DtoAnnotationResponse CreateAnnotation(ctx).Body(body).XOrgID(xOrgID).Execute()
Create annotation (org scoped)
### Example
```go
package main
import (
"context"
"fmt"
"os"
openapiclient "github.com/glueops/autoglue-sdk-go"
)
func main() {
body := *openapiclient.NewDtoCreateAnnotationRequest() // DtoCreateAnnotationRequest | Annotation payload
xOrgID := "xOrgID_example" // string | Organization UUID (optional)
configuration := openapiclient.NewConfiguration()
apiClient := openapiclient.NewAPIClient(configuration)
resp, r, err := apiClient.AnnotationsAPI.CreateAnnotation(context.Background()).Body(body).XOrgID(xOrgID).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `AnnotationsAPI.CreateAnnotation``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `CreateAnnotation`: DtoAnnotationResponse
fmt.Fprintf(os.Stdout, "Response from `AnnotationsAPI.CreateAnnotation`: %v\n", resp)
}
```
### Path Parameters
### Other Parameters
Other parameters are passed through a pointer to a apiCreateAnnotationRequest struct via the builder pattern
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**body** | [**DtoCreateAnnotationRequest**](DtoCreateAnnotationRequest.md) | Annotation payload |
**xOrgID** | **string** | Organization UUID |
### Return type
[**DtoAnnotationResponse**](DtoAnnotationResponse.md)
### Authorization
[OrgKeyAuth](../README.md#OrgKeyAuth), [OrgSecretAuth](../README.md#OrgSecretAuth), [BearerAuth](../README.md#BearerAuth)
### HTTP request headers
- **Content-Type**: application/json
- **Accept**: application/json
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints)
[[Back to Model list]](../README.md#documentation-for-models)
[[Back to README]](../README.md)
## DeleteAnnotation
> string DeleteAnnotation(ctx, id).XOrgID(xOrgID).Execute()
Delete annotation (org scoped)
### Example
```go
package main
import (
"context"
"fmt"
"os"
openapiclient "github.com/glueops/autoglue-sdk-go"
)
func main() {
id := "id_example" // string | Annotation ID (UUID)
xOrgID := "xOrgID_example" // string | Organization UUID (optional)
configuration := openapiclient.NewConfiguration()
apiClient := openapiclient.NewAPIClient(configuration)
resp, r, err := apiClient.AnnotationsAPI.DeleteAnnotation(context.Background(), id).XOrgID(xOrgID).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `AnnotationsAPI.DeleteAnnotation``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `DeleteAnnotation`: string
fmt.Fprintf(os.Stdout, "Response from `AnnotationsAPI.DeleteAnnotation`: %v\n", resp)
}
```
### Path Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc.
**id** | **string** | Annotation ID (UUID) |
### Other Parameters
Other parameters are passed through a pointer to a apiDeleteAnnotationRequest struct via the builder pattern
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**xOrgID** | **string** | Organization UUID |
### Return type
**string**
### Authorization
[OrgKeyAuth](../README.md#OrgKeyAuth), [OrgSecretAuth](../README.md#OrgSecretAuth), [BearerAuth](../README.md#BearerAuth)
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: application/json
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints)
[[Back to Model list]](../README.md#documentation-for-models)
[[Back to README]](../README.md)
## GetAnnotation
> DtoAnnotationResponse GetAnnotation(ctx, id).XOrgID(xOrgID).Include(include).Execute()
> DtoAnnotationResponse GetAnnotation(ctx, id).XOrgID(xOrgID).Execute()
Get annotation by ID (org scoped)
@@ -32,11 +175,10 @@ import (
func main() {
id := "id_example" // string | Annotation ID (UUID)
xOrgID := "xOrgID_example" // string | Organization UUID (optional)
include := "include_example" // string | Optional: node_pools (optional)
configuration := openapiclient.NewConfiguration()
apiClient := openapiclient.NewAPIClient(configuration)
resp, r, err := apiClient.AnnotationsAPI.GetAnnotation(context.Background(), id).XOrgID(xOrgID).Include(include).Execute()
resp, r, err := apiClient.AnnotationsAPI.GetAnnotation(context.Background(), id).XOrgID(xOrgID).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `AnnotationsAPI.GetAnnotation``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
@@ -63,7 +205,6 @@ Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**xOrgID** | **string** | Organization UUID |
**include** | **string** | Optional: node_pools |
### Return type
@@ -154,3 +295,77 @@ Name | Type | Description | Notes
[[Back to Model list]](../README.md#documentation-for-models)
[[Back to README]](../README.md)
## UpdateAnnotation
> DtoAnnotationResponse UpdateAnnotation(ctx, id).Body(body).XOrgID(xOrgID).Execute()
Update annotation (org scoped)
### Example
```go
package main
import (
"context"
"fmt"
"os"
openapiclient "github.com/glueops/autoglue-sdk-go"
)
func main() {
id := "id_example" // string | Annotation ID (UUID)
body := *openapiclient.NewDtoUpdateAnnotationRequest() // DtoUpdateAnnotationRequest | Fields to update
xOrgID := "xOrgID_example" // string | Organization UUID (optional)
configuration := openapiclient.NewConfiguration()
apiClient := openapiclient.NewAPIClient(configuration)
resp, r, err := apiClient.AnnotationsAPI.UpdateAnnotation(context.Background(), id).Body(body).XOrgID(xOrgID).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `AnnotationsAPI.UpdateAnnotation``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `UpdateAnnotation`: DtoAnnotationResponse
fmt.Fprintf(os.Stdout, "Response from `AnnotationsAPI.UpdateAnnotation`: %v\n", resp)
}
```
### Path Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc.
**id** | **string** | Annotation ID (UUID) |
### Other Parameters
Other parameters are passed through a pointer to a apiUpdateAnnotationRequest struct via the builder pattern
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**body** | [**DtoUpdateAnnotationRequest**](DtoUpdateAnnotationRequest.md) | Fields to update |
**xOrgID** | **string** | Organization UUID |
### Return type
[**DtoAnnotationResponse**](DtoAnnotationResponse.md)
### Authorization
[OrgKeyAuth](../README.md#OrgKeyAuth), [OrgSecretAuth](../README.md#OrgSecretAuth), [BearerAuth](../README.md#BearerAuth)
### HTTP request headers
- **Content-Type**: application/json
- **Accept**: application/json
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints)
[[Back to Model list]](../README.md#documentation-for-models)
[[Back to README]](../README.md)

View File

@@ -0,0 +1,354 @@
# \ArcherAdminAPI
All URIs are relative to *http://localhost:8080/api/v1*
Method | HTTP request | Description
------------- | ------------- | -------------
[**AdminCancelArcherJob**](ArcherAdminAPI.md#AdminCancelArcherJob) | **Post** /admin/archer/jobs/{id}/cancel | Cancel an Archer job (admin)
[**AdminEnqueueArcherJob**](ArcherAdminAPI.md#AdminEnqueueArcherJob) | **Post** /admin/archer/jobs | Enqueue a new Archer job (admin)
[**AdminListArcherJobs**](ArcherAdminAPI.md#AdminListArcherJobs) | **Get** /admin/archer/jobs | List Archer jobs (admin)
[**AdminListArcherQueues**](ArcherAdminAPI.md#AdminListArcherQueues) | **Get** /admin/archer/queues | List Archer queues (admin)
[**AdminRetryArcherJob**](ArcherAdminAPI.md#AdminRetryArcherJob) | **Post** /admin/archer/jobs/{id}/retry | Retry a failed/canceled Archer job (admin)
## AdminCancelArcherJob
> DtoJob AdminCancelArcherJob(ctx, id).Execute()
Cancel an Archer job (admin)
### Example
```go
package main
import (
"context"
"fmt"
"os"
openapiclient "github.com/glueops/autoglue-sdk-go"
)
func main() {
id := "id_example" // string | Job ID
configuration := openapiclient.NewConfiguration()
apiClient := openapiclient.NewAPIClient(configuration)
resp, r, err := apiClient.ArcherAdminAPI.AdminCancelArcherJob(context.Background(), id).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `ArcherAdminAPI.AdminCancelArcherJob``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `AdminCancelArcherJob`: DtoJob
fmt.Fprintf(os.Stdout, "Response from `ArcherAdminAPI.AdminCancelArcherJob`: %v\n", resp)
}
```
### Path Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc.
**id** | **string** | Job ID |
### Other Parameters
Other parameters are passed through a pointer to a apiAdminCancelArcherJobRequest struct via the builder pattern
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
### Return type
[**DtoJob**](DtoJob.md)
### Authorization
[BearerAuth](../README.md#BearerAuth)
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: application/json
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints)
[[Back to Model list]](../README.md#documentation-for-models)
[[Back to README]](../README.md)
## AdminEnqueueArcherJob
> DtoJob AdminEnqueueArcherJob(ctx).Body(body).Execute()
Enqueue a new Archer job (admin)
### Example
```go
package main
import (
"context"
"fmt"
"os"
openapiclient "github.com/glueops/autoglue-sdk-go"
)
func main() {
body := map[string]interface{}{ ... } // map[string]interface{} | Job parameters
configuration := openapiclient.NewConfiguration()
apiClient := openapiclient.NewAPIClient(configuration)
resp, r, err := apiClient.ArcherAdminAPI.AdminEnqueueArcherJob(context.Background()).Body(body).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `ArcherAdminAPI.AdminEnqueueArcherJob``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `AdminEnqueueArcherJob`: DtoJob
fmt.Fprintf(os.Stdout, "Response from `ArcherAdminAPI.AdminEnqueueArcherJob`: %v\n", resp)
}
```
### Path Parameters
### Other Parameters
Other parameters are passed through a pointer to a apiAdminEnqueueArcherJobRequest struct via the builder pattern
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**body** | **map[string]interface{}** | Job parameters |
### Return type
[**DtoJob**](DtoJob.md)
### Authorization
[BearerAuth](../README.md#BearerAuth)
### HTTP request headers
- **Content-Type**: application/json
- **Accept**: application/json
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints)
[[Back to Model list]](../README.md#documentation-for-models)
[[Back to README]](../README.md)
## AdminListArcherJobs
> DtoPageJob AdminListArcherJobs(ctx).Status(status).Queue(queue).Q(q).Page(page).PageSize(pageSize).Execute()
List Archer jobs (admin)
### Example
```go
package main
import (
"context"
"fmt"
"os"
openapiclient "github.com/glueops/autoglue-sdk-go"
)
func main() {
status := "status_example" // string | Filter by status (optional)
queue := "queue_example" // string | Filter by queue name / worker name (optional)
q := "q_example" // string | Free-text search (optional)
page := int32(56) // int32 | Page number (optional) (default to 1)
pageSize := int32(56) // int32 | Items per page (optional) (default to 25)
configuration := openapiclient.NewConfiguration()
apiClient := openapiclient.NewAPIClient(configuration)
resp, r, err := apiClient.ArcherAdminAPI.AdminListArcherJobs(context.Background()).Status(status).Queue(queue).Q(q).Page(page).PageSize(pageSize).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `ArcherAdminAPI.AdminListArcherJobs``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `AdminListArcherJobs`: DtoPageJob
fmt.Fprintf(os.Stdout, "Response from `ArcherAdminAPI.AdminListArcherJobs`: %v\n", resp)
}
```
### Path Parameters
### Other Parameters
Other parameters are passed through a pointer to a apiAdminListArcherJobsRequest struct via the builder pattern
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**status** | **string** | Filter by status |
**queue** | **string** | Filter by queue name / worker name |
**q** | **string** | Free-text search |
**page** | **int32** | Page number | [default to 1]
**pageSize** | **int32** | Items per page | [default to 25]
### Return type
[**DtoPageJob**](DtoPageJob.md)
### Authorization
[BearerAuth](../README.md#BearerAuth)
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: application/json
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints)
[[Back to Model list]](../README.md#documentation-for-models)
[[Back to README]](../README.md)
## AdminListArcherQueues
> []DtoQueueInfo AdminListArcherQueues(ctx).Execute()
List Archer queues (admin)
### Example
```go
package main
import (
"context"
"fmt"
"os"
openapiclient "github.com/glueops/autoglue-sdk-go"
)
func main() {
configuration := openapiclient.NewConfiguration()
apiClient := openapiclient.NewAPIClient(configuration)
resp, r, err := apiClient.ArcherAdminAPI.AdminListArcherQueues(context.Background()).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `ArcherAdminAPI.AdminListArcherQueues``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `AdminListArcherQueues`: []DtoQueueInfo
fmt.Fprintf(os.Stdout, "Response from `ArcherAdminAPI.AdminListArcherQueues`: %v\n", resp)
}
```
### Path Parameters
This endpoint does not need any parameter.
### Other Parameters
Other parameters are passed through a pointer to a apiAdminListArcherQueuesRequest struct via the builder pattern
### Return type
[**[]DtoQueueInfo**](DtoQueueInfo.md)
### Authorization
[BearerAuth](../README.md#BearerAuth)
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: application/json
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints)
[[Back to Model list]](../README.md#documentation-for-models)
[[Back to README]](../README.md)
## AdminRetryArcherJob
> DtoJob AdminRetryArcherJob(ctx, id).Execute()
Retry a failed/canceled Archer job (admin)
### Example
```go
package main
import (
"context"
"fmt"
"os"
openapiclient "github.com/glueops/autoglue-sdk-go"
)
func main() {
id := "id_example" // string | Job ID
configuration := openapiclient.NewConfiguration()
apiClient := openapiclient.NewAPIClient(configuration)
resp, r, err := apiClient.ArcherAdminAPI.AdminRetryArcherJob(context.Background(), id).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `ArcherAdminAPI.AdminRetryArcherJob``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `AdminRetryArcherJob`: DtoJob
fmt.Fprintf(os.Stdout, "Response from `ArcherAdminAPI.AdminRetryArcherJob`: %v\n", resp)
}
```
### Path Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc.
**id** | **string** | Job ID |
### Other Parameters
Other parameters are passed through a pointer to a apiAdminRetryArcherJobRequest struct via the builder pattern
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
### Return type
[**DtoJob**](DtoJob.md)
### Authorization
[BearerAuth](../README.md#BearerAuth)
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: application/json
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints)
[[Back to Model list]](../README.md#documentation-for-models)
[[Back to README]](../README.md)

View File

@@ -0,0 +1,82 @@
# DtoCreateAnnotationRequest
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**Key** | Pointer to **string** | | [optional]
**Value** | Pointer to **string** | | [optional]
## Methods
### NewDtoCreateAnnotationRequest
`func NewDtoCreateAnnotationRequest() *DtoCreateAnnotationRequest`
NewDtoCreateAnnotationRequest instantiates a new DtoCreateAnnotationRequest object
This constructor will assign default values to properties that have it defined,
and makes sure properties required by API are set, but the set of arguments
will change when the set of required properties is changed
### NewDtoCreateAnnotationRequestWithDefaults
`func NewDtoCreateAnnotationRequestWithDefaults() *DtoCreateAnnotationRequest`
NewDtoCreateAnnotationRequestWithDefaults instantiates a new DtoCreateAnnotationRequest object
This constructor will only assign default values to properties that have it defined,
but it doesn't guarantee that properties required by API are set
### GetKey
`func (o *DtoCreateAnnotationRequest) GetKey() string`
GetKey returns the Key field if non-nil, zero value otherwise.
### GetKeyOk
`func (o *DtoCreateAnnotationRequest) GetKeyOk() (*string, bool)`
GetKeyOk returns a tuple with the Key field if it's non-nil, zero value otherwise
and a boolean to check if the value has been set.
### SetKey
`func (o *DtoCreateAnnotationRequest) SetKey(v string)`
SetKey sets Key field to given value.
### HasKey
`func (o *DtoCreateAnnotationRequest) HasKey() bool`
HasKey returns a boolean if a field has been set.
### GetValue
`func (o *DtoCreateAnnotationRequest) GetValue() string`
GetValue returns the Value field if non-nil, zero value otherwise.
### GetValueOk
`func (o *DtoCreateAnnotationRequest) GetValueOk() (*string, bool)`
GetValueOk returns a tuple with the Value field if it's non-nil, zero value otherwise
and a boolean to check if the value has been set.
### SetValue
`func (o *DtoCreateAnnotationRequest) SetValue(v string)`
SetValue sets Value field to given value.
### HasValue
`func (o *DtoCreateAnnotationRequest) HasValue() bool`
HasValue returns a boolean if a field has been set.
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

316
sdk/go/docs/DtoJob.md Normal file
View File

@@ -0,0 +1,316 @@
# DtoJob
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**Attempts** | Pointer to **int32** | example: 0 | [optional]
**CreatedAt** | Pointer to **string** | example: 2025-11-04T09:30:00Z | [optional]
**Id** | Pointer to **string** | example: 01HF7SZK8Z8WG1M3J7S2Z8M2N6 | [optional]
**LastError** | Pointer to **string** | example: dial tcp: i/o timeout | [optional]
**MaxAttempts** | Pointer to **int32** | example: 3 | [optional]
**Payload** | Pointer to **map[string]interface{}** | arbitrary JSON payload | [optional]
**Queue** | Pointer to **string** | example: default | [optional]
**RunAt** | Pointer to **string** | example: 2025-11-05T08:00:00Z | [optional]
**Status** | Pointer to [**DtoJobStatus**](DtoJobStatus.md) | enum: queued,running,succeeded,failed,canceled,retrying,scheduled example: queued | [optional]
**Type** | Pointer to **string** | example: email.send | [optional]
**UpdatedAt** | Pointer to **string** | example: 2025-11-04T09:31:00Z | [optional]
## Methods
### NewDtoJob
`func NewDtoJob() *DtoJob`
NewDtoJob instantiates a new DtoJob object
This constructor will assign default values to properties that have it defined,
and makes sure properties required by API are set, but the set of arguments
will change when the set of required properties is changed
### NewDtoJobWithDefaults
`func NewDtoJobWithDefaults() *DtoJob`
NewDtoJobWithDefaults instantiates a new DtoJob object
This constructor will only assign default values to properties that have it defined,
but it doesn't guarantee that properties required by API are set
### GetAttempts
`func (o *DtoJob) GetAttempts() int32`
GetAttempts returns the Attempts field if non-nil, zero value otherwise.
### GetAttemptsOk
`func (o *DtoJob) GetAttemptsOk() (*int32, bool)`
GetAttemptsOk returns a tuple with the Attempts field if it's non-nil, zero value otherwise
and a boolean to check if the value has been set.
### SetAttempts
`func (o *DtoJob) SetAttempts(v int32)`
SetAttempts sets Attempts field to given value.
### HasAttempts
`func (o *DtoJob) HasAttempts() bool`
HasAttempts returns a boolean if a field has been set.
### GetCreatedAt
`func (o *DtoJob) GetCreatedAt() string`
GetCreatedAt returns the CreatedAt field if non-nil, zero value otherwise.
### GetCreatedAtOk
`func (o *DtoJob) GetCreatedAtOk() (*string, bool)`
GetCreatedAtOk returns a tuple with the CreatedAt field if it's non-nil, zero value otherwise
and a boolean to check if the value has been set.
### SetCreatedAt
`func (o *DtoJob) SetCreatedAt(v string)`
SetCreatedAt sets CreatedAt field to given value.
### HasCreatedAt
`func (o *DtoJob) HasCreatedAt() bool`
HasCreatedAt returns a boolean if a field has been set.
### GetId
`func (o *DtoJob) GetId() string`
GetId returns the Id field if non-nil, zero value otherwise.
### GetIdOk
`func (o *DtoJob) GetIdOk() (*string, bool)`
GetIdOk returns a tuple with the Id field if it's non-nil, zero value otherwise
and a boolean to check if the value has been set.
### SetId
`func (o *DtoJob) SetId(v string)`
SetId sets Id field to given value.
### HasId
`func (o *DtoJob) HasId() bool`
HasId returns a boolean if a field has been set.
### GetLastError
`func (o *DtoJob) GetLastError() string`
GetLastError returns the LastError field if non-nil, zero value otherwise.
### GetLastErrorOk
`func (o *DtoJob) GetLastErrorOk() (*string, bool)`
GetLastErrorOk returns a tuple with the LastError field if it's non-nil, zero value otherwise
and a boolean to check if the value has been set.
### SetLastError
`func (o *DtoJob) SetLastError(v string)`
SetLastError sets LastError field to given value.
### HasLastError
`func (o *DtoJob) HasLastError() bool`
HasLastError returns a boolean if a field has been set.
### GetMaxAttempts
`func (o *DtoJob) GetMaxAttempts() int32`
GetMaxAttempts returns the MaxAttempts field if non-nil, zero value otherwise.
### GetMaxAttemptsOk
`func (o *DtoJob) GetMaxAttemptsOk() (*int32, bool)`
GetMaxAttemptsOk returns a tuple with the MaxAttempts field if it's non-nil, zero value otherwise
and a boolean to check if the value has been set.
### SetMaxAttempts
`func (o *DtoJob) SetMaxAttempts(v int32)`
SetMaxAttempts sets MaxAttempts field to given value.
### HasMaxAttempts
`func (o *DtoJob) HasMaxAttempts() bool`
HasMaxAttempts returns a boolean if a field has been set.
### GetPayload
`func (o *DtoJob) GetPayload() map[string]interface{}`
GetPayload returns the Payload field if non-nil, zero value otherwise.
### GetPayloadOk
`func (o *DtoJob) GetPayloadOk() (*map[string]interface{}, bool)`
GetPayloadOk returns a tuple with the Payload field if it's non-nil, zero value otherwise
and a boolean to check if the value has been set.
### SetPayload
`func (o *DtoJob) SetPayload(v map[string]interface{})`
SetPayload sets Payload field to given value.
### HasPayload
`func (o *DtoJob) HasPayload() bool`
HasPayload returns a boolean if a field has been set.
### GetQueue
`func (o *DtoJob) GetQueue() string`
GetQueue returns the Queue field if non-nil, zero value otherwise.
### GetQueueOk
`func (o *DtoJob) GetQueueOk() (*string, bool)`
GetQueueOk returns a tuple with the Queue field if it's non-nil, zero value otherwise
and a boolean to check if the value has been set.
### SetQueue
`func (o *DtoJob) SetQueue(v string)`
SetQueue sets Queue field to given value.
### HasQueue
`func (o *DtoJob) HasQueue() bool`
HasQueue returns a boolean if a field has been set.
### GetRunAt
`func (o *DtoJob) GetRunAt() string`
GetRunAt returns the RunAt field if non-nil, zero value otherwise.
### GetRunAtOk
`func (o *DtoJob) GetRunAtOk() (*string, bool)`
GetRunAtOk returns a tuple with the RunAt field if it's non-nil, zero value otherwise
and a boolean to check if the value has been set.
### SetRunAt
`func (o *DtoJob) SetRunAt(v string)`
SetRunAt sets RunAt field to given value.
### HasRunAt
`func (o *DtoJob) HasRunAt() bool`
HasRunAt returns a boolean if a field has been set.
### GetStatus
`func (o *DtoJob) GetStatus() DtoJobStatus`
GetStatus returns the Status field if non-nil, zero value otherwise.
### GetStatusOk
`func (o *DtoJob) GetStatusOk() (*DtoJobStatus, bool)`
GetStatusOk returns a tuple with the Status field if it's non-nil, zero value otherwise
and a boolean to check if the value has been set.
### SetStatus
`func (o *DtoJob) SetStatus(v DtoJobStatus)`
SetStatus sets Status field to given value.
### HasStatus
`func (o *DtoJob) HasStatus() bool`
HasStatus returns a boolean if a field has been set.
### GetType
`func (o *DtoJob) GetType() string`
GetType returns the Type field if non-nil, zero value otherwise.
### GetTypeOk
`func (o *DtoJob) GetTypeOk() (*string, bool)`
GetTypeOk returns a tuple with the Type field if it's non-nil, zero value otherwise
and a boolean to check if the value has been set.
### SetType
`func (o *DtoJob) SetType(v string)`
SetType sets Type field to given value.
### HasType
`func (o *DtoJob) HasType() bool`
HasType returns a boolean if a field has been set.
### GetUpdatedAt
`func (o *DtoJob) GetUpdatedAt() string`
GetUpdatedAt returns the UpdatedAt field if non-nil, zero value otherwise.
### GetUpdatedAtOk
`func (o *DtoJob) GetUpdatedAtOk() (*string, bool)`
GetUpdatedAtOk returns a tuple with the UpdatedAt field if it's non-nil, zero value otherwise
and a boolean to check if the value has been set.
### SetUpdatedAt
`func (o *DtoJob) SetUpdatedAt(v string)`
SetUpdatedAt sets UpdatedAt field to given value.
### HasUpdatedAt
`func (o *DtoJob) HasUpdatedAt() bool`
HasUpdatedAt returns a boolean if a field has been set.
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

View File

@@ -0,0 +1,23 @@
# DtoJobStatus
## Enum
* `StatusQueued` (value: `"queued"`)
* `StatusRunning` (value: `"running"`)
* `StatusSucceeded` (value: `"succeeded"`)
* `StatusFailed` (value: `"failed"`)
* `StatusCanceled` (value: `"canceled"`)
* `StatusRetrying` (value: `"retrying"`)
* `StatusScheduled` (value: `"scheduled"`)
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

134
sdk/go/docs/DtoPageJob.md Normal file
View File

@@ -0,0 +1,134 @@
# DtoPageJob
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**Items** | Pointer to [**[]DtoJob**](DtoJob.md) | | [optional]
**Page** | Pointer to **int32** | example: 1 | [optional]
**PageSize** | Pointer to **int32** | example: 25 | [optional]
**Total** | Pointer to **int32** | example: 120 | [optional]
## Methods
### NewDtoPageJob
`func NewDtoPageJob() *DtoPageJob`
NewDtoPageJob instantiates a new DtoPageJob object
This constructor will assign default values to properties that have it defined,
and makes sure properties required by API are set, but the set of arguments
will change when the set of required properties is changed
### NewDtoPageJobWithDefaults
`func NewDtoPageJobWithDefaults() *DtoPageJob`
NewDtoPageJobWithDefaults instantiates a new DtoPageJob object
This constructor will only assign default values to properties that have it defined,
but it doesn't guarantee that properties required by API are set
### GetItems
`func (o *DtoPageJob) GetItems() []DtoJob`
GetItems returns the Items field if non-nil, zero value otherwise.
### GetItemsOk
`func (o *DtoPageJob) GetItemsOk() (*[]DtoJob, bool)`
GetItemsOk returns a tuple with the Items field if it's non-nil, zero value otherwise
and a boolean to check if the value has been set.
### SetItems
`func (o *DtoPageJob) SetItems(v []DtoJob)`
SetItems sets Items field to given value.
### HasItems
`func (o *DtoPageJob) HasItems() bool`
HasItems returns a boolean if a field has been set.
### GetPage
`func (o *DtoPageJob) GetPage() int32`
GetPage returns the Page field if non-nil, zero value otherwise.
### GetPageOk
`func (o *DtoPageJob) GetPageOk() (*int32, bool)`
GetPageOk returns a tuple with the Page field if it's non-nil, zero value otherwise
and a boolean to check if the value has been set.
### SetPage
`func (o *DtoPageJob) SetPage(v int32)`
SetPage sets Page field to given value.
### HasPage
`func (o *DtoPageJob) HasPage() bool`
HasPage returns a boolean if a field has been set.
### GetPageSize
`func (o *DtoPageJob) GetPageSize() int32`
GetPageSize returns the PageSize field if non-nil, zero value otherwise.
### GetPageSizeOk
`func (o *DtoPageJob) GetPageSizeOk() (*int32, bool)`
GetPageSizeOk returns a tuple with the PageSize field if it's non-nil, zero value otherwise
and a boolean to check if the value has been set.
### SetPageSize
`func (o *DtoPageJob) SetPageSize(v int32)`
SetPageSize sets PageSize field to given value.
### HasPageSize
`func (o *DtoPageJob) HasPageSize() bool`
HasPageSize returns a boolean if a field has been set.
### GetTotal
`func (o *DtoPageJob) GetTotal() int32`
GetTotal returns the Total field if non-nil, zero value otherwise.
### GetTotalOk
`func (o *DtoPageJob) GetTotalOk() (*int32, bool)`
GetTotalOk returns a tuple with the Total field if it's non-nil, zero value otherwise
and a boolean to check if the value has been set.
### SetTotal
`func (o *DtoPageJob) SetTotal(v int32)`
SetTotal sets Total field to given value.
### HasTotal
`func (o *DtoPageJob) HasTotal() bool`
HasTotal returns a boolean if a field has been set.
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

160
sdk/go/docs/DtoQueueInfo.md Normal file
View File

@@ -0,0 +1,160 @@
# DtoQueueInfo
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**Failed** | Pointer to **int32** | example: 5 | [optional]
**Name** | Pointer to **string** | example: default | [optional]
**Pending** | Pointer to **int32** | example: 42 | [optional]
**Running** | Pointer to **int32** | example: 3 | [optional]
**Scheduled** | Pointer to **int32** | example: 7 | [optional]
## Methods
### NewDtoQueueInfo
`func NewDtoQueueInfo() *DtoQueueInfo`
NewDtoQueueInfo instantiates a new DtoQueueInfo object
This constructor will assign default values to properties that have it defined,
and makes sure properties required by API are set, but the set of arguments
will change when the set of required properties is changed
### NewDtoQueueInfoWithDefaults
`func NewDtoQueueInfoWithDefaults() *DtoQueueInfo`
NewDtoQueueInfoWithDefaults instantiates a new DtoQueueInfo object
This constructor will only assign default values to properties that have it defined,
but it doesn't guarantee that properties required by API are set
### GetFailed
`func (o *DtoQueueInfo) GetFailed() int32`
GetFailed returns the Failed field if non-nil, zero value otherwise.
### GetFailedOk
`func (o *DtoQueueInfo) GetFailedOk() (*int32, bool)`
GetFailedOk returns a tuple with the Failed field if it's non-nil, zero value otherwise
and a boolean to check if the value has been set.
### SetFailed
`func (o *DtoQueueInfo) SetFailed(v int32)`
SetFailed sets Failed field to given value.
### HasFailed
`func (o *DtoQueueInfo) HasFailed() bool`
HasFailed returns a boolean if a field has been set.
### GetName
`func (o *DtoQueueInfo) GetName() string`
GetName returns the Name field if non-nil, zero value otherwise.
### GetNameOk
`func (o *DtoQueueInfo) GetNameOk() (*string, bool)`
GetNameOk returns a tuple with the Name field if it's non-nil, zero value otherwise
and a boolean to check if the value has been set.
### SetName
`func (o *DtoQueueInfo) SetName(v string)`
SetName sets Name field to given value.
### HasName
`func (o *DtoQueueInfo) HasName() bool`
HasName returns a boolean if a field has been set.
### GetPending
`func (o *DtoQueueInfo) GetPending() int32`
GetPending returns the Pending field if non-nil, zero value otherwise.
### GetPendingOk
`func (o *DtoQueueInfo) GetPendingOk() (*int32, bool)`
GetPendingOk returns a tuple with the Pending field if it's non-nil, zero value otherwise
and a boolean to check if the value has been set.
### SetPending
`func (o *DtoQueueInfo) SetPending(v int32)`
SetPending sets Pending field to given value.
### HasPending
`func (o *DtoQueueInfo) HasPending() bool`
HasPending returns a boolean if a field has been set.
### GetRunning
`func (o *DtoQueueInfo) GetRunning() int32`
GetRunning returns the Running field if non-nil, zero value otherwise.
### GetRunningOk
`func (o *DtoQueueInfo) GetRunningOk() (*int32, bool)`
GetRunningOk returns a tuple with the Running field if it's non-nil, zero value otherwise
and a boolean to check if the value has been set.
### SetRunning
`func (o *DtoQueueInfo) SetRunning(v int32)`
SetRunning sets Running field to given value.
### HasRunning
`func (o *DtoQueueInfo) HasRunning() bool`
HasRunning returns a boolean if a field has been set.
### GetScheduled
`func (o *DtoQueueInfo) GetScheduled() int32`
GetScheduled returns the Scheduled field if non-nil, zero value otherwise.
### GetScheduledOk
`func (o *DtoQueueInfo) GetScheduledOk() (*int32, bool)`
GetScheduledOk returns a tuple with the Scheduled field if it's non-nil, zero value otherwise
and a boolean to check if the value has been set.
### SetScheduled
`func (o *DtoQueueInfo) SetScheduled(v int32)`
SetScheduled sets Scheduled field to given value.
### HasScheduled
`func (o *DtoQueueInfo) HasScheduled() bool`
HasScheduled returns a boolean if a field has been set.
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

View File

@@ -0,0 +1,82 @@
# DtoUpdateAnnotationRequest
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**Key** | Pointer to **string** | | [optional]
**Value** | Pointer to **string** | | [optional]
## Methods
### NewDtoUpdateAnnotationRequest
`func NewDtoUpdateAnnotationRequest() *DtoUpdateAnnotationRequest`
NewDtoUpdateAnnotationRequest instantiates a new DtoUpdateAnnotationRequest object
This constructor will assign default values to properties that have it defined,
and makes sure properties required by API are set, but the set of arguments
will change when the set of required properties is changed
### NewDtoUpdateAnnotationRequestWithDefaults
`func NewDtoUpdateAnnotationRequestWithDefaults() *DtoUpdateAnnotationRequest`
NewDtoUpdateAnnotationRequestWithDefaults instantiates a new DtoUpdateAnnotationRequest object
This constructor will only assign default values to properties that have it defined,
but it doesn't guarantee that properties required by API are set
### GetKey
`func (o *DtoUpdateAnnotationRequest) GetKey() string`
GetKey returns the Key field if non-nil, zero value otherwise.
### GetKeyOk
`func (o *DtoUpdateAnnotationRequest) GetKeyOk() (*string, bool)`
GetKeyOk returns a tuple with the Key field if it's non-nil, zero value otherwise
and a boolean to check if the value has been set.
### SetKey
`func (o *DtoUpdateAnnotationRequest) SetKey(v string)`
SetKey sets Key field to given value.
### HasKey
`func (o *DtoUpdateAnnotationRequest) HasKey() bool`
HasKey returns a boolean if a field has been set.
### GetValue
`func (o *DtoUpdateAnnotationRequest) GetValue() string`
GetValue returns the Value field if non-nil, zero value otherwise.
### GetValueOk
`func (o *DtoUpdateAnnotationRequest) GetValueOk() (*string, bool)`
GetValueOk returns a tuple with the Value field if it's non-nil, zero value otherwise
and a boolean to check if the value has been set.
### SetValue
`func (o *DtoUpdateAnnotationRequest) SetValue(v string)`
SetValue sets Value field to given value.
### HasValue
`func (o *DtoUpdateAnnotationRequest) HasValue() bool`
HasValue returns a boolean if a field has been set.
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

View File

@@ -9,6 +9,7 @@ Name | Type | Description | Notes
**DisplayName** | Pointer to **string** | | [optional]
**Emails** | Pointer to [**[]ModelsUserEmail**](ModelsUserEmail.md) | | [optional]
**Id** | Pointer to **string** | example: 3fa85f64-5717-4562-b3fc-2c963f66afa6 | [optional]
**IsAdmin** | Pointer to **bool** | | [optional]
**IsDisabled** | Pointer to **bool** | | [optional]
**Organizations** | Pointer to [**[]ModelsOrganization**](ModelsOrganization.md) | | [optional]
**PrimaryEmail** | Pointer to **string** | | [optional]
@@ -158,6 +159,31 @@ SetId sets Id field to given value.
HasId returns a boolean if a field has been set.
### GetIsAdmin
`func (o *HandlersMeResponse) GetIsAdmin() bool`
GetIsAdmin returns the IsAdmin field if non-nil, zero value otherwise.
### GetIsAdminOk
`func (o *HandlersMeResponse) GetIsAdminOk() (*bool, bool)`
GetIsAdminOk returns a tuple with the IsAdmin field if it's non-nil, zero value otherwise
and a boolean to check if the value has been set.
### SetIsAdmin
`func (o *HandlersMeResponse) SetIsAdmin(v bool)`
SetIsAdmin sets IsAdmin field to given value.
### HasIsAdmin
`func (o *HandlersMeResponse) HasIsAdmin() bool`
HasIsAdmin returns a boolean if a field has been set.
### GetIsDisabled
`func (o *HandlersMeResponse) GetIsDisabled() bool`

View File

@@ -8,6 +8,7 @@ Name | Type | Description | Notes
**CreatedAt** | Pointer to **time.Time** | | [optional]
**DisplayName** | Pointer to **string** | | [optional]
**Id** | Pointer to **string** | example: 3fa85f64-5717-4562-b3fc-2c963f66afa6 | [optional]
**IsAdmin** | Pointer to **bool** | | [optional]
**IsDisabled** | Pointer to **bool** | | [optional]
**PrimaryEmail** | Pointer to **string** | | [optional]
**UpdatedAt** | Pointer to **time.Time** | | [optional]
@@ -131,6 +132,31 @@ SetId sets Id field to given value.
HasId returns a boolean if a field has been set.
### GetIsAdmin
`func (o *ModelsUser) GetIsAdmin() bool`
GetIsAdmin returns the IsAdmin field if non-nil, zero value otherwise.
### GetIsAdminOk
`func (o *ModelsUser) GetIsAdminOk() (*bool, bool)`
GetIsAdminOk returns a tuple with the IsAdmin field if it's non-nil, zero value otherwise
and a boolean to check if the value has been set.
### SetIsAdmin
`func (o *ModelsUser) SetIsAdmin(v bool)`
SetIsAdmin sets IsAdmin field to given value.
### HasIsAdmin
`func (o *ModelsUser) HasIsAdmin() bool`
HasIsAdmin returns a boolean if a field has been set.
### GetIsDisabled
`func (o *ModelsUser) GetIsDisabled() bool`

View File

@@ -0,0 +1,160 @@
/*
AutoGlue API
API for managing K3s clusters across cloud providers
API version: 1.0
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
package autoglue
import (
"encoding/json"
)
// checks if the DtoCreateAnnotationRequest type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &DtoCreateAnnotationRequest{}
// DtoCreateAnnotationRequest struct for DtoCreateAnnotationRequest
type DtoCreateAnnotationRequest struct {
Key *string `json:"key,omitempty"`
Value *string `json:"value,omitempty"`
}
// NewDtoCreateAnnotationRequest instantiates a new DtoCreateAnnotationRequest object
// This constructor will assign default values to properties that have it defined,
// and makes sure properties required by API are set, but the set of arguments
// will change when the set of required properties is changed
func NewDtoCreateAnnotationRequest() *DtoCreateAnnotationRequest {
this := DtoCreateAnnotationRequest{}
return &this
}
// NewDtoCreateAnnotationRequestWithDefaults instantiates a new DtoCreateAnnotationRequest object
// This constructor will only assign default values to properties that have it defined,
// but it doesn't guarantee that properties required by API are set
func NewDtoCreateAnnotationRequestWithDefaults() *DtoCreateAnnotationRequest {
this := DtoCreateAnnotationRequest{}
return &this
}
// GetKey returns the Key field value if set, zero value otherwise.
func (o *DtoCreateAnnotationRequest) 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 *DtoCreateAnnotationRequest) 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 *DtoCreateAnnotationRequest) 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 *DtoCreateAnnotationRequest) SetKey(v string) {
o.Key = &v
}
// GetValue returns the Value field value if set, zero value otherwise.
func (o *DtoCreateAnnotationRequest) GetValue() string {
if o == nil || IsNil(o.Value) {
var ret string
return ret
}
return *o.Value
}
// GetValueOk returns a tuple with the Value field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *DtoCreateAnnotationRequest) GetValueOk() (*string, bool) {
if o == nil || IsNil(o.Value) {
return nil, false
}
return o.Value, true
}
// HasValue returns a boolean if a field has been set.
func (o *DtoCreateAnnotationRequest) HasValue() bool {
if o != nil && !IsNil(o.Value) {
return true
}
return false
}
// SetValue gets a reference to the given string and assigns it to the Value field.
func (o *DtoCreateAnnotationRequest) SetValue(v string) {
o.Value = &v
}
func (o DtoCreateAnnotationRequest) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o DtoCreateAnnotationRequest) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.Key) {
toSerialize["key"] = o.Key
}
if !IsNil(o.Value) {
toSerialize["value"] = o.Value
}
return toSerialize, nil
}
type NullableDtoCreateAnnotationRequest struct {
value *DtoCreateAnnotationRequest
isSet bool
}
func (v NullableDtoCreateAnnotationRequest) Get() *DtoCreateAnnotationRequest {
return v.value
}
func (v *NullableDtoCreateAnnotationRequest) Set(val *DtoCreateAnnotationRequest) {
v.value = val
v.isSet = true
}
func (v NullableDtoCreateAnnotationRequest) IsSet() bool {
return v.isSet
}
func (v *NullableDtoCreateAnnotationRequest) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableDtoCreateAnnotationRequest(val *DtoCreateAnnotationRequest) *NullableDtoCreateAnnotationRequest {
return &NullableDtoCreateAnnotationRequest{value: val, isSet: true}
}
func (v NullableDtoCreateAnnotationRequest) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableDtoCreateAnnotationRequest) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}

495
sdk/go/model_dto_job.go Normal file
View File

@@ -0,0 +1,495 @@
/*
AutoGlue API
API for managing K3s clusters across cloud providers
API version: 1.0
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
package autoglue
import (
"encoding/json"
)
// checks if the DtoJob type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &DtoJob{}
// DtoJob struct for DtoJob
type DtoJob struct {
// example: 0
Attempts *int32 `json:"attempts,omitempty"`
// example: 2025-11-04T09:30:00Z
CreatedAt *string `json:"created_at,omitempty"`
// example: 01HF7SZK8Z8WG1M3J7S2Z8M2N6
Id *string `json:"id,omitempty"`
// example: dial tcp: i/o timeout
LastError *string `json:"last_error,omitempty"`
// example: 3
MaxAttempts *int32 `json:"max_attempts,omitempty"`
// arbitrary JSON payload
Payload map[string]interface{} `json:"payload,omitempty"`
// example: default
Queue *string `json:"queue,omitempty"`
// example: 2025-11-05T08:00:00Z
RunAt *string `json:"run_at,omitempty"`
// enum: queued,running,succeeded,failed,canceled,retrying,scheduled example: queued
Status *DtoJobStatus `json:"status,omitempty"`
// example: email.send
Type *string `json:"type,omitempty"`
// example: 2025-11-04T09:31:00Z
UpdatedAt *string `json:"updated_at,omitempty"`
}
// NewDtoJob instantiates a new DtoJob object
// This constructor will assign default values to properties that have it defined,
// and makes sure properties required by API are set, but the set of arguments
// will change when the set of required properties is changed
func NewDtoJob() *DtoJob {
this := DtoJob{}
return &this
}
// NewDtoJobWithDefaults instantiates a new DtoJob object
// This constructor will only assign default values to properties that have it defined,
// but it doesn't guarantee that properties required by API are set
func NewDtoJobWithDefaults() *DtoJob {
this := DtoJob{}
return &this
}
// GetAttempts returns the Attempts field value if set, zero value otherwise.
func (o *DtoJob) GetAttempts() int32 {
if o == nil || IsNil(o.Attempts) {
var ret int32
return ret
}
return *o.Attempts
}
// GetAttemptsOk returns a tuple with the Attempts field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *DtoJob) GetAttemptsOk() (*int32, bool) {
if o == nil || IsNil(o.Attempts) {
return nil, false
}
return o.Attempts, true
}
// HasAttempts returns a boolean if a field has been set.
func (o *DtoJob) HasAttempts() bool {
if o != nil && !IsNil(o.Attempts) {
return true
}
return false
}
// SetAttempts gets a reference to the given int32 and assigns it to the Attempts field.
func (o *DtoJob) SetAttempts(v int32) {
o.Attempts = &v
}
// GetCreatedAt returns the CreatedAt field value if set, zero value otherwise.
func (o *DtoJob) GetCreatedAt() string {
if o == nil || IsNil(o.CreatedAt) {
var ret string
return ret
}
return *o.CreatedAt
}
// GetCreatedAtOk returns a tuple with the CreatedAt field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *DtoJob) GetCreatedAtOk() (*string, bool) {
if o == nil || IsNil(o.CreatedAt) {
return nil, false
}
return o.CreatedAt, true
}
// HasCreatedAt returns a boolean if a field has been set.
func (o *DtoJob) HasCreatedAt() bool {
if o != nil && !IsNil(o.CreatedAt) {
return true
}
return false
}
// SetCreatedAt gets a reference to the given string and assigns it to the CreatedAt field.
func (o *DtoJob) SetCreatedAt(v string) {
o.CreatedAt = &v
}
// GetId returns the Id field value if set, zero value otherwise.
func (o *DtoJob) 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 *DtoJob) 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 *DtoJob) 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 *DtoJob) SetId(v string) {
o.Id = &v
}
// GetLastError returns the LastError field value if set, zero value otherwise.
func (o *DtoJob) GetLastError() string {
if o == nil || IsNil(o.LastError) {
var ret string
return ret
}
return *o.LastError
}
// GetLastErrorOk returns a tuple with the LastError field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *DtoJob) GetLastErrorOk() (*string, bool) {
if o == nil || IsNil(o.LastError) {
return nil, false
}
return o.LastError, true
}
// HasLastError returns a boolean if a field has been set.
func (o *DtoJob) HasLastError() bool {
if o != nil && !IsNil(o.LastError) {
return true
}
return false
}
// SetLastError gets a reference to the given string and assigns it to the LastError field.
func (o *DtoJob) SetLastError(v string) {
o.LastError = &v
}
// GetMaxAttempts returns the MaxAttempts field value if set, zero value otherwise.
func (o *DtoJob) 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 *DtoJob) 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 *DtoJob) 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 *DtoJob) SetMaxAttempts(v int32) {
o.MaxAttempts = &v
}
// GetPayload returns the Payload field value if set, zero value otherwise.
func (o *DtoJob) GetPayload() map[string]interface{} {
if o == nil || IsNil(o.Payload) {
var ret map[string]interface{}
return ret
}
return o.Payload
}
// GetPayloadOk returns a tuple with the Payload field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *DtoJob) GetPayloadOk() (map[string]interface{}, bool) {
if o == nil || IsNil(o.Payload) {
return map[string]interface{}{}, false
}
return o.Payload, true
}
// HasPayload returns a boolean if a field has been set.
func (o *DtoJob) HasPayload() bool {
if o != nil && !IsNil(o.Payload) {
return true
}
return false
}
// SetPayload gets a reference to the given map[string]interface{} and assigns it to the Payload field.
func (o *DtoJob) SetPayload(v map[string]interface{}) {
o.Payload = v
}
// GetQueue returns the Queue field value if set, zero value otherwise.
func (o *DtoJob) GetQueue() string {
if o == nil || IsNil(o.Queue) {
var ret string
return ret
}
return *o.Queue
}
// GetQueueOk returns a tuple with the Queue field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *DtoJob) GetQueueOk() (*string, bool) {
if o == nil || IsNil(o.Queue) {
return nil, false
}
return o.Queue, true
}
// HasQueue returns a boolean if a field has been set.
func (o *DtoJob) HasQueue() bool {
if o != nil && !IsNil(o.Queue) {
return true
}
return false
}
// SetQueue gets a reference to the given string and assigns it to the Queue field.
func (o *DtoJob) SetQueue(v string) {
o.Queue = &v
}
// GetRunAt returns the RunAt field value if set, zero value otherwise.
func (o *DtoJob) GetRunAt() string {
if o == nil || IsNil(o.RunAt) {
var ret string
return ret
}
return *o.RunAt
}
// GetRunAtOk returns a tuple with the RunAt field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *DtoJob) GetRunAtOk() (*string, bool) {
if o == nil || IsNil(o.RunAt) {
return nil, false
}
return o.RunAt, true
}
// HasRunAt returns a boolean if a field has been set.
func (o *DtoJob) HasRunAt() bool {
if o != nil && !IsNil(o.RunAt) {
return true
}
return false
}
// SetRunAt gets a reference to the given string and assigns it to the RunAt field.
func (o *DtoJob) SetRunAt(v string) {
o.RunAt = &v
}
// GetStatus returns the Status field value if set, zero value otherwise.
func (o *DtoJob) GetStatus() DtoJobStatus {
if o == nil || IsNil(o.Status) {
var ret DtoJobStatus
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 *DtoJob) GetStatusOk() (*DtoJobStatus, 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 *DtoJob) HasStatus() bool {
if o != nil && !IsNil(o.Status) {
return true
}
return false
}
// SetStatus gets a reference to the given DtoJobStatus and assigns it to the Status field.
func (o *DtoJob) SetStatus(v DtoJobStatus) {
o.Status = &v
}
// GetType returns the Type field value if set, zero value otherwise.
func (o *DtoJob) GetType() string {
if o == nil || IsNil(o.Type) {
var ret string
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 *DtoJob) GetTypeOk() (*string, 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 *DtoJob) HasType() bool {
if o != nil && !IsNil(o.Type) {
return true
}
return false
}
// SetType gets a reference to the given string and assigns it to the Type field.
func (o *DtoJob) SetType(v string) {
o.Type = &v
}
// GetUpdatedAt returns the UpdatedAt field value if set, zero value otherwise.
func (o *DtoJob) GetUpdatedAt() string {
if o == nil || IsNil(o.UpdatedAt) {
var ret string
return ret
}
return *o.UpdatedAt
}
// GetUpdatedAtOk returns a tuple with the UpdatedAt field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *DtoJob) GetUpdatedAtOk() (*string, bool) {
if o == nil || IsNil(o.UpdatedAt) {
return nil, false
}
return o.UpdatedAt, true
}
// HasUpdatedAt returns a boolean if a field has been set.
func (o *DtoJob) HasUpdatedAt() bool {
if o != nil && !IsNil(o.UpdatedAt) {
return true
}
return false
}
// SetUpdatedAt gets a reference to the given string and assigns it to the UpdatedAt field.
func (o *DtoJob) SetUpdatedAt(v string) {
o.UpdatedAt = &v
}
func (o DtoJob) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o DtoJob) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.Attempts) {
toSerialize["attempts"] = o.Attempts
}
if !IsNil(o.CreatedAt) {
toSerialize["created_at"] = o.CreatedAt
}
if !IsNil(o.Id) {
toSerialize["id"] = o.Id
}
if !IsNil(o.LastError) {
toSerialize["last_error"] = o.LastError
}
if !IsNil(o.MaxAttempts) {
toSerialize["max_attempts"] = o.MaxAttempts
}
if !IsNil(o.Payload) {
toSerialize["payload"] = o.Payload
}
if !IsNil(o.Queue) {
toSerialize["queue"] = o.Queue
}
if !IsNil(o.RunAt) {
toSerialize["run_at"] = o.RunAt
}
if !IsNil(o.Status) {
toSerialize["status"] = o.Status
}
if !IsNil(o.Type) {
toSerialize["type"] = o.Type
}
if !IsNil(o.UpdatedAt) {
toSerialize["updated_at"] = o.UpdatedAt
}
return toSerialize, nil
}
type NullableDtoJob struct {
value *DtoJob
isSet bool
}
func (v NullableDtoJob) Get() *DtoJob {
return v.value
}
func (v *NullableDtoJob) Set(val *DtoJob) {
v.value = val
v.isSet = true
}
func (v NullableDtoJob) IsSet() bool {
return v.isSet
}
func (v *NullableDtoJob) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableDtoJob(val *DtoJob) *NullableDtoJob {
return &NullableDtoJob{value: val, isSet: true}
}
func (v NullableDtoJob) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableDtoJob) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}

View File

@@ -0,0 +1,120 @@
/*
AutoGlue API
API for managing K3s clusters across cloud providers
API version: 1.0
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
package autoglue
import (
"encoding/json"
"fmt"
)
// DtoJobStatus the model 'DtoJobStatus'
type DtoJobStatus string
// List of dto.JobStatus
const (
StatusQueued DtoJobStatus = "queued"
StatusRunning DtoJobStatus = "running"
StatusSucceeded DtoJobStatus = "succeeded"
StatusFailed DtoJobStatus = "failed"
StatusCanceled DtoJobStatus = "canceled"
StatusRetrying DtoJobStatus = "retrying"
StatusScheduled DtoJobStatus = "scheduled"
)
// All allowed values of DtoJobStatus enum
var AllowedDtoJobStatusEnumValues = []DtoJobStatus{
"queued",
"running",
"succeeded",
"failed",
"canceled",
"retrying",
"scheduled",
}
func (v *DtoJobStatus) UnmarshalJSON(src []byte) error {
var value string
err := json.Unmarshal(src, &value)
if err != nil {
return err
}
enumTypeValue := DtoJobStatus(value)
for _, existing := range AllowedDtoJobStatusEnumValues {
if existing == enumTypeValue {
*v = enumTypeValue
return nil
}
}
return fmt.Errorf("%+v is not a valid DtoJobStatus", value)
}
// NewDtoJobStatusFromValue returns a pointer to a valid DtoJobStatus
// for the value passed as argument, or an error if the value passed is not allowed by the enum
func NewDtoJobStatusFromValue(v string) (*DtoJobStatus, error) {
ev := DtoJobStatus(v)
if ev.IsValid() {
return &ev, nil
} else {
return nil, fmt.Errorf("invalid value '%v' for DtoJobStatus: valid values are %v", v, AllowedDtoJobStatusEnumValues)
}
}
// IsValid return true if the value is valid for the enum, false otherwise
func (v DtoJobStatus) IsValid() bool {
for _, existing := range AllowedDtoJobStatusEnumValues {
if existing == v {
return true
}
}
return false
}
// Ptr returns reference to dto.JobStatus value
func (v DtoJobStatus) Ptr() *DtoJobStatus {
return &v
}
type NullableDtoJobStatus struct {
value *DtoJobStatus
isSet bool
}
func (v NullableDtoJobStatus) Get() *DtoJobStatus {
return v.value
}
func (v *NullableDtoJobStatus) Set(val *DtoJobStatus) {
v.value = val
v.isSet = true
}
func (v NullableDtoJobStatus) IsSet() bool {
return v.isSet
}
func (v *NullableDtoJobStatus) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableDtoJobStatus(val *DtoJobStatus) *NullableDtoJobStatus {
return &NullableDtoJobStatus{value: val, isSet: true}
}
func (v NullableDtoJobStatus) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableDtoJobStatus) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}

View File

@@ -0,0 +1,235 @@
/*
AutoGlue API
API for managing K3s clusters across cloud providers
API version: 1.0
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
package autoglue
import (
"encoding/json"
)
// checks if the DtoPageJob type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &DtoPageJob{}
// DtoPageJob struct for DtoPageJob
type DtoPageJob struct {
Items []DtoJob `json:"items,omitempty"`
// example: 1
Page *int32 `json:"page,omitempty"`
// example: 25
PageSize *int32 `json:"page_size,omitempty"`
// example: 120
Total *int32 `json:"total,omitempty"`
}
// NewDtoPageJob instantiates a new DtoPageJob object
// This constructor will assign default values to properties that have it defined,
// and makes sure properties required by API are set, but the set of arguments
// will change when the set of required properties is changed
func NewDtoPageJob() *DtoPageJob {
this := DtoPageJob{}
return &this
}
// NewDtoPageJobWithDefaults instantiates a new DtoPageJob object
// This constructor will only assign default values to properties that have it defined,
// but it doesn't guarantee that properties required by API are set
func NewDtoPageJobWithDefaults() *DtoPageJob {
this := DtoPageJob{}
return &this
}
// GetItems returns the Items field value if set, zero value otherwise.
func (o *DtoPageJob) GetItems() []DtoJob {
if o == nil || IsNil(o.Items) {
var ret []DtoJob
return ret
}
return o.Items
}
// GetItemsOk returns a tuple with the Items field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *DtoPageJob) GetItemsOk() ([]DtoJob, bool) {
if o == nil || IsNil(o.Items) {
return nil, false
}
return o.Items, true
}
// HasItems returns a boolean if a field has been set.
func (o *DtoPageJob) HasItems() bool {
if o != nil && !IsNil(o.Items) {
return true
}
return false
}
// SetItems gets a reference to the given []DtoJob and assigns it to the Items field.
func (o *DtoPageJob) SetItems(v []DtoJob) {
o.Items = v
}
// GetPage returns the Page field value if set, zero value otherwise.
func (o *DtoPageJob) GetPage() int32 {
if o == nil || IsNil(o.Page) {
var ret int32
return ret
}
return *o.Page
}
// GetPageOk returns a tuple with the Page field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *DtoPageJob) GetPageOk() (*int32, bool) {
if o == nil || IsNil(o.Page) {
return nil, false
}
return o.Page, true
}
// HasPage returns a boolean if a field has been set.
func (o *DtoPageJob) HasPage() bool {
if o != nil && !IsNil(o.Page) {
return true
}
return false
}
// SetPage gets a reference to the given int32 and assigns it to the Page field.
func (o *DtoPageJob) SetPage(v int32) {
o.Page = &v
}
// GetPageSize returns the PageSize field value if set, zero value otherwise.
func (o *DtoPageJob) GetPageSize() int32 {
if o == nil || IsNil(o.PageSize) {
var ret int32
return ret
}
return *o.PageSize
}
// GetPageSizeOk returns a tuple with the PageSize field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *DtoPageJob) GetPageSizeOk() (*int32, bool) {
if o == nil || IsNil(o.PageSize) {
return nil, false
}
return o.PageSize, true
}
// HasPageSize returns a boolean if a field has been set.
func (o *DtoPageJob) HasPageSize() bool {
if o != nil && !IsNil(o.PageSize) {
return true
}
return false
}
// SetPageSize gets a reference to the given int32 and assigns it to the PageSize field.
func (o *DtoPageJob) SetPageSize(v int32) {
o.PageSize = &v
}
// GetTotal returns the Total field value if set, zero value otherwise.
func (o *DtoPageJob) GetTotal() int32 {
if o == nil || IsNil(o.Total) {
var ret int32
return ret
}
return *o.Total
}
// GetTotalOk returns a tuple with the Total field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *DtoPageJob) GetTotalOk() (*int32, bool) {
if o == nil || IsNil(o.Total) {
return nil, false
}
return o.Total, true
}
// HasTotal returns a boolean if a field has been set.
func (o *DtoPageJob) HasTotal() bool {
if o != nil && !IsNil(o.Total) {
return true
}
return false
}
// SetTotal gets a reference to the given int32 and assigns it to the Total field.
func (o *DtoPageJob) SetTotal(v int32) {
o.Total = &v
}
func (o DtoPageJob) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o DtoPageJob) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.Items) {
toSerialize["items"] = o.Items
}
if !IsNil(o.Page) {
toSerialize["page"] = o.Page
}
if !IsNil(o.PageSize) {
toSerialize["page_size"] = o.PageSize
}
if !IsNil(o.Total) {
toSerialize["total"] = o.Total
}
return toSerialize, nil
}
type NullableDtoPageJob struct {
value *DtoPageJob
isSet bool
}
func (v NullableDtoPageJob) Get() *DtoPageJob {
return v.value
}
func (v *NullableDtoPageJob) Set(val *DtoPageJob) {
v.value = val
v.isSet = true
}
func (v NullableDtoPageJob) IsSet() bool {
return v.isSet
}
func (v *NullableDtoPageJob) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableDtoPageJob(val *DtoPageJob) *NullableDtoPageJob {
return &NullableDtoPageJob{value: val, isSet: true}
}
func (v NullableDtoPageJob) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableDtoPageJob) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}

View File

@@ -0,0 +1,273 @@
/*
AutoGlue API
API for managing K3s clusters across cloud providers
API version: 1.0
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
package autoglue
import (
"encoding/json"
)
// checks if the DtoQueueInfo type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &DtoQueueInfo{}
// DtoQueueInfo struct for DtoQueueInfo
type DtoQueueInfo struct {
// example: 5
Failed *int32 `json:"failed,omitempty"`
// example: default
Name *string `json:"name,omitempty"`
// example: 42
Pending *int32 `json:"pending,omitempty"`
// example: 3
Running *int32 `json:"running,omitempty"`
// example: 7
Scheduled *int32 `json:"scheduled,omitempty"`
}
// NewDtoQueueInfo instantiates a new DtoQueueInfo object
// This constructor will assign default values to properties that have it defined,
// and makes sure properties required by API are set, but the set of arguments
// will change when the set of required properties is changed
func NewDtoQueueInfo() *DtoQueueInfo {
this := DtoQueueInfo{}
return &this
}
// NewDtoQueueInfoWithDefaults instantiates a new DtoQueueInfo object
// This constructor will only assign default values to properties that have it defined,
// but it doesn't guarantee that properties required by API are set
func NewDtoQueueInfoWithDefaults() *DtoQueueInfo {
this := DtoQueueInfo{}
return &this
}
// GetFailed returns the Failed field value if set, zero value otherwise.
func (o *DtoQueueInfo) GetFailed() int32 {
if o == nil || IsNil(o.Failed) {
var ret int32
return ret
}
return *o.Failed
}
// GetFailedOk returns a tuple with the Failed field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *DtoQueueInfo) GetFailedOk() (*int32, bool) {
if o == nil || IsNil(o.Failed) {
return nil, false
}
return o.Failed, true
}
// HasFailed returns a boolean if a field has been set.
func (o *DtoQueueInfo) HasFailed() bool {
if o != nil && !IsNil(o.Failed) {
return true
}
return false
}
// SetFailed gets a reference to the given int32 and assigns it to the Failed field.
func (o *DtoQueueInfo) SetFailed(v int32) {
o.Failed = &v
}
// GetName returns the Name field value if set, zero value otherwise.
func (o *DtoQueueInfo) 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 *DtoQueueInfo) 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 *DtoQueueInfo) 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 *DtoQueueInfo) SetName(v string) {
o.Name = &v
}
// GetPending returns the Pending field value if set, zero value otherwise.
func (o *DtoQueueInfo) GetPending() int32 {
if o == nil || IsNil(o.Pending) {
var ret int32
return ret
}
return *o.Pending
}
// GetPendingOk returns a tuple with the Pending field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *DtoQueueInfo) GetPendingOk() (*int32, bool) {
if o == nil || IsNil(o.Pending) {
return nil, false
}
return o.Pending, true
}
// HasPending returns a boolean if a field has been set.
func (o *DtoQueueInfo) HasPending() bool {
if o != nil && !IsNil(o.Pending) {
return true
}
return false
}
// SetPending gets a reference to the given int32 and assigns it to the Pending field.
func (o *DtoQueueInfo) SetPending(v int32) {
o.Pending = &v
}
// GetRunning returns the Running field value if set, zero value otherwise.
func (o *DtoQueueInfo) GetRunning() int32 {
if o == nil || IsNil(o.Running) {
var ret int32
return ret
}
return *o.Running
}
// GetRunningOk returns a tuple with the Running field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *DtoQueueInfo) GetRunningOk() (*int32, bool) {
if o == nil || IsNil(o.Running) {
return nil, false
}
return o.Running, true
}
// HasRunning returns a boolean if a field has been set.
func (o *DtoQueueInfo) HasRunning() bool {
if o != nil && !IsNil(o.Running) {
return true
}
return false
}
// SetRunning gets a reference to the given int32 and assigns it to the Running field.
func (o *DtoQueueInfo) SetRunning(v int32) {
o.Running = &v
}
// GetScheduled returns the Scheduled field value if set, zero value otherwise.
func (o *DtoQueueInfo) GetScheduled() int32 {
if o == nil || IsNil(o.Scheduled) {
var ret int32
return ret
}
return *o.Scheduled
}
// GetScheduledOk returns a tuple with the Scheduled field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *DtoQueueInfo) GetScheduledOk() (*int32, bool) {
if o == nil || IsNil(o.Scheduled) {
return nil, false
}
return o.Scheduled, true
}
// HasScheduled returns a boolean if a field has been set.
func (o *DtoQueueInfo) HasScheduled() bool {
if o != nil && !IsNil(o.Scheduled) {
return true
}
return false
}
// SetScheduled gets a reference to the given int32 and assigns it to the Scheduled field.
func (o *DtoQueueInfo) SetScheduled(v int32) {
o.Scheduled = &v
}
func (o DtoQueueInfo) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o DtoQueueInfo) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.Failed) {
toSerialize["failed"] = o.Failed
}
if !IsNil(o.Name) {
toSerialize["name"] = o.Name
}
if !IsNil(o.Pending) {
toSerialize["pending"] = o.Pending
}
if !IsNil(o.Running) {
toSerialize["running"] = o.Running
}
if !IsNil(o.Scheduled) {
toSerialize["scheduled"] = o.Scheduled
}
return toSerialize, nil
}
type NullableDtoQueueInfo struct {
value *DtoQueueInfo
isSet bool
}
func (v NullableDtoQueueInfo) Get() *DtoQueueInfo {
return v.value
}
func (v *NullableDtoQueueInfo) Set(val *DtoQueueInfo) {
v.value = val
v.isSet = true
}
func (v NullableDtoQueueInfo) IsSet() bool {
return v.isSet
}
func (v *NullableDtoQueueInfo) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableDtoQueueInfo(val *DtoQueueInfo) *NullableDtoQueueInfo {
return &NullableDtoQueueInfo{value: val, isSet: true}
}
func (v NullableDtoQueueInfo) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableDtoQueueInfo) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}

View File

@@ -0,0 +1,160 @@
/*
AutoGlue API
API for managing K3s clusters across cloud providers
API version: 1.0
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
package autoglue
import (
"encoding/json"
)
// checks if the DtoUpdateAnnotationRequest type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &DtoUpdateAnnotationRequest{}
// DtoUpdateAnnotationRequest struct for DtoUpdateAnnotationRequest
type DtoUpdateAnnotationRequest struct {
Key *string `json:"key,omitempty"`
Value *string `json:"value,omitempty"`
}
// NewDtoUpdateAnnotationRequest instantiates a new DtoUpdateAnnotationRequest object
// This constructor will assign default values to properties that have it defined,
// and makes sure properties required by API are set, but the set of arguments
// will change when the set of required properties is changed
func NewDtoUpdateAnnotationRequest() *DtoUpdateAnnotationRequest {
this := DtoUpdateAnnotationRequest{}
return &this
}
// NewDtoUpdateAnnotationRequestWithDefaults instantiates a new DtoUpdateAnnotationRequest object
// This constructor will only assign default values to properties that have it defined,
// but it doesn't guarantee that properties required by API are set
func NewDtoUpdateAnnotationRequestWithDefaults() *DtoUpdateAnnotationRequest {
this := DtoUpdateAnnotationRequest{}
return &this
}
// GetKey returns the Key field value if set, zero value otherwise.
func (o *DtoUpdateAnnotationRequest) 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 *DtoUpdateAnnotationRequest) 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 *DtoUpdateAnnotationRequest) 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 *DtoUpdateAnnotationRequest) SetKey(v string) {
o.Key = &v
}
// GetValue returns the Value field value if set, zero value otherwise.
func (o *DtoUpdateAnnotationRequest) GetValue() string {
if o == nil || IsNil(o.Value) {
var ret string
return ret
}
return *o.Value
}
// GetValueOk returns a tuple with the Value field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *DtoUpdateAnnotationRequest) GetValueOk() (*string, bool) {
if o == nil || IsNil(o.Value) {
return nil, false
}
return o.Value, true
}
// HasValue returns a boolean if a field has been set.
func (o *DtoUpdateAnnotationRequest) HasValue() bool {
if o != nil && !IsNil(o.Value) {
return true
}
return false
}
// SetValue gets a reference to the given string and assigns it to the Value field.
func (o *DtoUpdateAnnotationRequest) SetValue(v string) {
o.Value = &v
}
func (o DtoUpdateAnnotationRequest) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o DtoUpdateAnnotationRequest) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.Key) {
toSerialize["key"] = o.Key
}
if !IsNil(o.Value) {
toSerialize["value"] = o.Value
}
return toSerialize, nil
}
type NullableDtoUpdateAnnotationRequest struct {
value *DtoUpdateAnnotationRequest
isSet bool
}
func (v NullableDtoUpdateAnnotationRequest) Get() *DtoUpdateAnnotationRequest {
return v.value
}
func (v *NullableDtoUpdateAnnotationRequest) Set(val *DtoUpdateAnnotationRequest) {
v.value = val
v.isSet = true
}
func (v NullableDtoUpdateAnnotationRequest) IsSet() bool {
return v.isSet
}
func (v *NullableDtoUpdateAnnotationRequest) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableDtoUpdateAnnotationRequest(val *DtoUpdateAnnotationRequest) *NullableDtoUpdateAnnotationRequest {
return &NullableDtoUpdateAnnotationRequest{value: val, isSet: true}
}
func (v NullableDtoUpdateAnnotationRequest) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableDtoUpdateAnnotationRequest) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}

View File

@@ -26,6 +26,7 @@ type HandlersMeResponse struct {
Emails []ModelsUserEmail `json:"emails,omitempty"`
// example: 3fa85f64-5717-4562-b3fc-2c963f66afa6
Id *string `json:"id,omitempty"`
IsAdmin *bool `json:"is_admin,omitempty"`
IsDisabled *bool `json:"is_disabled,omitempty"`
Organizations []ModelsOrganization `json:"organizations,omitempty"`
PrimaryEmail *string `json:"primary_email,omitempty"`
@@ -209,6 +210,38 @@ func (o *HandlersMeResponse) SetId(v string) {
o.Id = &v
}
// GetIsAdmin returns the IsAdmin field value if set, zero value otherwise.
func (o *HandlersMeResponse) GetIsAdmin() bool {
if o == nil || IsNil(o.IsAdmin) {
var ret bool
return ret
}
return *o.IsAdmin
}
// GetIsAdminOk returns a tuple with the IsAdmin field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *HandlersMeResponse) GetIsAdminOk() (*bool, bool) {
if o == nil || IsNil(o.IsAdmin) {
return nil, false
}
return o.IsAdmin, true
}
// HasIsAdmin returns a boolean if a field has been set.
func (o *HandlersMeResponse) HasIsAdmin() bool {
if o != nil && !IsNil(o.IsAdmin) {
return true
}
return false
}
// SetIsAdmin gets a reference to the given bool and assigns it to the IsAdmin field.
func (o *HandlersMeResponse) SetIsAdmin(v bool) {
o.IsAdmin = &v
}
// GetIsDisabled returns the IsDisabled field value if set, zero value otherwise.
func (o *HandlersMeResponse) GetIsDisabled() bool {
if o == nil || IsNil(o.IsDisabled) {
@@ -362,6 +395,9 @@ func (o HandlersMeResponse) ToMap() (map[string]interface{}, error) {
if !IsNil(o.Id) {
toSerialize["id"] = o.Id
}
if !IsNil(o.IsAdmin) {
toSerialize["is_admin"] = o.IsAdmin
}
if !IsNil(o.IsDisabled) {
toSerialize["is_disabled"] = o.IsDisabled
}

View File

@@ -25,6 +25,7 @@ type ModelsUser struct {
DisplayName *string `json:"display_name,omitempty"`
// example: 3fa85f64-5717-4562-b3fc-2c963f66afa6
Id *string `json:"id,omitempty"`
IsAdmin *bool `json:"is_admin,omitempty"`
IsDisabled *bool `json:"is_disabled,omitempty"`
PrimaryEmail *string `json:"primary_email,omitempty"`
UpdatedAt *time.Time `json:"updated_at,omitempty"`
@@ -175,6 +176,38 @@ func (o *ModelsUser) SetId(v string) {
o.Id = &v
}
// GetIsAdmin returns the IsAdmin field value if set, zero value otherwise.
func (o *ModelsUser) GetIsAdmin() bool {
if o == nil || IsNil(o.IsAdmin) {
var ret bool
return ret
}
return *o.IsAdmin
}
// GetIsAdminOk returns a tuple with the IsAdmin field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *ModelsUser) GetIsAdminOk() (*bool, bool) {
if o == nil || IsNil(o.IsAdmin) {
return nil, false
}
return o.IsAdmin, true
}
// HasIsAdmin returns a boolean if a field has been set.
func (o *ModelsUser) HasIsAdmin() bool {
if o != nil && !IsNil(o.IsAdmin) {
return true
}
return false
}
// SetIsAdmin gets a reference to the given bool and assigns it to the IsAdmin field.
func (o *ModelsUser) SetIsAdmin(v bool) {
o.IsAdmin = &v
}
// GetIsDisabled returns the IsDisabled field value if set, zero value otherwise.
func (o *ModelsUser) GetIsDisabled() bool {
if o == nil || IsNil(o.IsDisabled) {
@@ -293,6 +326,9 @@ func (o ModelsUser) ToMap() (map[string]interface{}, error) {
if !IsNil(o.Id) {
toSerialize["id"] = o.Id
}
if !IsNil(o.IsAdmin) {
toSerialize["is_admin"] = o.IsAdmin
}
if !IsNil(o.IsDisabled) {
toSerialize["is_disabled"] = o.IsDisabled
}

View File

@@ -22,6 +22,32 @@ func Test_autoglue_AnnotationsAPIService(t *testing.T) {
configuration := openapiclient.NewConfiguration()
apiClient := openapiclient.NewAPIClient(configuration)
t.Run("Test AnnotationsAPIService CreateAnnotation", func(t *testing.T) {
t.Skip("skip test") // remove to run test
resp, httpRes, err := apiClient.AnnotationsAPI.CreateAnnotation(context.Background()).Execute()
require.Nil(t, err)
require.NotNil(t, resp)
assert.Equal(t, 200, httpRes.StatusCode)
})
t.Run("Test AnnotationsAPIService DeleteAnnotation", func(t *testing.T) {
t.Skip("skip test") // remove to run test
var id string
resp, httpRes, err := apiClient.AnnotationsAPI.DeleteAnnotation(context.Background(), id).Execute()
require.Nil(t, err)
require.NotNil(t, resp)
assert.Equal(t, 200, httpRes.StatusCode)
})
t.Run("Test AnnotationsAPIService GetAnnotation", func(t *testing.T) {
t.Skip("skip test") // remove to run test
@@ -48,4 +74,18 @@ func Test_autoglue_AnnotationsAPIService(t *testing.T) {
})
t.Run("Test AnnotationsAPIService UpdateAnnotation", func(t *testing.T) {
t.Skip("skip test") // remove to run test
var id string
resp, httpRes, err := apiClient.AnnotationsAPI.UpdateAnnotation(context.Background(), id).Execute()
require.Nil(t, err)
require.NotNil(t, resp)
assert.Equal(t, 200, httpRes.StatusCode)
})
}

View File

@@ -0,0 +1,89 @@
/*
AutoGlue API
Testing ArcherAdminAPIService
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech);
package autoglue
import (
"context"
openapiclient "github.com/glueops/autoglue-sdk-go"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"testing"
)
func Test_autoglue_ArcherAdminAPIService(t *testing.T) {
configuration := openapiclient.NewConfiguration()
apiClient := openapiclient.NewAPIClient(configuration)
t.Run("Test ArcherAdminAPIService AdminCancelArcherJob", func(t *testing.T) {
t.Skip("skip test") // remove to run test
var id string
resp, httpRes, err := apiClient.ArcherAdminAPI.AdminCancelArcherJob(context.Background(), id).Execute()
require.Nil(t, err)
require.NotNil(t, resp)
assert.Equal(t, 200, httpRes.StatusCode)
})
t.Run("Test ArcherAdminAPIService AdminEnqueueArcherJob", func(t *testing.T) {
t.Skip("skip test") // remove to run test
resp, httpRes, err := apiClient.ArcherAdminAPI.AdminEnqueueArcherJob(context.Background()).Execute()
require.Nil(t, err)
require.NotNil(t, resp)
assert.Equal(t, 200, httpRes.StatusCode)
})
t.Run("Test ArcherAdminAPIService AdminListArcherJobs", func(t *testing.T) {
t.Skip("skip test") // remove to run test
resp, httpRes, err := apiClient.ArcherAdminAPI.AdminListArcherJobs(context.Background()).Execute()
require.Nil(t, err)
require.NotNil(t, resp)
assert.Equal(t, 200, httpRes.StatusCode)
})
t.Run("Test ArcherAdminAPIService AdminListArcherQueues", func(t *testing.T) {
t.Skip("skip test") // remove to run test
resp, httpRes, err := apiClient.ArcherAdminAPI.AdminListArcherQueues(context.Background()).Execute()
require.Nil(t, err)
require.NotNil(t, resp)
assert.Equal(t, 200, httpRes.StatusCode)
})
t.Run("Test ArcherAdminAPIService AdminRetryArcherJob", func(t *testing.T) {
t.Skip("skip test") // remove to run test
var id string
resp, httpRes, err := apiClient.ArcherAdminAPI.AdminRetryArcherJob(context.Background(), id).Execute()
require.Nil(t, err)
require.NotNil(t, resp)
assert.Equal(t, 200, httpRes.StatusCode)
})
}