> ## Documentation Index
> Fetch the complete documentation index at: https://cdktn.io/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Go: Token

> CDKTN Core API Reference for Token in Go.

Represents a special or lazily-evaluated value.

Can be used to delay evaluation of a certain value in case, for example,
that it requires some context or late-bound data. Can also be used to
mark values that need special processing at document rendering time.

Tokens can be embedded into strings while retaining their original
semantics.

## Initializers <a name="Initializers" id="cdktn.Token.Initializer" />

```go theme={null}
import "github.com/open-constructs/cdk-terrain-go/cdktn"

cdktn.NewToken() Token
```

| **Name** | **Type** | **Description** |
| -------- | -------- | --------------- |

***

## Static Functions <a name="Static Functions" id="Static Functions" />

| **Name**                                                          | **Description**                                          |
| ----------------------------------------------------------------- | -------------------------------------------------------- |
| <code><a href="#cdktn.Token.asAny">AsAny</a></code>               | Return a resolvable representation of the given value.   |
| <code><a href="#cdktn.Token.asAnyMap">AsAnyMap</a></code>         | Return a reversible map representation of this token.    |
| <code><a href="#cdktn.Token.asBooleanMap">AsBooleanMap</a></code> | Return a reversible map representation of this token.    |
| <code><a href="#cdktn.Token.asList">AsList</a></code>             | Return a reversible list representation of this token.   |
| <code><a href="#cdktn.Token.asMap">AsMap</a></code>               | Return a reversible map representation of this token.    |
| <code><a href="#cdktn.Token.asNumber">AsNumber</a></code>         | Return a reversible number representation of this token. |
| <code><a href="#cdktn.Token.asNumberList">AsNumberList</a></code> | Return a reversible list representation of this token.   |
| <code><a href="#cdktn.Token.asNumberMap">AsNumberMap</a></code>   | Return a reversible map representation of this token.    |
| <code><a href="#cdktn.Token.asString">AsString</a></code>         | Return a reversible string representation of this token. |
| <code><a href="#cdktn.Token.asStringMap">AsStringMap</a></code>   | Return a reversible map representation of this token.    |
| <code><a href="#cdktn.Token.isUnresolved">IsUnresolved</a></code> | Returns true if obj represents an unresolved value.      |
| <code><a href="#cdktn.Token.nullValue">NullValue</a></code>       | Return a Token containing a `null` value.                |

***

### `AsAny` <a name="AsAny" id="cdktn.Token.asAny" />

```go theme={null}
import "github.com/open-constructs/cdk-terrain-go/cdktn"

cdktn.Token_AsAny(value interface{}) IResolvable
```

Return a resolvable representation of the given value.

#### `value`<sup>Required</sup> <a name="value" id="cdktn.Token.asAny.parameter.value" />

* *Type:* interface\{}

***

### `AsAnyMap` <a name="AsAnyMap" id="cdktn.Token.asAnyMap" />

```go theme={null}
import "github.com/open-constructs/cdk-terrain-go/cdktn"

cdktn.Token_AsAnyMap(value interface{}, options EncodingOptions) *map[string]interface{}
```

Return a reversible map representation of this token.

#### `value`<sup>Required</sup> <a name="value" id="cdktn.Token.asAnyMap.parameter.value" />

* *Type:* interface\{}

***

#### `options`<sup>Optional</sup> <a name="options" id="cdktn.Token.asAnyMap.parameter.options" />

* *Type:* <a href="#cdktn.EncodingOptions">EncodingOptions</a>

***

### `AsBooleanMap` <a name="AsBooleanMap" id="cdktn.Token.asBooleanMap" />

```go theme={null}
import "github.com/open-constructs/cdk-terrain-go/cdktn"

cdktn.Token_AsBooleanMap(value interface{}, options EncodingOptions) *map[string]*bool
```

Return a reversible map representation of this token.

