From d84a9cc146ba720e71ca3314da2b06b2730920b8 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 1 May 2026 02:30:25 +0000 Subject: [PATCH 1/3] feat(api): api update --- .stats.yml | 8 +-- pkg/cmd/cmd.go | 8 +++ pkg/cmd/simulationentity.go | 100 +++++++++++++++++++++++++++++++ pkg/cmd/simulationentity_test.go | 52 ++++++++++++++++ 4 files changed, 164 insertions(+), 4 deletions(-) create mode 100644 pkg/cmd/simulationentity.go create mode 100644 pkg/cmd/simulationentity_test.go diff --git a/.stats.yml b/.stats.yml index 074cbe6..7c19297 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ -configured_endpoints: 237 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/increase/increase-bd2f5c49181098955f0dbdee1511e28d4a8b9d2a16433f747defd59430bb961f.yml -openapi_spec_hash: 206afcc5ec5f6294d1f185ee808d675c -config_hash: b4f1725275c973bb61f07d1bdc2b71d5 +configured_endpoints: 238 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/increase/increase-f0841004cde131703a9fc63fec3ae9ce98b63f0e8fe8d4326d1d75142538eda3.yml +openapi_spec_hash: a5a1e052b6e09ba465311f8adfcf9429 +config_hash: 060e036e1db198f2e908364c9df7096e diff --git a/pkg/cmd/cmd.go b/pkg/cmd/cmd.go index c0a9f06..3eea54c 100644 --- a/pkg/cmd/cmd.go +++ b/pkg/cmd/cmd.go @@ -919,6 +919,14 @@ func init() { &simulationsInboundMailItemsCreate, }, }, + { + Name: "simulations:entities", + Category: "API RESOURCE", + Suggest: true, + Commands: []*cli.Command{ + &simulationsEntitiesValidation, + }, + }, { Name: "simulations:entity-onboarding-sessions", Category: "API RESOURCE", diff --git a/pkg/cmd/simulationentity.go b/pkg/cmd/simulationentity.go new file mode 100644 index 0000000..6eb7284 --- /dev/null +++ b/pkg/cmd/simulationentity.go @@ -0,0 +1,100 @@ +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +package cmd + +import ( + "context" + "fmt" + + "github.com/Increase/increase-cli/internal/apiquery" + "github.com/Increase/increase-cli/internal/requestflag" + "github.com/Increase/increase-go" + "github.com/Increase/increase-go/option" + "github.com/tidwall/gjson" + "github.com/urfave/cli/v3" +) + +var simulationsEntitiesValidation = requestflag.WithInnerFlags(cli.Command{ + Name: "validation", + Usage: "Simulates setting an [Entity](#entities)'s validation under the managed\ncompliance regime. Any existing managed compliance validation on the Entity will\nbe marked as no longer current.", + Suggest: true, + Flags: []cli.Flag{ + &requestflag.Flag[string]{ + Name: "entity-id", + Usage: "The identifier of the Entity to set the validation on.", + Required: true, + PathParam: "entity_id", + }, + &requestflag.Flag[[]map[string]any]{ + Name: "issue", + Usage: "The issues to attach to the new managed compliance validation.", + Required: true, + BodyPath: "issues", + }, + &requestflag.Flag[string]{ + Name: "status", + Usage: "The status to set on the new managed compliance validation.", + Required: true, + BodyPath: "status", + }, + }, + Action: handleSimulationsEntitiesValidation, + HideHelpCommand: true, +}, map[string][]requestflag.HasOuterFlag{ + "issue": { + &requestflag.InnerFlag[string]{ + Name: "issue.category", + Usage: "The category of the issue.", + InnerField: "category", + }, + }, +}) + +func handleSimulationsEntitiesValidation(ctx context.Context, cmd *cli.Command) error { + client := increase.NewClient(getDefaultRequestOptions(cmd)...) + unusedArgs := cmd.Args().Slice() + if !cmd.IsSet("entity-id") && len(unusedArgs) > 0 { + cmd.Set("entity-id", unusedArgs[0]) + unusedArgs = unusedArgs[1:] + } + if len(unusedArgs) > 0 { + return fmt.Errorf("Unexpected extra arguments: %v", unusedArgs) + } + + options, err := flagOptions( + cmd, + apiquery.NestedQueryFormatDots, + apiquery.ArrayQueryFormatComma, + ApplicationJSON, + false, + ) + if err != nil { + return err + } + + params := increase.SimulationEntityValidationParams{} + + var res []byte + options = append(options, option.WithResponseBodyInto(&res)) + _, err = client.Simulations.Entities.Validation( + ctx, + cmd.Value("entity-id").(string), + params, + options..., + ) + if err != nil { + return err + } + + obj := gjson.ParseBytes(res) + format := cmd.Root().String("format") + explicitFormat := cmd.Root().IsSet("format") + transform := cmd.Root().String("transform") + return ShowJSON(obj, ShowJSONOpts{ + ExplicitFormat: explicitFormat, + Format: format, + RawOutput: cmd.Root().Bool("raw-output"), + Title: "simulations:entities validation", + Transform: transform, + }) +} diff --git a/pkg/cmd/simulationentity_test.go b/pkg/cmd/simulationentity_test.go new file mode 100644 index 0000000..680bdfd --- /dev/null +++ b/pkg/cmd/simulationentity_test.go @@ -0,0 +1,52 @@ +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +package cmd + +import ( + "testing" + + "github.com/Increase/increase-cli/internal/mocktest" + "github.com/Increase/increase-cli/internal/requestflag" +) + +func TestSimulationsEntitiesValidation(t *testing.T) { + t.Run("regular flags", func(t *testing.T) { + mocktest.TestRunMockTestWithFlags( + t, + "--api-key", "string", + "simulations:entities", "validation", + "--entity-id", "entity_n8y8tnk2p9339ti393yi", + "--issue", "{category: entity_tax_identifier}", + "--status", "invalid", + ) + }) + + t.Run("inner flags", func(t *testing.T) { + // Check that inner flags have been set up correctly + requestflag.CheckInnerFlags(simulationsEntitiesValidation) + + // Alternative argument passing style using inner flags + mocktest.TestRunMockTestWithFlags( + t, + "--api-key", "string", + "simulations:entities", "validation", + "--entity-id", "entity_n8y8tnk2p9339ti393yi", + "--issue.category", "entity_tax_identifier", + "--status", "invalid", + ) + }) + + t.Run("piping data", func(t *testing.T) { + // Test piping YAML data over stdin + pipeData := []byte("" + + "issues:\n" + + " - category: entity_tax_identifier\n" + + "status: invalid\n") + mocktest.TestRunMockTestWithPipeAndFlags( + t, pipeData, + "--api-key", "string", + "simulations:entities", "validation", + "--entity-id", "entity_n8y8tnk2p9339ti393yi", + ) + }) +} From 615f5d10d373bb6faef0cb98e6d02469471e173b Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 1 May 2026 04:33:28 +0000 Subject: [PATCH 2/3] feat(api): api update --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index b3cfeee..2f74ab7 100644 --- a/go.mod +++ b/go.mod @@ -3,7 +3,7 @@ module github.com/Increase/increase-cli go 1.25 require ( - github.com/Increase/increase-go v0.568.0 + github.com/Increase/increase-go v0.569.0 github.com/charmbracelet/bubbles v0.21.0 github.com/charmbracelet/bubbletea v1.3.6 github.com/charmbracelet/lipgloss v1.1.0 diff --git a/go.sum b/go.sum index 82f7c3e..7bc51f8 100644 --- a/go.sum +++ b/go.sum @@ -1,5 +1,5 @@ -github.com/Increase/increase-go v0.568.0 h1:FityaKy5UWRCg3QwxJcRZJpwNHufUyr9weV+xUf0/bk= -github.com/Increase/increase-go v0.568.0/go.mod h1:6hw2BX7IdjKE9HaFiKGYxX4SbikSmVuBYbStCeddkkI= +github.com/Increase/increase-go v0.569.0 h1:GIyYrJ280OAPzRK880u8lpp517QESrDlTRAbs6yk7Vw= +github.com/Increase/increase-go v0.569.0/go.mod h1:6hw2BX7IdjKE9HaFiKGYxX4SbikSmVuBYbStCeddkkI= github.com/aymanbagabas/go-osc52/v2 v2.0.1 h1:HwpRHbFMcZLEVr42D4p7XBqjyuxQH5SMiErDT4WkJ2k= github.com/aymanbagabas/go-osc52/v2 v2.0.1/go.mod h1:uYgXzlJ7ZpABp8OJ+exZzJJhRNQ2ASbcXHWsFqH8hp8= github.com/aymanbagabas/go-udiff v0.2.0 h1:TK0fH4MteXUDspT88n8CKzvK0X9O2xu9yQjWpi6yML8= From b03f2482b71531fdfdeaf3d6160cd5d336c576c9 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 1 May 2026 04:33:55 +0000 Subject: [PATCH 3/3] release: 0.46.0 --- .release-please-manifest.json | 2 +- CHANGELOG.md | 9 +++++++++ pkg/cmd/version.go | 2 +- 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/.release-please-manifest.json b/.release-please-manifest.json index fc0d7ff..563004f 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "0.45.0" + ".": "0.46.0" } \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index a12b70d..c142bdc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,14 @@ # Changelog +## 0.46.0 (2026-05-01) + +Full Changelog: [v0.45.0...v0.46.0](https://github.com/Increase/increase-cli/compare/v0.45.0...v0.46.0) + +### Features + +* **api:** api update ([615f5d1](https://github.com/Increase/increase-cli/commit/615f5d10d373bb6faef0cb98e6d02469471e173b)) +* **api:** api update ([d84a9cc](https://github.com/Increase/increase-cli/commit/d84a9cc146ba720e71ca3314da2b06b2730920b8)) + ## 0.45.0 (2026-04-30) Full Changelog: [v0.44.0...v0.45.0](https://github.com/Increase/increase-cli/compare/v0.44.0...v0.45.0) diff --git a/pkg/cmd/version.go b/pkg/cmd/version.go index cb95f24..8fbe43c 100644 --- a/pkg/cmd/version.go +++ b/pkg/cmd/version.go @@ -2,4 +2,4 @@ package cmd -const Version = "0.45.0" // x-release-please-version +const Version = "0.46.0" // x-release-please-version