Skip to content

Commit 2634f6c

Browse files
speakeasybotunclesp1d3r
authored andcommitted
## Go SDK Changes:
* `CipherSwarmAgentSdk.Agents.UpdateAgent()`: `request` **Changed** (Breaking ⚠️) * `CipherSwarmAgentSdk.Agents.SendHeartbeat()`: `request` **Changed** (Breaking ⚠️) * `CipherSwarmAgentSdk.Agents.SubmitBenchmark()`: * `request` **Changed** (Breaking ⚠️) * `response` **Changed** (Breaking ⚠️) * `CipherSwarmAgentSdk.Agents.SubmitErrorAgent()`: `request` **Changed** (Breaking ⚠️) * `CipherSwarmAgentSdk.Tasks.GetNewTask()`: `response.Status` **Changed** (Breaking ⚠️) * `CipherSwarmAgentSdk.Tasks.GetTask()`: `response.Status` **Changed** (Breaking ⚠️) * `CipherSwarmAgentSdk.Tasks.SendStatus()`: `request` **Changed** (Breaking ⚠️) * `CipherSwarmAgentSdk.Tasks.SetTaskAbandoned()`: `error.RawResponse` **Removed** (Breaking ⚠️) * `CipherSwarmAgentSdk.Tasks.GetTaskZaps()`: * `response.status[200].content[text/plain` **Removed** (Breaking ⚠️) * `error` **Changed** * `CipherSwarmAgentSdk.Attacks.GetHashList()`: `error` **Changed** * `CipherSwarmAgentSdk.Tasks.SendCrack()`: `error.status[401]` **Added** * `CipherSwarmAgentSdk.Tasks.SetTaskAccepted()`: `error.status[401]` **Added**
1 parent a4d2f9b commit 2634f6c

72 files changed

Lines changed: 1580 additions & 1124 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.speakeasy/gen.lock

Lines changed: 209 additions & 151 deletions
Large diffs are not rendered by default.

.speakeasy/gen.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ generation:
2929
generateNewTests: false
3030
skipResponseBodyAssertions: false
3131
go:
32-
version: 0.9.1
32+
version: 0.9.2
3333
additionalDependencies: {}
3434
allowUnknownFieldsInWeakUnions: false
3535
baseErrorName: CipherSwarmAgentSDKError

.speakeasy/workflow.lock

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,20 @@
1-
speakeasyVersion: 1.755.0
1+
speakeasyVersion: 1.761.11
22
sources:
33
CipherSwarm_agent_api:
44
sourceNamespace: cipher-swarm-agent-api
5-
sourceRevisionDigest: sha256:5f83a992f76a9bf2d293da491b3a954fefb3373a6e5ba674cff33eb6de90de29
6-
sourceBlobDigest: sha256:5c6e690fa7f059e7c9535a86837debb874ca4b9e8cdfa0aa3e531408a04152a5
5+
sourceRevisionDigest: sha256:e69bcb07c31f19c6d2821ab5908f3a6bb5d4b7cf0b640d18f4b301b84c69503b
6+
sourceBlobDigest: sha256:3be5b06d148e0f447749a11183221fed20565497933776282a1b5d1213b087be
77
tags:
88
- latest
99
- "1.3"
1010
targets:
1111
golang-sdk:
1212
source: CipherSwarm_agent_api
1313
sourceNamespace: cipher-swarm-agent-api
14-
sourceRevisionDigest: sha256:5f83a992f76a9bf2d293da491b3a954fefb3373a6e5ba674cff33eb6de90de29
15-
sourceBlobDigest: sha256:5c6e690fa7f059e7c9535a86837debb874ca4b9e8cdfa0aa3e531408a04152a5
14+
sourceRevisionDigest: sha256:e69bcb07c31f19c6d2821ab5908f3a6bb5d4b7cf0b640d18f4b301b84c69503b
15+
sourceBlobDigest: sha256:3be5b06d148e0f447749a11183221fed20565497933776282a1b5d1213b087be
1616
codeSamplesNamespace: cipher-swarm-agent-api-go-code-samples
17-
codeSamplesRevisionDigest: sha256:c2fc3a04665edc548b99afaf59fa2cfcbac50af52663fc20ab9f62f1a5080739
17+
codeSamplesRevisionDigest: sha256:694d2c5de28726087b97e5a71c260ac1c6ab81fea9a7ac276cb40f11be2ac42f
1818
workflow:
1919
workflowVersion: 1.0.0
2020
speakeasyVersion: latest