#### `value`<sup>Required</sup> <a name="value" id="cdktn.Token.asBooleanMap.parameter.value" />

* *Type:* interface\{}

***

#### `options`<sup>Optional</sup> <a name="options" id="cdktn.Token.asBooleanMap.parameter.options" />

* *Type:* <a href="#cdktn.EncodingOptions">EncodingOptions</a>

***

### `AsList` <a name="AsList" id="cdktn.Token.asList" />

```go theme={null}
import "github.com/open-constructs/cdk-terrain-go/cdktn"

cdktn.Token_AsList(value interface{}, options EncodingOptions) *[]*string
```

Return a reversible list representation of this token.

#### `value`<sup>Required</sup> <a name="value" id="cdktn.Token.asList.parameter.value" />

* *Type:* interface\{}

***

#### `options`<sup>Optional</sup> <a name="options" id="cdktn.Token.asList.parameter.options" />

* *Type:* <a href="#cdktn.EncodingOptions">EncodingOptions</a>

***

### `AsMap` <a name="AsMap" id="cdktn.Token.asMap" />

```go theme={null}
import "github.com/open-constructs/cdk-terrain-go/cdktn"

cdktn.Token_AsMap(value interface{}, mapValue interface{}, options EncodingOptions) *map[string]interface{}
```

Return a reversible map representation of this token.

#### `value`<sup>Required</sup> <a name="value" id="cdktn.Token.asMap.parameter.value" />

* *Type:* interface\{}

***

#### `mapValue`<sup>Required</sup> <a name="mapValue" id="cdktn.Token.asMap.parameter.mapValue" />

* *Type:* interface\{}

***

#### `options`<sup>Optional</sup> <a name="options" id="cdktn.Token.asMap.parameter.options" />

* *Type:* <a href="#cdktn.EncodingOptions">EncodingOptions</a>

***

### `AsNumber` <a name="AsNumber" id="cdktn.Token.asNumber" />

```go theme={null}
import "github.com/open-constructs/cdk-terrain-go/cdktn"

cdktn.Token_AsNumber(value interface{}) *f64
```

Return a reversible number representation of this token.

#### `value`<sup>Required</sup> <a name="value" id="cdktn.Token.asNumber.parameter.value" />

* *Type:* interface\{}

***

### `AsNumberList` <a name="AsNumberList" id="cdktn.Token.asNumberList" />

```go theme={null}
import "github.com/open-constructs/cdk-terrain-go/cdktn"

cdktn.Token_AsNumberList(value interface{}) *[]*f64
```

Return a reversible list representation of this token.

#### `value`<sup>Required</sup> <a name="value" id="cdktn.Token.asNumberList.parameter.value" />

* *Type:* interface\{}

***

### `AsNumberMap` <a name="AsNumberMap" id="cdktn.Token.asNumberMap" />

```go theme={null}
import "github.com/open-constructs/cdk-terrain-go/cdktn"

cdktn.Token_AsNumberMap(value interface{}, options EncodingOptions) *map[string]*f64
```

Return a reversible map representation of this token.

#### `value`<sup>Required</sup> <a name="value" id="cdktn.Token.asNumberMap.parameter.value" />

* *Type:* interface\{}

***

#### `options`<sup>Optional</sup> <a name="options" id="cdktn.Token.asNumberMap.parameter.options" />

* *Type:* <a href="#cdktn.EncodingOptions">EncodingOptions</a>

***

### `AsString` <a name="AsString" id="cdktn.Token.asString" />

```go theme={null}
import "github.com/open-constructs/cdk-terrain-go/cdktn"

cdktn.Token_AsString(value interface{}, options EncodingOptions) *string
```

Return a reversible string representation of this token.

If the Token is initialized with a literal, the stringified value of the
literal is returned. Otherwise, a special quoted string representation
of the Token is returned that can be embedded into other strings.

Strings with quoted Tokens in them can be restored back into
complex values with the Tokens restored by calling `resolve()`
on the string.

