# Result

The result of a Pass operation.

Obtainable from: Result.fromArray, Result.fromBoolean, Result.fromNumber, Result.fromObject, Result.fromString

- Source: [`aws-stepfunctions/lib/states/pass.ts`](https://github.com/aws/aws-cdk/blob/v2.278.0/packages/aws-cdk-lib/aws-stepfunctions/lib/states/pass.ts#L13)

## Example

TypeScript:

```ts
// Makes the current JSON state { ..., "subObject": { "hello": "world" } }
const pass = new sfn.Pass(this, 'Add Hello World', {
  result: sfn.Result.fromObject({ hello: 'world' }),
  resultPath: '$.subObject',
});

// Set the next state
const nextState = new sfn.Pass(this, 'NextState');
pass.next(nextState);
```

Python:

```python
# Makes the current JSON state { ..., "subObject": { "hello": "world" } }
pass = sfn.Pass(self, "Add Hello World",
    result=sfn.Result.from_object({"hello": "world"}),
    result_path="$.subObject"
)

# Set the next state
next_state = sfn.Pass(self, "NextState")
pass.next(next_state)
```

Java:

```java
// Makes the current JSON state { ..., "subObject": { "hello": "world" } }
Pass pass = Pass.Builder.create(this, "Add Hello World")
        .result(Result.fromObject(Map.of("hello", "world")))
        .resultPath("$.subObject")
        .build();

// Set the next state
Pass nextState = new Pass(this, "NextState");
pass.next(nextState);
```

C# / .NET:

```csharp
// Install: dotnet add package Amazon.CDK.Lib
// Makes the current JSON state { ..., "subObject": { "hello": "world" } }
var pass = new Pass(this, "Add Hello World", new PassProps {
    Result = Result.FromObject(new Dictionary<string, object> { { "hello", "world" } }),
    ResultPath = "$.subObject"
});

// Set the next state
var nextState = new Pass(this, "NextState");
pass.Next(nextState);
```

Golang:

```go
// Install: go get github.com/aws/aws-cdk-go/awscdk/v2
// Makes the current JSON state { ..., "subObject": { "hello": "world" } }
pass := sfn.NewPass(this, jsii.String("Add Hello World"), &PassProps{
	Result: sfn.Result_FromObject(map[string]interface{}{
		"hello": jsii.String("world"),
	}),
	ResultPath: jsii.String("$.subObject"),
})

// Set the next state
nextState := sfn.NewPass(this, jsii.String("NextState"))
pass.Next(nextState)
```

## Properties

- `value`: any — result of the Pass operation.

## Methods

- `fromArray(value: any[]): Result // chainable` (static) — The result of the operation is an array.

- `fromBoolean(value: boolean): Result // chainable` (static) — The result of the operation is a boolean.

- `fromNumber(value: number): Result // chainable` (static) — The result of the operation is a number.

- `fromObject(value: { [key: string]: any }): Result // chainable` (static) — The result of the operation is an object.

- `fromString(value: string): Result // chainable` (static) — The result of the operation is a string.