RELEASES.md

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -308,4 +308,14 @@ Based on:
308308
### Generated
309309
- [go v0.9.1] .
310310
### Releases
311-
- [Go v0.9.1] https://github.com/unclesp1d3r/cipherswarm-agent-sdk-go/releases/tag/v0.9.1 - .
311+
- [Go v0.9.1] https://github.com/unclesp1d3r/cipherswarm-agent-sdk-go/releases/tag/v0.9.1 - .
312+
313+
## 2026-05-04 00:57:18
314+
### Changes
315+
Based on:
316+
- OpenAPI Doc
317+
- Speakeasy CLI 1.761.11 (2.881.17) https://github.com/speakeasy-api/speakeasy
318+
### Generated
319+
- [go v0.9.2] .
320+
### Releases
321+
- [Go v0.9.2] https://github.com/unclesp1d3r/cipherswarm-agent-sdk-go/releases/tag/v0.9.2 - .

agents.go

Lines changed: 63 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@ func newAgents(rootSDK *CipherSwarmAgentSDK, sdkConfig config.SDKConfiguration,
3333

3434
// GetAgent - Gets an instance of an agent
3535
// Returns an agent
36+
//
37+
// If set, this operation will use [Security.BearerAuth] from the global security.
3638
func (s *Agents) GetAgent(ctx context.Context, id int64, opts ...operations.Option) (*operations.GetAgentResponse, error) {
3739
request := operations.GetAgentRequest{
3840
ID: id,
@@ -88,7 +90,7 @@ func (s *Agents) GetAgent(ctx context.Context, id int64, opts ...operations.Opti
8890
req.Header.Set("Accept", "application/json")
8991
req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent)
9092

91-
if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil {
93+
if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security, "BearerAuth"); err != nil {
9294
return nil, err
9395
}
9496

@@ -179,7 +181,7 @@ func (s *Agents) GetAgent(ctx context.Context, id int64, opts ...operations.Opti
179181

180182
_, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err)
181183
return nil, err
182-
} else if utils.MatchStatusCodes([]string{"401", "4XX", "5XX"}, httpRes.StatusCode) {
184+
} else if utils.MatchStatusCodes([]string{"4XX", "5XX"}, httpRes.StatusCode) {
183185
_httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil)
184186
if err != nil {
185187
return nil, err
@@ -269,10 +271,12 @@ func (s *Agents) GetAgent(ctx context.Context, id int64, opts ...operations.Opti
269271

270272
// UpdateAgent - Updates the agent
271273
// Updates an agent
272-
func (s *Agents) UpdateAgent(ctx context.Context, id int64, requestBody operations.UpdateAgentRequestBody, opts ...operations.Option) (*operations.UpdateAgentResponse, error) {
274+
//
275+
// If set, this operation will use [Security.BearerAuth] from the global security.
276+
func (s *Agents) UpdateAgent(ctx context.Context, id int64, updateAgentRequest components.UpdateAgentRequest, opts ...operations.Option) (*operations.UpdateAgentResponse, error) {
273277
request := operations.UpdateAgentRequest{
274-
ID: id,
275-
RequestBody: requestBody,
278+
ID: id,
279+
UpdateAgentRequest: updateAgentRequest,
276280
}
277281

278282
o := operations.Options{}
@@ -306,7 +310,7 @@ func (s *Agents) UpdateAgent(ctx context.Context, id int64, requestBody operatio
306310
OperationID: "updateAgent",
307311
SecuritySource: s.sdkConfiguration.Security,
308312
}
309-
bodyReader, reqContentType, err := utils.SerializeRequestBody(ctx, request, false, false, "RequestBody", "json", `request:"mediaType=application/json"`)
313+
bodyReader, reqContentType, err := utils.SerializeRequestBody(ctx, request, false, false, "UpdateAgentRequest", "json", `request:"mediaType=application/json"`)
310314
if err != nil {
311315
return nil, err
312316
}
@@ -332,7 +336,7 @@ func (s *Agents) UpdateAgent(ctx context.Context, id int64, requestBody operatio
332336
req.Header.Set("Content-Type", reqContentType)
333337
}
334338

335-
if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil {
339+
if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security, "BearerAuth"); err != nil {
336340
return nil, err
337341
}
338342

@@ -423,7 +427,7 @@ func (s *Agents) UpdateAgent(ctx context.Context, id int64, requestBody operatio
423427

424428
_, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err)
425429
return nil, err
426-
} else if utils.MatchStatusCodes([]string{"401", "4XX", "5XX"}, httpRes.StatusCode) {
430+
} else if utils.MatchStatusCodes([]string{"4XX", "5XX"}, httpRes.StatusCode) {
427431
_httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil)
428432
if err != nil {
429433
return nil, err
@@ -513,10 +517,12 @@ func (s *Agents) UpdateAgent(ctx context.Context, id int64, requestBody operatio
513517

514518
// SendHeartbeat - Send a heartbeat for an agent
515519
// Send a heartbeat for an agent to keep it alive. Optionally accepts an 'activity' parameter in the request body to track the agent's current activity state.
516-
func (s *Agents) SendHeartbeat(ctx context.Context, id int64, requestBody *operations.SendHeartbeatRequestBody, opts ...operations.Option) (*operations.SendHeartbeatResponse, error) {
520+
//
521+
// If set, this operation will use [Security.BearerAuth] from the global security.
522+
func (s *Agents) SendHeartbeat(ctx context.Context, id int64, agentHeartbeatRequest *components.AgentHeartbeatRequest, opts ...operations.Option) (*operations.SendHeartbeatResponse, error) {
517523
request := operations.SendHeartbeatRequest{
518-
ID: id,
519-
RequestBody: requestBody,
524+
ID: id,
525+
AgentHeartbeatRequest: agentHeartbeatRequest,
520526
}
521527

522528
o := operations.Options{}
@@ -550,7 +556,7 @@ func (s *Agents) SendHeartbeat(ctx context.Context, id int64, requestBody *opera
550556
OperationID: "sendHeartbeat",
551557
SecuritySource: s.sdkConfiguration.Security,
552558
}
553-
bodyReader, reqContentType, err := utils.SerializeRequestBody(ctx, request, false, true, "RequestBody", "json", `request:"mediaType=application/json"`)
559+
bodyReader, reqContentType, err := utils.SerializeRequestBody(ctx, request, false, true, "AgentHeartbeatRequest", "json", `request:"mediaType=application/json"`)
554560
if err != nil {
555561
return nil, err
556562
}
@@ -576,7 +582,7 @@ func (s *Agents) SendHeartbeat(ctx context.Context, id int64, requestBody *opera
576582
req.Header.Set("Content-Type", reqContentType)
577583
}
578584

579-
if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil {
585+
if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security, "BearerAuth"); err != nil {
580586
return nil, err
581587
}
582588

@@ -667,7 +673,7 @@ func (s *Agents) SendHeartbeat(ctx context.Context, id int64, requestBody *opera
667673

668674
_, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err)
669675
return nil, err
670-
} else if utils.MatchStatusCodes([]string{"401", "4XX", "5XX"}, httpRes.StatusCode) {
676+
} else if utils.MatchStatusCodes([]string{"4XX", "5XX"}, httpRes.StatusCode) {
671677
_httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil)
672678
if err != nil {
673679
return nil, err
@@ -697,12 +703,12 @@ func (s *Agents) SendHeartbeat(ctx context.Context, id int64, requestBody *opera
697703
return nil, err
698704
}
699705

700-
var out operations.SendHeartbeatResponseBody
706+
var out components.HeartbeatResponse
701707
if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil {
702708
return nil, err
703709
}
704710

705-
res.Object = &out
711+
res.HeartbeatResponse = &out
706712
default:
707713
rawBody, err := utils.ConsumeRawBody(httpRes)
708714
if err != nil {
@@ -759,10 +765,12 @@ func (s *Agents) SendHeartbeat(ctx context.Context, id int64, requestBody *opera
759765

760766
// SubmitBenchmark - submit agent benchmarks
761767
// Submit a benchmark for an agent
762-
func (s *Agents) SubmitBenchmark(ctx context.Context, id int64, requestBody operations.SubmitBenchmarkRequestBody, opts ...operations.Option) (*operations.SubmitBenchmarkResponse, error) {
768+
//
769+
// If set, this operation will use [Security.BearerAuth] from the global security.
770+
func (s *Agents) SubmitBenchmark(ctx context.Context, id int64, submitBenchmarkRequest components.SubmitBenchmarkRequest, opts ...operations.Option) (*operations.SubmitBenchmarkResponse, error) {
763771
request := operations.SubmitBenchmarkRequest{
764-
ID: id,
765-
RequestBody: requestBody,
772+
ID: id,
773+
SubmitBenchmarkRequest: submitBenchmarkRequest,
766774
}
767775

768776
o := operations.Options{}
@@ -796,7 +804,7 @@ func (s *Agents) SubmitBenchmark(ctx context.Context, id int64, requestBody oper
796804
OperationID: "submitBenchmark",
797805
SecuritySource: s.sdkConfiguration.Security,
798806
}
799-
bodyReader, reqContentType, err := utils.SerializeRequestBody(ctx, request, false, false, "RequestBody", "json", `request:"mediaType=application/json"`)
807+
bodyReader, reqContentType, err := utils.SerializeRequestBody(ctx, request, false, false, "SubmitBenchmarkRequest", "json", `request:"mediaType=application/json"`)
800808
if err != nil {
801809
return nil, err
802810
}
@@ -822,7 +830,7 @@ func (s *Agents) SubmitBenchmark(ctx context.Context, id int64, requestBody oper
822830
req.Header.Set("Content-Type", reqContentType)
823831
}
824832

825-
if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil {
833+
if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security, "BearerAuth"); err != nil {
826834
return nil, err
827835
}
828836

@@ -913,7 +921,7 @@ func (s *Agents) SubmitBenchmark(ctx context.Context, id int64, requestBody oper
913921

914922
_, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err)
915923
return nil, err
916-
} else if utils.MatchStatusCodes([]string{"400", "401", "422", "4XX", "5XX"}, httpRes.StatusCode) {
924+
} else if utils.MatchStatusCodes([]string{"4XX", "5XX"}, httpRes.StatusCode) {
917925
_httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil)
918926
if err != nil {
919927
return nil, err
@@ -935,8 +943,27 @@ func (s *Agents) SubmitBenchmark(ctx context.Context, id int64, requestBody oper
935943
}
936944

937945
switch {
938-
case httpRes.StatusCode == 204:
939-
utils.DrainBody(httpRes)
946+
case httpRes.StatusCode == 200:
947+
switch {
948+
case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`):
949+
rawBody, err := utils.ConsumeRawBody(httpRes)
950+
if err != nil {
951+
return nil, err
952+
}
953+
954+
var out components.BenchmarkReceipt
955+
if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil {
956+
return nil, err
957+
}
958+
959+
res.BenchmarkReceipt = &out
960+
default:
961+
rawBody, err := utils.ConsumeRawBody(httpRes)
962+
if err != nil {
963+
return nil, err
964+
}
965+
return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes)
966+
}
940967
case httpRes.StatusCode == 400:
941968
fallthrough
942969
case httpRes.StatusCode == 401:
@@ -988,10 +1015,12 @@ func (s *Agents) SubmitBenchmark(ctx context.Context, id int64, requestBody oper
9881015

9891016
// SubmitErrorAgent - Submit an error for an agent
9901017
// Submit an error for an agent
991-
func (s *Agents) SubmitErrorAgent(ctx context.Context, id int64, requestBody operations.SubmitErrorAgentRequestBody, opts ...operations.Option) (*operations.SubmitErrorAgentResponse, error) {
1018+
//
1019+
// If set, this operation will use [Security.BearerAuth] from the global security.
1020+
func (s *Agents) SubmitErrorAgent(ctx context.Context, id int64, submitErrorRequest components.SubmitErrorRequest, opts ...operations.Option) (*operations.SubmitErrorAgentResponse, error) {
9921021
request := operations.SubmitErrorAgentRequest{
993-
ID: id,
994-
RequestBody: requestBody,
1022+
ID: id,
1023+
SubmitErrorRequest: submitErrorRequest,
9951024
}
9961025

9971026
o := operations.Options{}
@@ -1025,7 +1054,7 @@ func (s *Agents) SubmitErrorAgent(ctx context.Context, id int64, requestBody ope
10251054
OperationID: "submitErrorAgent",
10261055
SecuritySource: s.sdkConfiguration.Security,
10271056
}
1028-
bodyReader, reqContentType, err := utils.SerializeRequestBody(ctx, request, false, false, "RequestBody", "json", `request:"mediaType=application/json"`)
1057+
bodyReader, reqContentType, err := utils.SerializeRequestBody(ctx, request, false, false, "SubmitErrorRequest", "json", `request:"mediaType=application/json"`)
10291058
if err != nil {
10301059
return nil, err
10311060
}
@@ -1051,7 +1080,7 @@ func (s *Agents) SubmitErrorAgent(ctx context.Context, id int64, requestBody ope
10511080
req.Header.Set("Content-Type", reqContentType)
10521081
}
10531082

1054-
if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil {
1083+
if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security, "BearerAuth"); err != nil {
10551084
return nil, err
10561085
}
10571086

@@ -1142,7 +1171,7 @@ func (s *Agents) SubmitErrorAgent(ctx context.Context, id int64, requestBody ope
11421171

11431172
_, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err)
11441173
return nil, err
1145-
} else if utils.MatchStatusCodes([]string{"401", "4XX", "5XX"}, httpRes.StatusCode) {
1174+
} else if utils.MatchStatusCodes([]string{"4XX", "5XX"}, httpRes.StatusCode) {
11461175
_httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil)
11471176
if err != nil {
11481177
return nil, err
@@ -1213,6 +1242,8 @@ func (s *Agents) SubmitErrorAgent(ctx context.Context, id int64, requestBody ope
12131242

12141243
// SetAgentShutdown - shutdown agent
12151244
// Marks the agent as shutdown and offline, freeing any assigned tasks.
1245+
//
1246+
// If set, this operation will use [Security.BearerAuth] from the global security.
12161247
func (s *Agents) SetAgentShutdown(ctx context.Context, id int64, opts ...operations.Option) (*operations.SetAgentShutdownResponse, error) {
12171248
request := operations.SetAgentShutdownRequest{
12181249
ID: id,
@@ -1268,7 +1299,7 @@ func (s *Agents) SetAgentShutdown(ctx context.Context, id int64, opts ...operati
12681299
req.Header.Set("Accept", "application/json")
12691300
req.Header.Set("User-Agent", s.sdkConfiguration.UserAgent)
12701301

1271-
if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security); err != nil {
1302+
if err := utils.PopulateSecurity(ctx, req, s.sdkConfiguration.Security, "BearerAuth"); err != nil {
12721303
return nil, err
12731304
}
12741305

@@ -1359,7 +1390,7 @@ func (s *Agents) SetAgentShutdown(ctx context.Context, id int64, opts ...operati
13591390

13601391
_, err = s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, nil, err)
13611392
return nil, err
1362-
} else if utils.MatchStatusCodes([]string{"401", "4XX", "5XX"}, httpRes.StatusCode) {
1393+
} else if utils.MatchStatusCodes([]string{"4XX", "5XX"}, httpRes.StatusCode) {
13631394
_httpRes, err := s.hooks.AfterError(hooks.AfterErrorContext{HookContext: hookCtx}, httpRes, nil)
13641395
if err != nil {
13651396
return nil, err

0 commit comments

Comments
 (0)