Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
".": "0.45.0"
".": "0.46.0"
}
8 changes: 4 additions & 4 deletions .stats.yml
Original file line number Diff line number Diff line change
@@ -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
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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)
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
@@ -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=
Expand Down
8 changes: 8 additions & 0 deletions pkg/cmd/cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
100 changes: 100 additions & 0 deletions pkg/cmd/simulationentity.go
Original file line number Diff line number Diff line change
@@ -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,
})
}
52 changes: 52 additions & 0 deletions pkg/cmd/simulationentity_test.go
Original file line number Diff line number Diff line change
@@ -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",
)
})
}
2 changes: 1 addition & 1 deletion pkg/cmd/version.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@

package cmd

const Version = "0.45.0" // x-release-please-version
const Version = "0.46.0" // x-release-please-version
Loading