#### `value`<sup>Required</sup> <a name="value" id="cdktn.Token.asString.parameter.value" />

* *Type:* interface\{}

***

#### `options`<sup>Optional</sup> <a name="options" id="cdktn.Token.asString.parameter.options" />

* *Type:* <a href="#cdktn.EncodingOptions">EncodingOptions</a>

***

### `AsStringMap` <a name="AsStringMap" id="cdktn.Token.asStringMap" />

```go theme={null}
import "github.com/open-constructs/cdk-terrain-go/cdktn"

cdktn.Token_AsStringMap(value interface{}, options EncodingOptions) *map[string]*string
```

Return a reversible map representation of this token.

#### `value`<sup>Required</sup> <a name="value" id="cdktn.Token.asStringMap.parameter.value" />

* *Type:* interface\{}

***

#### `options`<sup>Optional</sup> <a name="options" id="cdktn.Token.asStringMap.parameter.options" />

* *Type:* <a href="#cdktn.EncodingOptions">EncodingOptions</a>

***

### `IsUnresolved` <a name="IsUnresolved" id="cdktn.Token.isUnresolved" />

```go theme={null}
import "github.com/open-constructs/cdk-terrain-go/cdktn"

cdktn.Token_IsUnresolved(obj interface{}) *bool
```

Returns true if obj represents an unresolved value.

One of these must be true:

* `obj` is an IResolvable
* `obj` is a string containing at least one encoded `IResolvable`
* `obj` is either an encoded number or list

This does NOT recurse into lists or objects to see if they
containing resolvables.

#### `obj`<sup>Required</sup> <a name="obj" id="cdktn.Token.isUnresolved.parameter.obj" />

* *Type:* interface\{}

The object to test.

***

### `NullValue` <a name="NullValue" id="cdktn.Token.nullValue" />

```go theme={null}
import "github.com/open-constructs/cdk-terrain-go/cdktn"

cdktn.Token_NullValue() IResolvable
```

Return a Token containing a `null` value.

Note: This is different than `undefined`, `nil`, `None` or similar
as it will end up in the Terraform config and can be used to explicitly
not set an attribute (which is sometimes required by Terraform providers)

## Constants <a name="Constants" id="Constants" />

| **Name**                                                                                    | **Type**              | **Description**                        |
| ------------------------------------------------------------------------------------------- | --------------------- | -------------------------------------- |
| <code><a href="#cdktn.Token.property.ANY_MAP_TOKEN_VALUE">AnyMapTokenValue</a></code>       | <code>\*string</code> | Any map token representation.          |
| <code><a href="#cdktn.Token.property.NUMBER_MAP_TOKEN_VALUE">NumberMapTokenValue</a></code> | <code>\*f64</code>    | Number Map token value representation. |
| <code><a href="#cdktn.Token.property.STRING_MAP_TOKEN_VALUE">StringMapTokenValue</a></code> | <code>\*string</code> | String Map token value representation. |

***

### `AnyMapTokenValue`<sup>Required</sup> <a name="AnyMapTokenValue" id="cdktn.Token.property.ANY_MAP_TOKEN_VALUE" />

```go theme={null}
func AnyMapTokenValue() *string
```

* *Type:* \*string

Any map token representation.

***

### `NumberMapTokenValue`<sup>Required</sup> <a name="NumberMapTokenValue" id="cdktn.Token.property.NUMBER_MAP_TOKEN_VALUE" />

```go theme={null}
func NumberMapTokenValue() *f64
```

* *Type:* \*f64

Number Map token value representation.

***

### `StringMapTokenValue`<sup>Required</sup> <a name="StringMapTokenValue" id="cdktn.Token.property.STRING_MAP_TOKEN_VALUE" />

```go theme={null}
func StringMapTokenValue() *string
```

* *Type:* \*string

String Map token value representation.

***
