From a317a1a16c6460a91550ac31ea05f50b4c88275a Mon Sep 17 00:00:00 2001 From: speakeasybot Date: Wed, 2 Oct 2024 03:02:01 +0000 Subject: [PATCH] ci: regenerated with OpenAPI Doc , Speakeasy CLI 1.405.6 --- .speakeasy/gen.lock | 32 ++++++------ .speakeasy/gen.yaml | 2 +- .speakeasy/workflow.lock | 10 ++-- README.md | 10 ++-- RELEASES.md | 12 ++++- cipherswarmagentsdk.go | 6 +-- docs/models/components/agent.md | 2 +- .../operations/updateagentrequestbody.md | 2 +- docs/models/sdkerrors/errorobject.md | 2 - docs/sdks/agents/README.md | 37 ++++++-------- docs/sdks/attacks/README.md | 11 ++-- docs/sdks/client/README.md | 9 ++-- docs/sdks/crackers/README.md | 4 +- docs/sdks/tasks/README.md | 51 ++++++++----------- go.mod | 2 +- go.sum | 4 +- models/components/agent.go | 6 +-- models/operations/updateagent.go | 6 +-- models/sdkerrors/errorobject.go | 1 - 19 files changed, 103 insertions(+), 106 deletions(-) diff --git a/.speakeasy/gen.lock b/.speakeasy/gen.lock index 6e67416..e2babc7 100755 --- a/.speakeasy/gen.lock +++ b/.speakeasy/gen.lock @@ -1,19 +1,19 @@ lockVersion: 2.0.0 id: 11fa8266-8454-49fd-ba7b-d5f8744980cc management: - docChecksum: c77abf90c6133eb42b34c8f1cebf6a14 + docChecksum: 80bec64634a58ec3b0bd964a9c6c93aa docVersion: "1.3" - speakeasyVersion: 1.400.1 - generationVersion: 2.420.2 - releaseVersion: 0.8.4 - configChecksum: cf0336461325480916f9ea69c9b17c8c + speakeasyVersion: 1.405.6 + generationVersion: 2.428.1 + releaseVersion: 0.8.5 + configChecksum: da8775756c935932081875da2f426f58 repoURL: https://github.com/unclesp1d3r/cipherswarm-agent-sdk-go.git installationURL: https://github.com/unclesp1d3r/cipherswarm-agent-sdk-go features: go: additionalDependencies: 0.1.0 constsAndDefaults: 0.1.6 - core: 3.5.9 + core: 3.5.12 defaultEnabledRetries: 0.2.0 downloadStreams: 0.1.2 envVarSecurityUsage: 0.3.1 @@ -166,7 +166,7 @@ examples: id: 135003 responses: "200": - application/json: {"id": 94, "name": "ratke-bode", "client_signature": "Linux, ArchLinux 2022.08.05", "state": "pending", "operating_system": "linux", "devices": ["cpu", "GPU"], "advanced_configuration": {"agent_update_interval": 46, "use_native_hashcat": false, "backend_device": null, "opencl_devices": null, "enable_additional_hash_types": false}} + application/json: {"id": 2571, "host_name": "weissnat", "client_signature": "macOS, High Sierra (10.13)", "state": "active", "operating_system": "linux", "devices": ["cpu", "GPU"], "advanced_configuration": {"agent_update_interval": 36, "use_native_hashcat": false, "backend_device": null, "opencl_devices": null, "enable_additional_hash_types": false}} "401": application/json: {"error": "Bad credentials"} updateAgent: @@ -175,10 +175,10 @@ examples: path: id: 828119 requestBody: - application/json: {"id": 96, "name": "effertz-frami", "client_signature": "Plan 9, Plan 9 Fourth Edition", "operating_system": "linux", "devices": ["cpu", "GPU"]} + application/json: {"id": 2573, "host_name": "stoltenberg", "client_signature": "Linux, RHEL 6.10", "operating_system": "linux", "devices": ["cpu", "GPU"]} responses: "200": - application/json: {"id": 912003, "name": "", "client_signature": "", "state": "error", "operating_system": "", "devices": ["", "", ""], "advanced_configuration": {"agent_update_interval": 666222, "use_native_hashcat": true, "backend_device": "", "enable_additional_hash_types": false}} + application/json: {"id": 912003, "host_name": "surprised-thyme.net", "client_signature": "", "state": "error", "operating_system": "", "devices": ["", "", ""], "advanced_configuration": {"agent_update_interval": 666222, "use_native_hashcat": true, "backend_device": "", "enable_additional_hash_types": false}} "401": {} test_example: parameters: @@ -186,7 +186,7 @@ examples: id: 182255 responses: "200": - application/json: {"id": 96, "name": "effertz-frami", "client_signature": "Plan 9, Plan 9 Fourth Edition", "state": "pending", "operating_system": "linux", "devices": ["cpu", "GPU"], "advanced_configuration": {"agent_update_interval": 42, "use_native_hashcat": false, "backend_device": null, "opencl_devices": null, "enable_additional_hash_types": false}} + application/json: {"id": 2573, "host_name": "stoltenberg", "client_signature": "Linux, RHEL 6.10", "state": "active", "operating_system": "linux", "devices": ["cpu", "GPU"], "advanced_configuration": {"agent_update_interval": 24, "use_native_hashcat": false, "backend_device": null, "opencl_devices": null, "enable_additional_hash_types": false}} "401": application/json: {"error": "Bad credentials"} sendHeartbeat: @@ -232,7 +232,7 @@ examples: id: 535539 responses: "200": - application/json: {"id": 47, "attack_mode": "dictionary", "attack_mode_hashcat": 0, "mask": "", "increment_mode": false, "increment_minimum": 0, "increment_maximum": 0, "optimized": true, "slow_candidate_generators": false, "workload_profile": 3, "disable_markov": false, "classic_markov": false, "markov_threshold": 0, "left_rule": "", "right_rule": "", "custom_charset_1": "", "custom_charset_2": "", "custom_charset_3": "", "custom_charset_4": "", "hash_list_id": 64, "word_list": {"id": 54, "download_url": "http://www.example.com/rails/active_storage/blobs/redirect/eyJfcmFpbHMiOnsiZGF0YSI6MTQwLCJwdXIiOiJibG9iX2lkIn19--9b15f11a378659093028a10c5635001456dbec0e/top-passwords.txt", "checksum": "vL58BUq0+tAQjqHwejEh8A==", "file_name": "top-passwords.txt"}, "rule_list": null, "mask_list": null, "hash_mode": 0, "hash_list_url": "http://www.example.com/api/v1/client/attacks/47/hash_list", "hash_list_checksum": "1B2M2Y8AsgTpgAmY7PhCfg==", "url": "http://www.example.com/campaigns/47/attacks/47.json"} + application/json: {"id": 1000, "attack_mode": "dictionary", "attack_mode_hashcat": 0, "mask": "", "increment_mode": false, "increment_minimum": 0, "increment_maximum": 0, "optimized": true, "slow_candidate_generators": false, "workload_profile": 3, "disable_markov": false, "classic_markov": false, "markov_threshold": 0, "left_rule": "", "right_rule": "", "custom_charset_1": "", "custom_charset_2": "", "custom_charset_3": "", "custom_charset_4": "", "hash_list_id": 1807, "word_list": {"id": 2560, "download_url": "http://www.example.com/rails/active_storage/blobs/redirect/eyJfcmFpbHMiOnsiZGF0YSI6NzcxMiwicHVyIjoiYmxvYl9pZCJ9fQ==--9584213bf1b3bcc2b08814da1a2ccbcec5d76f09/top-passwords.txt", "checksum": "vL58BUq0+tAQjqHwejEh8A==", "file_name": "top-passwords.txt"}, "rule_list": null, "mask_list": null, "hash_mode": 0, "hash_list_url": "http://www.example.com/api/v1/client/attacks/1000/hash_list", "hash_list_checksum": "1B2M2Y8AsgTpgAmY7PhCfg==", "url": "http://www.example.com/campaigns/1000/attacks/1000.json"} "401": application/json: {"error": "Attack not found."} getHashList: @@ -254,7 +254,7 @@ examples: test_example: responses: "200": - application/json: {"id": 50, "attack_id": 50, "start_date": "2024-08-25T21:36:03.829-04:00", "status": "pending", "skip": 0, "limit": 0} + application/json: {"id": 802, "attack_id": 1003, "start_date": "2024-10-01T21:16:42.896-04:00", "status": "pending", "skip": 0, "limit": 0} "401": application/json: {"error": "Bad credentials"} getTask: @@ -264,7 +264,7 @@ examples: id: 771489 responses: "200": - application/json: {"id": 51, "attack_id": 51, "start_date": "2024-08-24T23:09:45.984-04:00", "status": "pending", "skip": 0, "limit": 0} + application/json: {"id": 803, "attack_id": 1004, "start_date": "2024-10-01T09:13:42.205-04:00", "status": "pending", "skip": 0, "limit": 0} "401": application/json: {"error": "Record not found"} sendCrack: @@ -273,7 +273,7 @@ examples: path: id: 302642 requestBody: - application/json: {"timestamp": "2024-08-25T21:36:04.134-04:00", "hash": "dummy_hash_2", "plain_text": "dummy_plain"} + application/json: {"timestamp": "2024-10-01T21:16:43.171-04:00", "hash": "dummy_hash_2", "plain_text": "dummy_plain"} test_example: parameters: path: @@ -329,13 +329,13 @@ examples: test_example: responses: "200": - application/json: {"config": {"agent_update_interval": 52, "use_native_hashcat": false, "backend_device": null, "opencl_devices": null, "enable_additional_hash_types": false}, "api_version": 1} + application/json: {"config": {"agent_update_interval": 49, "use_native_hashcat": false, "backend_device": null, "opencl_devices": null, "enable_additional_hash_types": false}, "api_version": 1} "401": application/json: {"error": "Bad credentials"} authenticate: test_example: responses: "200": - application/json: {"authenticated": true, "agent_id": 148} + application/json: {"authenticated": true, "agent_id": 2624} "401": application/json: {"error": "Bad credentials"} diff --git a/.speakeasy/gen.yaml b/.speakeasy/gen.yaml index 2b25051..44c8f1e 100755 --- a/.speakeasy/gen.yaml +++ b/.speakeasy/gen.yaml @@ -12,7 +12,7 @@ generation: auth: oAuth2ClientCredentialsEnabled: false go: - version: 0.8.4 + version: 0.8.5 additionalDependencies: {} allowUnknownFieldsInWeakUnions: false clientServerStatusCodesAsErrors: true diff --git a/.speakeasy/workflow.lock b/.speakeasy/workflow.lock index a80e67d..11c07e3 100644 --- a/.speakeasy/workflow.lock +++ b/.speakeasy/workflow.lock @@ -1,9 +1,9 @@ -speakeasyVersion: 1.400.1 +speakeasyVersion: 1.405.6 sources: CipherSwarm_agent_api: sourceNamespace: cipher-swarm-agent-api - sourceRevisionDigest: sha256:f9787ad737cfb6a94a7230bcfabc8f5edd188432525efd4b67ddc7bb8f1a0e2e - sourceBlobDigest: sha256:93c3f31880777a5d06b7df353d9dffb8066729999e96794680edd65284d8c216 + sourceRevisionDigest: sha256:6177f29fa2a1b6650a8cc068e7c18805e5357b578c9642bcd555ccb1d6a425a3 + sourceBlobDigest: sha256:da9d36e24d7d4937a832076a8683c8b680020db5ade075e05a5cd0931ce380f5 tags: - latest - main @@ -11,8 +11,8 @@ targets: golang-sdk: source: CipherSwarm_agent_api sourceNamespace: cipher-swarm-agent-api - sourceRevisionDigest: sha256:f9787ad737cfb6a94a7230bcfabc8f5edd188432525efd4b67ddc7bb8f1a0e2e - sourceBlobDigest: sha256:93c3f31880777a5d06b7df353d9dffb8066729999e96794680edd65284d8c216 + sourceRevisionDigest: sha256:6177f29fa2a1b6650a8cc068e7c18805e5357b578c9642bcd555ccb1d6a425a3 + sourceBlobDigest: sha256:da9d36e24d7d4937a832076a8683c8b680020db5ade075e05a5cd0931ce380f5 workflow: workflowVersion: 1.0.0 speakeasyVersion: latest diff --git a/README.md b/README.md index 530c8ad..eff8eaf 100644 --- a/README.md +++ b/README.md @@ -128,12 +128,16 @@ func main() { ## Error Handling -Handling errors in this SDK should largely match your expectations. All operations return a response object or an error, they will never return both. When specified by the OpenAPI spec document, the SDK will return the appropriate subclass. +Handling errors in this SDK should largely match your expectations. All operations return a response object or an error, they will never return both. -| Error Object | Status Code | Content Type | +By Default, an API error will return `sdkerrors.SDKError`. When custom error responses are specified for an operation, the SDK may also return their associated error. You can refer to respective *Errors* tables in SDK docs for more details on possible error types for each operation. + +For example, the `GetAgent` function may return the following errors: + +| Error Type | Status Code | Content Type | | --------------------- | --------------------- | --------------------- | | sdkerrors.ErrorObject | 401 | application/json | -| sdkerrors.SDKError | 4xx-5xx | */* | +| sdkerrors.SDKError | 4XX, 5XX | \*/\* | ### Example diff --git a/RELEASES.md b/RELEASES.md index d772667..7cef965 100644 --- a/RELEASES.md +++ b/RELEASES.md @@ -278,4 +278,14 @@ Based on: ### Generated - [go v0.8.4] . ### Releases -- [Go v0.8.4] https://github.com/unclesp1d3r/cipherswarm-agent-sdk-go/releases/tag/v0.8.4 - . \ No newline at end of file +- [Go v0.8.4] https://github.com/unclesp1d3r/cipherswarm-agent-sdk-go/releases/tag/v0.8.4 - . + +## 2024-10-02 03:01:05 +### Changes +Based on: +- OpenAPI Doc +- Speakeasy CLI 1.405.6 (2.428.1) https://github.com/speakeasy-api/speakeasy +### Generated +- [go v0.8.5] . +### Releases +- [Go v0.8.5] https://github.com/unclesp1d3r/cipherswarm-agent-sdk-go/releases/tag/v0.8.5 - . \ No newline at end of file diff --git a/cipherswarmagentsdk.go b/cipherswarmagentsdk.go index 6468f44..6cd6442 100644 --- a/cipherswarmagentsdk.go +++ b/cipherswarmagentsdk.go @@ -200,9 +200,9 @@ func New(opts ...SDKOption) *CipherSwarmAgentSDK { sdkConfiguration: sdkConfiguration{ Language: "go", OpenAPIDocVersion: "1.3", - SDKVersion: "0.8.4", - GenVersion: "2.420.2", - UserAgent: "speakeasy-sdk/go 0.8.4 2.420.2 1.3 github.com/unclesp1d3r/cipherswarm-agent-sdk-go", + SDKVersion: "0.8.5", + GenVersion: "2.428.1", + UserAgent: "speakeasy-sdk/go 0.8.5 2.428.1 1.3 github.com/unclesp1d3r/cipherswarm-agent-sdk-go", ServerDefaults: []map[string]string{ { "defaultHost": "www.example.com", diff --git a/docs/models/components/agent.md b/docs/models/components/agent.md index c41fa93..5563bf2 100644 --- a/docs/models/components/agent.md +++ b/docs/models/components/agent.md @@ -6,7 +6,7 @@ | Field | Type | Required | Description | | ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | | `ID` | *int64* | :heavy_check_mark: | The id of the agent | -| `Name` | *string* | :heavy_check_mark: | The hostname of the agent | +| `HostName` | *string* | :heavy_check_mark: | The hostname of the agent | | `ClientSignature` | *string* | :heavy_check_mark: | The signature of the client | | `State` | [components.State](../../models/components/state.md) | :heavy_check_mark: | The state of the agent | | `OperatingSystem` | *string* | :heavy_check_mark: | The operating system of the agent | diff --git a/docs/models/operations/updateagentrequestbody.md b/docs/models/operations/updateagentrequestbody.md index 821ecde..645b975 100644 --- a/docs/models/operations/updateagentrequestbody.md +++ b/docs/models/operations/updateagentrequestbody.md @@ -6,7 +6,7 @@ | Field | Type | Required | Description | | --------------------------------- | --------------------------------- | --------------------------------- | --------------------------------- | | `ID` | *int64* | :heavy_check_mark: | The id of the agent | -| `Name` | *string* | :heavy_check_mark: | The hostname of the agent | +| `HostName` | *string* | :heavy_check_mark: | The hostname of the agent | | `ClientSignature` | *string* | :heavy_check_mark: | The signature of the client | | `OperatingSystem` | *string* | :heavy_check_mark: | The operating system of the agent | | `Devices` | []*string* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/sdkerrors/errorobject.md b/docs/models/sdkerrors/errorobject.md index 37f22bd..42d73c0 100644 --- a/docs/models/sdkerrors/errorobject.md +++ b/docs/models/sdkerrors/errorobject.md @@ -1,7 +1,5 @@ # ErrorObject -Not authorized - ## Fields diff --git a/docs/sdks/agents/README.md b/docs/sdks/agents/README.md index 014d107..5716fc9 100644 --- a/docs/sdks/agents/README.md +++ b/docs/sdks/agents/README.md @@ -59,11 +59,10 @@ func main() { ### Errors -| Error Object | Status Code | Content Type | +| Error Type | Status Code | Content Type | | --------------------- | --------------------- | --------------------- | | sdkerrors.ErrorObject | 401 | application/json | -| sdkerrors.SDKError | 4xx-5xx | */* | - +| sdkerrors.SDKError | 4XX, 5XX | \*/\* | ## UpdateAgent @@ -88,9 +87,9 @@ func main() { ctx := context.Background() res, err := s.Agents.UpdateAgent(ctx, 828119, &operations.UpdateAgentRequestBody{ - ID: 96, - Name: "effertz-frami", - ClientSignature: "Plan 9, Plan 9 Fourth Edition", + ID: 2573, + HostName: "stoltenberg", + ClientSignature: "Linux, RHEL 6.10", OperatingSystem: "linux", Devices: []string{ "cpu", @@ -121,11 +120,10 @@ func main() { ### Errors -| Error Object | Status Code | Content Type | +| Error Type | Status Code | Content Type | | --------------------- | --------------------- | --------------------- | | sdkerrors.ErrorObject | 401 | application/json | -| sdkerrors.SDKError | 4xx-5xx | */* | - +| sdkerrors.SDKError | 4XX, 5XX | \*/\* | ## SendHeartbeat @@ -172,11 +170,10 @@ func main() { ### Errors -| Error Object | Status Code | Content Type | +| Error Type | Status Code | Content Type | | --------------------- | --------------------- | --------------------- | | sdkerrors.ErrorObject | 401 | application/json | -| sdkerrors.SDKError | 4xx-5xx | */* | - +| sdkerrors.SDKError | 4XX, 5XX | \*/\* | ## SubmitBenchmark @@ -235,11 +232,10 @@ func main() { ### Errors -| Error Object | Status Code | Content Type | +| Error Type | Status Code | Content Type | | --------------------- | --------------------- | --------------------- | -| sdkerrors.ErrorObject | 400,401 | application/json | -| sdkerrors.SDKError | 4xx-5xx | */* | - +| sdkerrors.ErrorObject | 400, 401 | application/json | +| sdkerrors.SDKError | 4XX, 5XX | \*/\* | ## SubmitErrorAgent @@ -287,11 +283,10 @@ func main() { ### Errors -| Error Object | Status Code | Content Type | +| Error Type | Status Code | Content Type | | --------------------- | --------------------- | --------------------- | | sdkerrors.ErrorObject | 401 | application/json | -| sdkerrors.SDKError | 4xx-5xx | */* | - +| sdkerrors.SDKError | 4XX, 5XX | \*/\* | ## SetAgentShutdown @@ -338,7 +333,7 @@ func main() { ### Errors -| Error Object | Status Code | Content Type | +| Error Type | Status Code | Content Type | | --------------------- | --------------------- | --------------------- | | sdkerrors.ErrorObject | 401 | application/json | -| sdkerrors.SDKError | 4xx-5xx | */* | +| sdkerrors.SDKError | 4XX, 5XX | \*/\* | \ No newline at end of file diff --git a/docs/sdks/attacks/README.md b/docs/sdks/attacks/README.md index 8300cf6..d54cf9e 100644 --- a/docs/sdks/attacks/README.md +++ b/docs/sdks/attacks/README.md @@ -55,11 +55,10 @@ func main() { ### Errors -| Error Object | Status Code | Content Type | +| Error Type | Status Code | Content Type | | --------------------- | --------------------- | --------------------- | -| sdkerrors.ErrorObject | 401,404 | application/json | -| sdkerrors.SDKError | 4xx-5xx | */* | - +| sdkerrors.ErrorObject | 401, 404 | application/json | +| sdkerrors.SDKError | 4XX, 5XX | \*/\* | ## GetHashList @@ -106,6 +105,6 @@ func main() { ### Errors -| Error Object | Status Code | Content Type | +| Error Type | Status Code | Content Type | | ------------------ | ------------------ | ------------------ | -| sdkerrors.SDKError | 4xx-5xx | */* | +| sdkerrors.SDKError | 4XX, 5XX | \*/\* | \ No newline at end of file diff --git a/docs/sdks/client/README.md b/docs/sdks/client/README.md index 0f53ed6..8ca9d2b 100644 --- a/docs/sdks/client/README.md +++ b/docs/sdks/client/README.md @@ -54,11 +54,10 @@ func main() { ### Errors -| Error Object | Status Code | Content Type | +| Error Type | Status Code | Content Type | | --------------------- | --------------------- | --------------------- | | sdkerrors.ErrorObject | 401 | application/json | -| sdkerrors.SDKError | 4xx-5xx | */* | - +| sdkerrors.SDKError | 4XX, 5XX | \*/\* | ## Authenticate @@ -104,7 +103,7 @@ func main() { ### Errors -| Error Object | Status Code | Content Type | +| Error Type | Status Code | Content Type | | --------------------- | --------------------- | --------------------- | | sdkerrors.ErrorObject | 401 | application/json | -| sdkerrors.SDKError | 4xx-5xx | */* | +| sdkerrors.SDKError | 4XX, 5XX | \*/\* | \ No newline at end of file diff --git a/docs/sdks/crackers/README.md b/docs/sdks/crackers/README.md index c73f89e..2bda043 100644 --- a/docs/sdks/crackers/README.md +++ b/docs/sdks/crackers/README.md @@ -55,7 +55,7 @@ func main() { ### Errors -| Error Object | Status Code | Content Type | +| Error Type | Status Code | Content Type | | --------------------- | --------------------- | --------------------- | | sdkerrors.ErrorObject | 400 | application/json | -| sdkerrors.SDKError | 4xx-5xx | */* | +| sdkerrors.SDKError | 4XX, 5XX | \*/\* | \ No newline at end of file diff --git a/docs/sdks/tasks/README.md b/docs/sdks/tasks/README.md index 3b14420..81d5849 100644 --- a/docs/sdks/tasks/README.md +++ b/docs/sdks/tasks/README.md @@ -60,11 +60,10 @@ func main() { ### Errors -| Error Object | Status Code | Content Type | +| Error Type | Status Code | Content Type | | --------------------- | --------------------- | --------------------- | | sdkerrors.ErrorObject | 401 | application/json | -| sdkerrors.SDKError | 4xx-5xx | */* | - +| sdkerrors.SDKError | 4XX, 5XX | \*/\* | ## GetTask @@ -111,11 +110,10 @@ func main() { ### Errors -| Error Object | Status Code | Content Type | +| Error Type | Status Code | Content Type | | --------------------- | --------------------- | --------------------- | -| sdkerrors.ErrorObject | 401,404 | application/json | -| sdkerrors.SDKError | 4xx-5xx | */* | - +| sdkerrors.ErrorObject | 401, 404 | application/json | +| sdkerrors.SDKError | 4XX, 5XX | \*/\* | ## SendCrack @@ -141,7 +139,7 @@ func main() { ctx := context.Background() res, err := s.Tasks.SendCrack(ctx, 302642, &components.HashcatResult{ - Timestamp: types.MustTimeFromString("2024-08-25T21:36:04.134-04:00"), + Timestamp: types.MustTimeFromString("2024-10-01T21:16:43.171-04:00"), Hash: "dummy_hash_2", PlainText: "dummy_plain", }) @@ -169,11 +167,10 @@ func main() { ### Errors -| Error Object | Status Code | Content Type | +| Error Type | Status Code | Content Type | | --------------------- | --------------------- | --------------------- | | sdkerrors.ErrorObject | 404 | application/json | -| sdkerrors.SDKError | 4xx-5xx | */* | - +| sdkerrors.SDKError | 4XX, 5XX | \*/\* | ## SendStatus @@ -285,11 +282,10 @@ func main() { ### Errors -| Error Object | Status Code | Content Type | +| Error Type | Status Code | Content Type | | --------------------- | --------------------- | --------------------- | -| sdkerrors.ErrorObject | 401,422 | application/json | -| sdkerrors.SDKError | 4xx-5xx | */* | - +| sdkerrors.ErrorObject | 401, 422 | application/json | +| sdkerrors.SDKError | 4XX, 5XX | \*/\* | ## SetTaskAccepted @@ -336,11 +332,10 @@ func main() { ### Errors -| Error Object | Status Code | Content Type | +| Error Type | Status Code | Content Type | | --------------------- | --------------------- | --------------------- | -| sdkerrors.ErrorObject | 404,422 | application/json | -| sdkerrors.SDKError | 4xx-5xx | */* | - +| sdkerrors.ErrorObject | 404, 422 | application/json | +| sdkerrors.SDKError | 4XX, 5XX | \*/\* | ## SetTaskExhausted @@ -387,11 +382,10 @@ func main() { ### Errors -| Error Object | Status Code | Content Type | +| Error Type | Status Code | Content Type | | --------------------- | --------------------- | --------------------- | -| sdkerrors.ErrorObject | 401,404 | application/json | -| sdkerrors.SDKError | 4xx-5xx | */* | - +| sdkerrors.ErrorObject | 401, 404 | application/json | +| sdkerrors.SDKError | 4XX, 5XX | \*/\* | ## SetTaskAbandoned @@ -438,12 +432,11 @@ func main() { ### Errors -| Error Object | Status Code | Content Type | +| Error Type | Status Code | Content Type | | -------------------------------------- | -------------------------------------- | -------------------------------------- | -| sdkerrors.ErrorObject | 401,404 | application/json | +| sdkerrors.ErrorObject | 401, 404 | application/json | | sdkerrors.SetTaskAbandonedResponseBody | 422 | application/json | -| sdkerrors.SDKError | 4xx-5xx | */* | - +| sdkerrors.SDKError | 4XX, 5XX | \*/\* | ## GetTaskZaps @@ -490,6 +483,6 @@ func main() { ### Errors -| Error Object | Status Code | Content Type | +| Error Type | Status Code | Content Type | | ------------------ | ------------------ | ------------------ | -| sdkerrors.SDKError | 4xx-5xx | */* | +| sdkerrors.SDKError | 4XX, 5XX | \*/\* | \ No newline at end of file diff --git a/go.mod b/go.mod index f58a844..565d11e 100644 --- a/go.mod +++ b/go.mod @@ -3,6 +3,6 @@ module github.com/unclesp1d3r/cipherswarm-agent-sdk-go go 1.20 require ( - github.com/cenkalti/backoff/v4 v4.3.0 + github.com/cenkalti/backoff/v4 v4.2.0 github.com/ericlagergren/decimal v0.0.0-20221120152707-495c53812d05 ) diff --git a/go.sum b/go.sum index f804a4f..f955779 100644 --- a/go.sum +++ b/go.sum @@ -1,4 +1,4 @@ -github.com/cenkalti/backoff/v4 v4.3.0 h1:MyRJ/UdXutAwSAT+s3wNd7MfTIcy71VQueUuFK343L8= -github.com/cenkalti/backoff/v4 v4.3.0/go.mod h1:Y3VNntkOUPxTVeUxJ/G5vcM//AlwfmyYozVcomhLiZE= +github.com/cenkalti/backoff/v4 v4.2.0 h1:HN5dHm3WBOgndBH6E8V0q2jIYIR3s9yglV8k/+MN3u4= +github.com/cenkalti/backoff/v4 v4.2.0/go.mod h1:Y3VNntkOUPxTVeUxJ/G5vcM//AlwfmyYozVcomhLiZE= github.com/ericlagergren/decimal v0.0.0-20221120152707-495c53812d05 h1:S92OBrGuLLZsyM5ybUzgc/mPjIYk2AZqufieooe98uw= github.com/ericlagergren/decimal v0.0.0-20221120152707-495c53812d05/go.mod h1:M9R1FoZ3y//hwwnJtO51ypFGwm8ZfpxPT/ZLtO1mcgQ= diff --git a/models/components/agent.go b/models/components/agent.go index 37f7cdd..f4caecf 100644 --- a/models/components/agent.go +++ b/models/components/agent.go @@ -44,7 +44,7 @@ type Agent struct { // The id of the agent ID int64 `json:"id"` // The hostname of the agent - Name string `json:"name"` + HostName string `json:"host_name"` // The signature of the client ClientSignature string `json:"client_signature"` // The state of the agent @@ -62,11 +62,11 @@ func (o *Agent) GetID() int64 { return o.ID } -func (o *Agent) GetName() string { +func (o *Agent) GetHostName() string { if o == nil { return "" } - return o.Name + return o.HostName } func (o *Agent) GetClientSignature() string { diff --git a/models/operations/updateagent.go b/models/operations/updateagent.go index 85d4c8a..249d0b8 100644 --- a/models/operations/updateagent.go +++ b/models/operations/updateagent.go @@ -11,7 +11,7 @@ type UpdateAgentRequestBody struct { // The id of the agent ID int64 `json:"id"` // The hostname of the agent - Name string `json:"name"` + HostName string `json:"host_name"` // The signature of the client ClientSignature string `json:"client_signature"` // The operating system of the agent @@ -26,11 +26,11 @@ func (o *UpdateAgentRequestBody) GetID() int64 { return o.ID } -func (o *UpdateAgentRequestBody) GetName() string { +func (o *UpdateAgentRequestBody) GetHostName() string { if o == nil { return "" } - return o.Name + return o.HostName } func (o *UpdateAgentRequestBody) GetClientSignature() string { diff --git a/models/sdkerrors/errorobject.go b/models/sdkerrors/errorobject.go index 47f98e0..ba92f32 100644 --- a/models/sdkerrors/errorobject.go +++ b/models/sdkerrors/errorobject.go @@ -6,7 +6,6 @@ import ( "encoding/json" ) -// ErrorObject - Not authorized type ErrorObject struct { Error_ *string `json:"error,omitempty"` }