API Reference
Resources
Api
Functionality shared between all Api
implementations.
Initializers
bring cloud;
new cloud.Api(props?: ApiProps)
Name | Type | Description |
---|---|---|
props | ApiProps | No description. |
props
Optional
- Type: ApiProps
Methods
Name | Description |
---|---|
connect | Add a inflight handler to the api for CONNECT requests on the given path. |
delete | Add a inflight handler to the api for DELETE requests on the given path. |
get | Add a inflight handler to the api for GET requests on the given path. |
head | Add a inflight handler to the api for HEAD requests on the given path. |
options | Add a inflight handler to the api for OPTIONS requests on the given path. |
patch | Add a inflight handler to the api for PATCH requests on the given path. |
post | Add a inflight handler to the api for POST requests on the given path. |
put | Add a inflight handler to the api for PUT requests on the given path. |
connect
connect(path: str, inflight: IApiEndpointHandler, props?: ApiConnectProps): void
Add a inflight handler to the api for CONNECT requests on the given path.
path
Required
- Type: str
The path to handle CONNECT requests for.
inflight
Required
- Type: IApiEndpointHandler
The function to handle the request.
props
Optional
- Type: ApiConnectProps
Options for the route.
delete
delete(path: str, inflight: IApiEndpointHandler, props?: ApiDeleteProps): void
Add a inflight handler to the api for DELETE requests on the given path.
path
Required
- Type: str
The path to handle DELETE requests for.
inflight
Required
- Type: IApiEndpointHandler
The function to handle the request.
props
Optional
- Type: ApiDeleteProps
Options for the route.
get
get(path: str, inflight: IApiEndpointHandler, props?: ApiGetProps): void
Add a inflight handler to the api for GET requests on the given path.
path
Required
- Type: str
The path to handle GET requests for.
inflight
Required
- Type: IApiEndpointHandler
The function to handle the request.
props
Optional
- Type: ApiGetProps
Options for the route.
head
head(path: str, inflight: IApiEndpointHandler, props?: ApiHeadProps): void
Add a inflight handler to the api for HEAD requests on the given path.
path
Required
- Type: str
The path to handle HEAD requests for.
inflight
Required
- Type: IApiEndpointHandler
The function to handle the request.
props
Optional
- Type: ApiHeadProps
Options for the route.
options
options(path: str, inflight: IApiEndpointHandler, props?: ApiOptionsProps): void
Add a inflight handler to the api for OPTIONS requests on the given path.
path
Required
- Type: str
The path to handle OPTIONS requests for.
inflight
Required
- Type: IApiEndpointHandler
The function to handle the request.
props
Optional
- Type: ApiOptionsProps
Options for the route.
patch
patch(path: str, inflight: IApiEndpointHandler, props?: ApiPatchProps): void
Add a inflight handler to the api for PATCH requests on the given path.
path
Required
- Type: str
The path to handle PATCH requests for.
inflight
Required
- Type: IApiEndpointHandler
The function to handle the request.
props
Optional
- Type: ApiPatchProps
Options for the route.
post
post(path: str, inflight: IApiEndpointHandler, props?: ApiPostProps): void
Add a inflight handler to the api for POST requests on the given path.
path
Required
- Type: str
The path to handle POST requests for.
inflight
Required
- Type: IApiEndpointHandler
The function to handle the request.
props
Optional
- Type: ApiPostProps
Options for the route.
put
put(path: str, inflight: IApiEndpointHandler, props?: ApiPutProps): void
Add a inflight handler to the api for PUT requests on the given path.
path
Required
- Type: str
The path to handle PUT requests for.
inflight
Required
- Type: IApiEndpointHandler
The function to handle the request.
props
Optional
- Type: ApiPutProps
Options for the route.
Properties
Name | Type | Description |
---|---|---|
node | constructs.Node | The tree node. |
display | Display | Information on how to display a resource in the UI. |
url | str | The base URL of the API endpoint. |
node
Required
node: Node;
- Type: constructs.Node
The tree node.
display
Required
display: Display;
- Type: Display
Information on how to display a resource in the UI.
url
Required
url: str;
- Type: str
The base URL of the API endpoint.
Bucket
Inflight client: @winglang/sdk.cloud.IBucketClient
Represents a cloud object store.
Initializers
bring cloud;
new cloud.Bucket(props?: BucketProps)
Name | Type | Description |
---|---|---|
props | BucketProps | No description. |
props
Optional
- Type: BucketProps
Methods
Name | Description |
---|---|
add_object | Add a file to the bucket that is uploaded when the app is deployed. |
on_create | Run an inflight whenever a file is uploaded to the bucket. |
on_delete | Run an inflight whenever a file is deleted from the bucket. |
on_event | Run an inflight whenever a file is uploaded, modified, or deleted from the bucket. |
on_update | Run an inflight whenever a file is updated in the bucket. |
add_object
add_object(key: str, body: str): void
Add a file to the bucket that is uploaded when the app is deployed.
TODO: In the future this will support uploading any Blob
type or
referencing a file from the local filesystem.
key
Required
- Type: str
body
Required
- Type: str
on_create
on_create(fn: IBucketEventHandler, opts?: BucketOnCreateProps): void
Run an inflight whenever a file is uploaded to the bucket.
fn
Required
- Type: IBucketEventHandler
opts
Optional
- Type: BucketOnCreateProps
on_delete
on_delete(fn: IBucketEventHandler, opts?: BucketOnDeleteProps): void
Run an inflight whenever a file is deleted from the bucket.
fn
Required
- Type: IBucketEventHandler
opts
Optional
- Type: BucketOnDeleteProps
on_event
on_event(fn: IBucketEventHandler, opts?: BucketOnEventProps): void
Run an inflight whenever a file is uploaded, modified, or deleted from the bucket.
fn
Required
- Type: IBucketEventHandler
opts
Optional
- Type: BucketOnEventProps
on_update
on_update(fn: IBucketEventHandler, opts?: BucketOnUpdateProps): void
Run an inflight whenever a file is updated in the bucket.
fn
Required
- Type: IBucketEventHandler
opts
Optional
- Type: BucketOnUpdateProps
Properties
Name | Type | Description |
---|---|---|
node | constructs.Node | The tree node. |
display | Display | Information on how to display a resource in the UI. |
node
Required
node: Node;
- Type: constructs.Node
The tree node.
display
Required
display: Display;
- Type: Display
Information on how to display a resource in the UI.
Counter
Inflight client: @winglang/sdk.cloud.ICounterClient
Represents a distributed atomic counter.
Initializers
bring cloud;
new cloud.Counter(props?: CounterProps)
Name | Type | Description |
---|---|---|
props | CounterProps | No description. |
props
Optional
- Type: CounterProps
Properties
Name | Type | Description |
---|---|---|
node | constructs.Node | The tree node. |
display | Display | Information on how to display a resource in the UI. |
initial | num | The initial value of the counter. |
node
Required
node: Node;
- Type: constructs.Node
The tree node.
display
Required
display: Display;
- Type: Display
Information on how to display a resource in the UI.
initial
Required
initial: num;
- Type: num
The initial value of the counter.
Function
- Implements: IInflightHost
Inflight client: @winglang/sdk.cloud.IFunctionClient
Represents a function.
Initializers
bring cloud;
new cloud.Function(inflight: IFunctionHandler, props?: FunctionProps)
Name | Type | Description |
---|---|---|
inflight | IFunctionHandler | No description. |
props | FunctionProps | No description. |
inflight
Required
- Type: IFunctionHandler
props
Optional
- Type: FunctionProps
Methods
Name | Description |
---|---|
add_environment | Add an environment variable to the function. |
add_environment
add_environment(name: str, value: str): void
Add an environment variable to the function.
name
Required
- Type: str
value
Required
- Type: str
Properties
Name | Type | Description |
---|---|---|
node | constructs.Node | The tree node. |
display | Display | Information on how to display a resource in the UI. |
env | MutMap<str> | Returns the set of environment variables for this function. |
node
Required
node: Node;
- Type: constructs.Node
The tree node.
display
Required
display: Display;
- Type: Display
Information on how to display a resource in the UI.
env
Required
env: MutMap<str>;
- Type: MutMap<str>
Returns the set of environment variables for this function.
Queue
Inflight client: @winglang/sdk.cloud.IQueueClient
Represents a queue.
Initializers
bring cloud;
new cloud.Queue(props?: QueueProps)
Name | Type | Description |
---|---|---|
props | QueueProps | No description. |
props
Optional
- Type: QueueProps
Methods
Name | Description |
---|---|
add_consumer | Create a function to consume messages from this queue. |
add_consumer
add_consumer(handler: IQueueAddConsumerHandler, props?: QueueAddConsumerProps): Function
Create a function to consume messages from this queue.
handler
Required
- Type: IQueueAddConsumerHandler
props
Optional
- Type: QueueAddConsumerProps
Properties
Name | Type | Description |
---|---|---|
node | constructs.Node | The tree node. |
display | Display | Information on how to display a resource in the UI. |
node
Required
node: Node;
- Type: constructs.Node
The tree node.
display
Required
display: Display;
- Type: Display
Information on how to display a resource in the UI.
Resource
- Implements: IResource
Shared behavior between all Wing SDK resources.
Initializers
bring std;
new std.Resource()
Name | Type | Description |
---|
Properties
Name | Type | Description |
---|---|---|
node | constructs.Node | The tree node. |
display | Display | Information on how to display a resource in the UI. |
node
Required
node: Node;
- Type: constructs.Node
The tree node.
display
Required
display: Display;
- Type: Display
Information on how to display a resource in the UI.
Schedule
Inflight client: @winglang/sdk.cloud.IScheduleClient
Represents a schedule.
Initializers
bring cloud;
new cloud.Schedule(props?: ScheduleProps)
Name | Type | Description |
---|---|---|
props | ScheduleProps | No description. |
props
Optional
- Type: ScheduleProps
Methods
Name | Description |
---|---|
on_tick | Create a function that runs when receiving the scheduled event. |
on_tick
on_tick(inflight: IScheduleOnTickHandler, props?: ScheduleOnTickProps): Function
Create a function that runs when receiving the scheduled event.
inflight
Required
- Type: IScheduleOnTickHandler
props
Optional
- Type: ScheduleOnTickProps
Properties
Name | Type | Description |
---|---|---|
node | constructs.Node | The tree node. |
display | Display | Information on how to display a resource in the UI. |
node
Required
node: Node;
- Type: constructs.Node
The tree node.
display
Required
display: Display;
- Type: Display
Information on how to display a resource in the UI.
Secret
Inflight client: @winglang/sdk.cloud.ISecretClient
Represents a cloud secret.
Initializers
bring cloud;
new cloud.Secret(props?: SecretProps)
Name | Type | Description |
---|---|---|
props | SecretProps | No description. |
props
Optional
- Type: SecretProps
Properties
Name | Type | Description |
---|---|---|
node | constructs.Node | The tree node. |
display | Display | Information on how to display a resource in the UI. |
node
Required
node: Node;
- Type: constructs.Node
The tree node.
display
Required
display: Display;
- Type: Display
Information on how to display a resource in the UI.
Table
Inflight client: @winglang/sdk.cloud.ITableClient
Represents a NoSQL database table that can be used to store and query data.
Initializers
bring cloud;
new cloud.Table(props: TableProps)
Name | Type | Description |
---|---|---|
props | TableProps | No description. |
props
Required
- Type: TableProps
Properties
Name | Type | Description |
---|---|---|
node | constructs.Node | The tree node. |
display | Display | Information on how to display a resource in the UI. |
columns | MutMap<ColumnType> | Table columns. |
name | str | Table name. |
primary_key | str | Table primary key name. |
node
Required
node: Node;
- Type: constructs.Node
The tree node.
display
Required
display: Display;
- Type: Display
Information on how to display a resource in the UI.
columns
Required
columns: MutMap<ColumnType>;
- Type: MutMap<ColumnType>
Table columns.
name
Required
name: str;
- Type: str
Table name.
primary_key
Required
primary_key: str;
- Type: str
Table primary key name.
TestRunner
Inflight client: @winglang/sdk.cloud.ITestRunnerClient
Represents a test engine.
Initializers
bring cloud;
new cloud.TestRunner(props?: TestRunnerProps)
Name | Type | Description |
---|---|---|
props | TestRunnerProps | No description. |
props
Optional
- Type: TestRunnerProps
Methods
Name | Description |
---|---|
find_tests | Find all tests in the construct tree. |
find_tests
find_tests(): MutArray<Function>
Find all tests in the construct tree.
Currently these are all
cloud.Function
resources with a path that ends in /test
or
/test:<name>
.
Static Functions
Name | Description |
---|---|
is_test | Returns whether a construct represents a runnable test. |
is_test
bring cloud;
cloud.TestRunner.is_test(c: IConstruct)
Returns whether a construct represents a runnable test.
c
Required
- Type: constructs.IConstruct
A construct.
Properties
Name | Type | Description |
---|---|---|
node | constructs.Node | The tree node. |
display | Display | Information on how to display a resource in the UI. |
node
Required
node: Node;
- Type: constructs.Node
The tree node.
display
Required
display: Display;
- Type: Display
Information on how to display a resource in the UI.
Topic
Inflight client: @winglang/sdk.cloud.ITopicClient
Represents a topic.
Initializers
bring cloud;
new cloud.Topic(props?: TopicProps)
Name | Type | Description |
---|---|---|
props | TopicProps | No description. |
props
Optional
- Type: TopicProps
Methods
Name | Description |
---|---|
on_message | Run an inflight whenever an message is published to the topic. |
on_message
on_message(inflight: ITopicOnMessageHandler, props?: TopicOnMessageProps): Function
Run an inflight whenever an message is published to the topic.
inflight
Required
- Type: ITopicOnMessageHandler
props
Optional
- Type: TopicOnMessageProps
Properties
Name | Type | Description |
---|---|---|
node | constructs.Node | The tree node. |
display | Display | Information on how to display a resource in the UI. |
node
Required
node: Node;
- Type: constructs.Node
The tree node.
display
Required
display: Display;
- Type: Display
Information on how to display a resource in the UI.
Structs
AddConnectionProps
Props for Resource.addConnection
.
Initializer
bring std;
let add_connection_props = std.AddConnectionProps{ ... }
Properties
Name | Type | Description |
---|---|---|
from | IResource | The resource creating the connection to to . |
relationship | str | The type of relationship between the resources. |
to | IResource | The resource from is connecting to. |
implicit | bool | Whether the relationship is implicit, i.e. it is not explicitly defined by the user. |
from
Required
from: IResource;
- Type: IResource
The resource creating the connection to to
.
relationship
Required
relationship: str;
- Type: str
The type of relationship between the resources.
to
Required
to: IResource;
- Type: IResource
The resource from
is connecting to.
implicit
Optional
implicit: bool;
- Type: bool
- Default: false
Whether the relationship is implicit, i.e. it is not explicitly defined by the user.
ApiConnectProps
Options for Api patch endpoint.
Initializer
bring cloud;
let api_connect_props = cloud.ApiConnectProps{ ... }
ApiDeleteProps
Options for Api put endpoint.
Initializer
bring cloud;
let api_delete_props = cloud.ApiDeleteProps{ ... }
ApiGetProps
Options for Api get endpoint.
Initializer
bring cloud;
let api_get_props = cloud.ApiGetProps{ ... }
ApiHeadProps
Options for Api patch endpoint.
Initializer
bring cloud;
let api_head_props = cloud.ApiHeadProps{ ... }
ApiOptionsProps
Options for Api patch endpoint.
Initializer
bring cloud;
let api_options_props = cloud.ApiOptionsProps{ ... }
ApiPatchProps
Options for Api patch endpoint.
Initializer
bring cloud;
let api_patch_props = cloud.ApiPatchProps{ ... }
ApiPostProps
Options for Api post endpoint.
Initializer
bring cloud;
let api_post_props = cloud.ApiPostProps{ ... }
ApiProps
Properties for Api
.
Initializer
bring cloud;
let api_props = cloud.ApiProps{ ... }
ApiPutProps
Options for Api put endpoint.
Initializer
bring cloud;
let api_put_props = cloud.ApiPutProps{ ... }
ApiRequest
Shape of a request to an inflight handler.
Initializer
bring cloud;
let api_request = cloud.ApiRequest{ ... }
Properties
Name | Type | Description |
---|---|---|
method | HttpMethod | The request's HTTP method. |
path | str | The request's path. |
query | MutMap<str> | The request's query string values. |
body | json | The request's body. |
headers | MutMap<str> | The request's headers. |
vars | MutMap<str> | The path variables. |
method
Required
method: HttpMethod;
- Type: HttpMethod
The request's HTTP method.
path
Required
path: str;
- Type: str
The request's path.
query
Required
query: MutMap<str>;
- Type: MutMap<str>
The request's query string values.
body
Optional
body: json;
- Type: json
The request's body.
headers
Optional
headers: MutMap<str>;
- Type: MutMap<str>
The request's headers.
vars
Optional
vars: MutMap<str>;
- Type: MutMap<str>
The path variables.
ApiResponse
Shape of a response from a inflight handler.
Initializer
bring cloud;
let api_response = cloud.ApiResponse{ ... }
Properties
Name | Type | Description |
---|---|---|
status | num | The response's status code. |
body | json | The response's body. |
headers | MutMap<str> | The response's headers. |
status
Required
status: num;
- Type: num
The response's status code.
body
Optional
body: json;
- Type: json
The response's body.
headers
Optional
headers: MutMap<str>;
- Type: MutMap<str>
The response's headers.
BucketDeleteOptions
Interface for delete method inside Bucket
.
Initializer
bring cloud;
let bucket_delete_options = cloud.BucketDeleteOptions{ ... }
Properties
Name | Type | Description |
---|---|---|
must_exist | bool | Check failures on the method and retrieve errors if any. |
must_exist
Optional
must_exist: bool;
- Type: bool
- Default: false
Check failures on the method and retrieve errors if any.
BucketEvent
on_event notification payload- will be in use after solving issue: https://github.com/winglang/wing/issues/1927.
Initializer
bring cloud;
let bucket_event = cloud.BucketEvent{ ... }
Properties
Name | Type | Description |
---|---|---|
key | str | the bucket key that triggered the event. |
type | BucketEventType | type of event. |
key
Required
key: str;
- Type: str
the bucket key that triggered the event.
type
Required
type: BucketEventType;
- Type: BucketEventType
type of event.
BucketOnCreateProps
on create event options.
Initializer
bring cloud;
let bucket_on_create_props = cloud.BucketOnCreateProps{ ... }
BucketOnDeleteProps
on delete event options.
Initializer
bring cloud;
let bucket_on_delete_props = cloud.BucketOnDeleteProps{ ... }
BucketOnEventProps
on any event options.
Initializer
bring cloud;
let bucket_on_event_props = cloud.BucketOnEventProps{ ... }
BucketOnUpdateProps
on update event options.
Initializer
bring cloud;
let bucket_on_update_props = cloud.BucketOnUpdateProps{ ... }
BucketProps
Properties for Bucket
.
Initializer
bring cloud;
let bucket_props = cloud.BucketProps{ ... }
Properties
Name | Type | Description |
---|---|---|
public | bool | Whether the bucket's objects should be publicly accessible. |
public
Optional
public: bool;
- Type: bool
- Default: false
Whether the bucket's objects should be publicly accessible.
Connection
A connection between two resources.
Initializer
bring std;
let connection = std.Connection{ ... }
Properties
Name | Type | Description |
---|---|---|
direction | Direction | The direction of the connection. |
implicit | bool | Whether the relationship is implicit, i.e. it is not explicitly defined by the user. |
relationship | str | The type of relationship with the resource. |
resource | IResource | The resource this connection is to. |
direction
Required
direction: Direction;
- Type: Direction
The direction of the connection.
implicit
Required
implicit: bool;
- Type: bool
Whether the relationship is implicit, i.e. it is not explicitly defined by the user.
relationship
Required
relationship: str;
- Type: str
The type of relationship with the resource.
resource
Required
resource: IResource;
- Type: IResource
The resource this connection is to.
CounterProps
Properties for Counter
.
Initializer
bring cloud;
let counter_props = cloud.CounterProps{ ... }
Properties
Name | Type | Description |
---|---|---|
initial | num | The initial value of the counter. |
initial
Optional
initial: num;
- Type: num
- Default: 0
The initial value of the counter.
DisplayProps
Properties for the Display class.
Initializer
bring std;
let display_props = std.DisplayProps{ ... }
Properties
Name | Type | Description |
---|---|---|
description | str | Description of the resource. |
hidden | bool | Whether the resource should be hidden from the UI. |
title | str | Title of the resource. |
description
Optional
description: str;
- Type: str
- Default: No description.
Description of the resource.
hidden
Optional
hidden: bool;
- Type: bool
- Default: Undefined
Whether the resource should be hidden from the UI.
title
Optional
title: str;
- Type: str
- Default: No title.
Title of the resource.
FunctionProps
Properties for Function
.
This is the type users see when constructing a cloud.Function instance.
Initializer
bring cloud;
let function_props = cloud.FunctionProps{ ... }
Properties
Name | Type | Description |
---|---|---|
env | MutMap<str> | Environment variables to pass to the function. |
memory | num | The amount of memory to allocate to the function, in MB. |
timeout | Duration | The maximum amount of time the function can run. |
env
Optional
env: MutMap<str>;
- Type: MutMap<str>
- Default: No environment variables.
Environment variables to pass to the function.
memory
Optional
memory: num;
- Type: num
- Default: 128
The amount of memory to allocate to the function, in MB.
timeout
Optional
timeout: Duration;
- Type: Duration
- Default: 1m
The maximum amount of time the function can run.
GetSecretValueOptions
Options when getting a secret value.
Initializer
bring cloud;
let get_secret_value_options = cloud.GetSecretValueOptions{ ... }
Properties
Name | Type | Description |
---|---|---|
cache | bool | Whether to cache the value. |
cache
Optional
cache: bool;
- Type: bool
- Default: true
Whether to cache the value.
QueueAddConsumerProps
Options for Queue.addConsumer.
Initializer
bring cloud;
let queue_add_consumer_props = cloud.QueueAddConsumerProps{ ... }
Properties
Name | Type | Description |
---|---|---|
env | MutMap<str> | Environment variables to pass to the function. |
memory | num | The amount of memory to allocate to the function, in MB. |
timeout | Duration | The maximum amount of time the function can run. |
batch_size | num | The maximum number of messages to send to subscribers at once. |
env
Optional
env: MutMap<str>;
- Type: MutMap<str>
- Default: No environment variables.
Environment variables to pass to the function.
memory
Optional
memory: num;
- Type: num
- Default: 128
The amount of memory to allocate to the function, in MB.
timeout
Optional
timeout: Duration;
- Type: Duration
- Default: 1m
The maximum amount of time the function can run.
batch_size
Optional
batch_size: num;
- Type: num
- Default: 1
The maximum number of messages to send to subscribers at once.
QueueProps
Properties for Queue
.
Initializer
bring cloud;
let queue_props = cloud.QueueProps{ ... }
Properties
Name | Type | Description |
---|---|---|
initial_messages | MutArray<str> | Initialize the queue with a set of messages. |
retention_period | Duration | How long a queue retains a message. |
timeout | Duration | How long a queue's consumers have to process a message. |
initial_messages
Optional
initial_messages: MutArray<str>;
- Type: MutArray<str>
- Default: []
Initialize the queue with a set of messages.
retention_period
Optional
retention_period: Duration;
- Type: Duration
- Default: undefined
How long a queue retains a message.
timeout
Optional
timeout: Duration;
- Type: Duration
- Default: undefined
How long a queue's consumers have to process a message.
ScheduleOnTickProps
Options for Schedule.onTick.
Initializer
bring cloud;
let schedule_on_tick_props = cloud.ScheduleOnTickProps{ ... }
Properties
Name | Type | Description |
---|---|---|
env | MutMap<str> | Environment variables to pass to the function. |
memory | num | The amount of memory to allocate to the function, in MB. |
timeout | Duration | The maximum amount of time the function can run. |
env
Optional
env: MutMap<str>;
- Type: MutMap<str>
- Default: No environment variables.
Environment variables to pass to the function.
memory
Optional
memory: num;
- Type: num
- Default: 128
The amount of memory to allocate to the function, in MB.
timeout
Optional
timeout: Duration;
- Type: Duration
- Default: 1m
The maximum amount of time the function can run.
ScheduleProps
Properties for Schedule
.
Initializer
bring cloud;
let schedule_props = cloud.ScheduleProps{ ... }
Properties
Name | Type | Description |
---|---|---|
cron | str | Trigger events according to a cron schedule using the UNIX cron format. |
rate | Duration | Trigger events at a periodic rate. |
cron
Optional
cron: str;
- Type: str
- Default: undefined
Trigger events according to a cron schedule using the UNIX cron format.
[minute][hour] [day of month][month] [day of week]
Example
"0/1 * ? * *"
rate
Optional
rate: Duration;
- Type: Duration
- Default: undefined
Trigger events at a periodic rate.
Example
1m
SecretProps
Properties for Secret
.
Initializer
bring cloud;
let secret_props = cloud.SecretProps{ ... }
Properties
Name | Type | Description |
---|---|---|
name | str | The secret's name. |
name
Optional
name: str;
- Type: str
- Default: a new secret is provisioned with a generated name
The secret's name.
If no name is provided then a new secret is provisioned in the target. If a name is provided then the resource will reference an existing secret in the target.
TableProps
Properties for Table
.
Initializer
bring cloud;
let table_props = cloud.TableProps{ ... }
Properties
Name | Type | Description |
---|---|---|
columns | MutMap<ColumnType> | The table's columns. |
name | str | The table's name. |
primary_key | str | The table's primary key. |
columns
Optional
columns: MutMap<ColumnType>;
- Type: MutMap<ColumnType>
- Default: undefined
The table's columns.
name
Optional
name: str;
- Type: str
- Default: undefined
The table's name.
primary_key
Optional
primary_key: str;
- Type: str
- Default: undefined
The table's primary key.
No two rows can have the same value for the primary key.
TestResult
A result of a single test.
Initializer
bring cloud;
let test_result = cloud.TestResult{ ... }
Properties
Name | Type | Description |
---|---|---|
pass | bool | Whether the test passed. |
path | str | The path of the test. |
traces | MutArray<Trace> | List of traces emitted during the test. |
error | str | The error message if the test failed. |
pass
Required
pass: bool;
- Type: bool
Whether the test passed.
path
Required
path: str;
- Type: str
The path of the test.
traces
Required
traces: MutArray<Trace>;
- Type: MutArray<Trace>
List of traces emitted during the test.
error
Optional
error: str;
- Type: str
The error message if the test failed.
TestRunnerProps
Properties for TestRunner
.
Initializer
bring cloud;
let test_runner_props = cloud.TestRunnerProps{ ... }
TopicOnMessageProps
Options for Topic.onMessage
.
Initializer
bring cloud;
let topic_on_message_props = cloud.TopicOnMessageProps{ ... }
Properties
Name | Type | Description |
---|---|---|
env | MutMap<str> | Environment variables to pass to the function. |
memory | num | The amount of memory to allocate to the function, in MB. |
timeout | Duration | The maximum amount of time the function can run. |
env
Optional
env: MutMap<str>;
- Type: MutMap<str>
- Default: No environment variables.
Environment variables to pass to the function.
memory
Optional
memory: num;
- Type: num
- Default: 128
The amount of memory to allocate to the function, in MB.
timeout
Optional
timeout: Duration;
- Type: Duration
- Default: 1m
The maximum amount of time the function can run.
TopicProps
Properties for Topic
.
Initializer
bring cloud;
let topic_props = cloud.TopicProps{ ... }
Trace
Represents an trace emitted during simulation.
Initializer
bring cloud;
let trace = cloud.Trace{ ... }
Properties
Name | Type | Description |
---|---|---|
data | any | A JSON blob with structured data. |
source_path | str | The path of the resource that emitted the trace. |
source_type | str | The type of the source that emitted the trace. |
timestamp | str | The timestamp of the event, in ISO 8601 format. |
type | TraceType | The type of a trace. |
data
Required
data: any;
- Type: any
A JSON blob with structured data.
source_path
Required
source_path: str;
- Type: str
The path of the resource that emitted the trace.
source_type
Required
source_type: str;
- Type: str
The type of the source that emitted the trace.
timestamp
Required
timestamp: str;
- Type: str
The timestamp of the event, in ISO 8601 format.
Example
2020-01-01T00:00:00.000Z
type
Required
type: TraceType;
- Type: TraceType
The type of a trace.
Classes
Boolean
Boolean.
Initializers
bring std;
new std.Boolean()
Name | Type | Description |
---|
Static Functions
Name | Description |
---|---|
from_json | Parse a boolean from Json. |
from_json
bring std;
std.Boolean.from_json(json: Json)
Parse a boolean from Json.
json
Required
- Type: Json
to parse boolean from.
CounterClientBase
- Implements: ICounterClient
Functionality shared between all CounterClient
implementations regardless of the target.
Initializers
bring cloud;
new cloud.CounterClientBase()
Name | Type | Description |
---|
Methods
Name | Description |
---|---|
dec | Decrement the counter, returning the previous value. |
inc | Increments the counter atomically by a certain amount and returns the previous value. |
peek | Get the current value of the counter. |
reset | Reset a counter to a given value. |
dec
dec(amount?: num): num
Decrement the counter, returning the previous value.
amount
Optional
- Type: num
inc
inc(amount?: num): num
Increments the counter atomically by a certain amount and returns the previous value.
amount
Optional
- Type: num
peek
peek(): num
Get the current value of the counter.
Using this API may introduce race conditions since the value can change between the time it is read and the time it is used in your code.
reset
reset(value?: num): void
Reset a counter to a given value.
value
Optional
- Type: num
Display
Information on how to display a resource in the UI.
Initializers
bring std;
new std.Display(props?: DisplayProps)
Name | Type | Description |
---|---|---|
props | DisplayProps | No description. |
props
Optional
- Type: DisplayProps
Properties
Name | Type | Description |
---|---|---|
description | str | Description of the resource. |
hidden | bool | Whether the resource should be hidden from the UI. |
title | str | Title of the resource. |
description
Optional
description: str;
- Type: str
Description of the resource.
hidden
Optional
hidden: bool;
- Type: bool
Whether the resource should be hidden from the UI.
title
Optional
title: str;
- Type: str
Title of the resource.
Duration
Represents a length of time.
Static Functions
Name | Description |
---|---|
from_hours | Create a Duration representing an amount of hours. |
from_minutes | Create a Duration representing an amount of minutes. |
from_seconds | Create a Duration representing an amount of seconds. |
from_hours
bring std;
std.Duration.from_hours(amount: num)
Create a Duration representing an amount of hours.
amount
Required
- Type: num
the amount of Hours the Duration
will represent.
from_minutes
bring std;
std.Duration.from_minutes(amount: num)
Create a Duration representing an amount of minutes.
amount
Required
- Type: num
the amount of Minutes the Duration
will represent.
from_seconds
bring std;
std.Duration.from_seconds(amount: num)
Create a Duration representing an amount of seconds.
amount
Required
- Type: num
the amount of Seconds the Duration
will represent.
Properties
Name | Type | Description |
---|---|---|
hours | num | Return the total number of hours in this Duration. |
minutes | num | Return the total number of minutes in this Duration. |
seconds | num | Return the total number of seconds in this Duration. |
hours
Required
hours: num;
- Type: num
Return the total number of hours in this Duration.
minutes
Required
minutes: num;
- Type: num
Return the total number of minutes in this Duration.
seconds
Required
seconds: num;
- Type: num
Return the total number of seconds in this Duration.
ImmutableArray
Immutable Array.
Initializers
bring std;
new std.ImmutableArray()
Name | Type | Description |
---|
Methods
Name | Description |
---|---|
at | Get the value at the given index. |
concat | Merge arr to the end of this array. |
contains | Checks if this array includes searchElement. |
copy_mut | Create a mutable shallow copy of this array. |
index_of | Returns the index of the first occurrence of searchElement found. |
join | Returns a new string containing the concatenated values in this array, separated by commas or a specified separator string. |
last_index_of | Returns the index of the last occurrence of searchElement found. |
at
at(index: num): T1
Get the value at the given index.
index
Required
- Type: num
index of the value to get.
concat
concat(arr: ImmutableArray): ImmutableArray
Merge arr to the end of this array.
arr
Required
- Type: ImmutableArray
array to merge.
contains
contains(search_element: T1): bool
Checks if this array includes searchElement.
search_element
Required
- Type: T1
to search for.
copy_mut
copy_mut(): MutableArray
Create a mutable shallow copy of this array.
index_of
index_of(search_element: T1): num
Returns the index of the first occurrence of searchElement found.
search_element
Required
- Type: T1
to search for.
join
join(separator?: str): str
Returns a new string containing the concatenated values in this array, separated by commas or a specified separator string.
If the array has only one item, then that item will be returned without using the separator.
separator
Optional
- Type: str
last_index_of
last_index_of(search_element: T1): num
Returns the index of the last occurrence of searchElement found.
search_element
Required
- Type: T1
to search for.
Properties
Name | Type | Description |
---|---|---|
length | num | The length of the array. |
length
Required
length: num;
- Type: num
The length of the array.
ImmutableMap
Immutable Map.
Initializers
bring std;
new std.ImmutableMap()
Name | Type | Description |
---|
Methods
Name | Description |
---|---|
copy_mut | Create a mutable shallow copy of this map. |
get | Returns a specified element from the map. |
has | Returns a boolean indicating whether an element with the specified key exists or not. |
keys | Returns the keys of this map. |
size | Returns the number of elements in the map. |
copy_mut
copy_mut(): MutableMap
Create a mutable shallow copy of this map.
get
get(key: str): T1
Returns a specified element from the map.
If the value that is associated to the provided key is an object, then you will get a reference to that object and any change made to that object will effectively modify it inside the map.
key
Required
- Type: str
The key of the element to return.
has
has(key: str): bool
Returns a boolean indicating whether an element with the specified key exists or not.
key
Required
- Type: str
The key of the element to test for presence.
keys
keys(): ImmutableArray
Returns the keys of this map.
size
size(): num
Returns the number of elements in the map.
TODO: For now this has to be a method rather than a getter as macros only work on methods https://github.com/winglang/wing/issues/1658
ImmutableSet
Immutable Set.
Initializers
bring std;
new std.ImmutableSet()
Name | Type | Description |
---|
Methods
Name | Description |
---|---|
copy_mut | Create a mutable shallow copy of this set. |
has | Returns a boolean indicating whether an element with the specified value exists in the set. |
copy_mut
copy_mut(): MutableSet
Create a mutable shallow copy of this set.
has
has(value: T1): bool
Returns a boolean indicating whether an element with the specified value exists in the set.
value
Required
- Type: T1
The value to test for presence in the Set object.
Properties
Name | Type | Description |
---|---|---|
size | num | The length of the set. |
size
Required
size: num;
- Type: num
The length of the set.
Json
Immutable Json.
Initializers
bring std;
new std.Json()
Name | Type | Description |
---|
Methods
Name | Description |
---|---|
get | Returns a specified element from the Json. |
get_at | Returns a specified element at a given index from Json Array. |
get
get(key: str): Json
Returns a specified element from the Json.
key
Required
- Type: str
The key of the element to return.
get_at
get_at(index: num): Json
Returns a specified element at a given index from Json Array.
index
Required
- Type: num
The index of the element in the Json Array to return.
Static Functions
Name | Description |
---|---|
clone | Creates a immutable deep clone of the Json. |
clone_mut | Creates a mutable deep clone of the Json. |
delete | Deletes a key in a given Json. |
keys | Returns the keys from the Json object. |
parse | Parse a string into a Json. |
stringify | Formats Json as string. |
try_parse | Try to parse a string into a Json. |
values | Returns the values from the Json. |
clone
bring std;
std.Json.clone(json: Json)
Creates a immutable deep clone of the Json.
json
Required
- Type: Json
to clone.
clone_mut
bring std;
std.Json.clone_mut(json: Json)
Creates a mutable deep clone of the Json.
json
Required
- Type: Json
to clone.
delete
bring std;
std.Json.delete(json: Json, key: str)
Deletes a key in a given Json.
json
Required
- Type: Json
to delete key from.
key
Required
- Type: str
the key to delete.
keys
bring std;
std.Json.keys(json: Json)
Returns the keys from the Json object.
json
Required
- Type: Json
to get keys from.
parse
bring std;
std.Json.parse(str: str)
Parse a string into a Json.
str
Required
- Type: str
to parse as Json.
stringify
bring std;
std.Json.stringify(json: Json, indent?: num)
Formats Json as string.
(JSON.stringify($args$))
json
Required
- Type: Json
to format as string.
indent
Optional
- Type: num
try_parse
bring std;
std.Json.try_parse(str: str)
Try to parse a string into a Json.
str
Required
- Type: str
to parse as Json.
values
bring std;
std.Json.values(json: Json)
Returns the values from the Json.
json
Required
- Type: Json
to get values from.
MutableArray
Mutable Array.
Initializers
bring std;
new std.MutableArray()
Name | Type | Description |
---|
Methods
Name | Description |
---|---|
at | Get the value at the given index. |
concat | Merge arr to the end of this array. |
contains | Checks if this array includes searchElement. |
copy | Create an immutable shallow copy of this array. |
index_of | Returns the index of the first occurrence of searchElement found. |
join | Returns a new string containing the concatenated values in this array, separated by commas or a specified separator string. |
last_index_of | Returns the index of the last occurrence of searchElement found. |
pop | Remove value from end of array. |
push | Add value to end of array. |
at
at(index: num): T1
Get the value at the given index.
index
Required
- Type: num
index of the value to get.
concat
concat(arr: MutableArray): MutableArray
Merge arr to the end of this array.
arr
Required
- Type: MutableArray
array to merge.
contains
contains(search_element: T1): bool
Checks if this array includes searchElement.
search_element
Required
- Type: T1
to search for.
copy
copy(): ImmutableArray
Create an immutable shallow copy of this array.
index_of
index_of(search_element: T1): num
Returns the index of the first occurrence of searchElement found.
search_element
Required
- Type: T1
to search for.
join
join(separator?: str): str
Returns a new string containing the concatenated values in this array, separated by commas or a specified separator string.
If the array has only one item, then that item will be returned without using the separator.
separator
Optional
- Type: str
last_index_of
last_index_of(search_element: T1): num
Returns the index of the last occurrence of searchElement found.
search_element
Required
- Type: T1
to search for.
pop
pop(): T1
Remove value from end of array.
push
push(value: T1): void
Add value to end of array.
value
Required
- Type: T1
value to add.
Properties
Name | Type | Description |
---|---|---|
length | num | The length of the array. |
length
Required
length: num;
- Type: num
The length of the array.
MutableMap
Mutable Map.
Initializers
bring std;
new std.MutableMap()
Name | Type | Description |
---|
Methods
Name | Description |
---|---|
clear | Removes all elements. |
copy | Create an immutable shallow copy of this map. |
delete | Removes the specified element from a map. |
get | Returns a specified element from the map. |
has | Returns a boolean indicating whether an element with the specified key exists or not. |
set | Adds or updates an entry in a Map object with a specified key and a value. |
size | Returns the number of elements in the map. |
clear
clear(): void
Removes all elements.
copy
copy(): ImmutableMap
Create an immutable shallow copy of this map.
delete
delete(key: str): bool
Removes the specified element from a map.
key
Required
- Type: str
The key.
get
get(key: str): T1
Returns a specified element from the map.
If the value that is associated to the provided key is an object, then you will get a reference to that object and any change made to that object will effectively modify it inside the map.
key
Required
- Type: str
The key of the element to return.
has
has(key: str): bool
Returns a boolean indicating whether an element with the specified key exists or not.
key
Required
- Type: str
The key of the element to test for presence.
set
set(key: str, value: T1): void
Adds or updates an entry in a Map object with a specified key and a value.
TODO: revisit this macro after we support indexed args https://github.com/winglang/wing/issues/1659
key
Required
- Type: str
The key of the element to add.
value
Required
- Type: T1
The value of the element to add.
size
size(): num
Returns the number of elements in the map.
TODO: For now this has to be a method rather than a getter as macros only work on methods https://github.com/winglang/wing/issues/1658
MutableSet
Mutable Set.
Initializers
bring std;
new std.MutableSet()
Name | Type | Description |
---|
Methods
Name | Description |
---|---|
add | Add value to set. |
clear | The clear() method removes all elements from a set. |
copy | Create an immutable shallow copy of this set. |
delete | Removes a specified value from a set, if it is in the set. |
has | Returns a boolean indicating whether an element with the specified value exists in the set. |
add
add(value: T1): MutableSet
Add value to set.
value
Required
- Type: T1
value to add.
clear
clear(): void
The clear() method removes all elements from a set.
copy
copy(): ImmutableSet
Create an immutable shallow copy of this set.
delete
delete(value: T1): bool
Removes a specified value from a set, if it is in the set.
value
Required
- Type: T1
The value to remove from the set.
has
has(value: T1): bool
Returns a boolean indicating whether an element with the specified value exists in the set.
value
Required
- Type: T1
The value to test for presence in the Set object.
Properties
Name | Type | Description |
---|---|---|
size | num | The length of the set. |
size
Required
size: num;
- Type: num
The length of the set.
MutJson
Mutable Json.
Initializers
bring std;
new std.MutJson()
Name | Type | Description |
---|
Methods
Name | Description |
---|---|
get | Returns a specified element from the Json. |
get_at | Returns a specified element at a given index from MutJson Array. |
set | Adds or updates an element in MutJson with a specific key and value. |
set_at | Set element in MutJson Array with a specific key and value. |
get
get(key: str): MutJson
Returns a specified element from the Json.
key
Required
- Type: str
The key of the element to return.
get_at
get_at(index: num): MutJson
Returns a specified element at a given index from MutJson Array.
index
Required
- Type: num
The index of the element in the MutJson Array to return.
set
set(key: str, value: any): void
Adds or updates an element in MutJson with a specific key and value.
key
Required
- Type: str
The key of the element to add.
value
Required
- Type: any
The value of the element to add.
set_at
set_at(index: num, value: any): void
Set element in MutJson Array with a specific key and value.
index
Required
- Type: num
value
Required
- Type: any
The value of the element to set.
Number
Number.
Initializers
bring std;
new std.Number()
Name | Type | Description |
---|
Static Functions
Name | Description |
---|---|
from_json | Parse a number from Json. |
from_str | Parse a number from string. |
from_json
bring std;
std.Number.from_json(json: Json)
Parse a number from Json.
json
Required
- Type: Json
to parse number from.
from_str
bring std;
std.Number.from_str(str: str)
Parse a number from string.
str
Required
- Type: str
to parse number from.
Range
Range.
Initializers
bring std;
new std.Range()
Name | Type | Description |
---|
String
String.
Initializers
bring std;
new std.String()
Name | Type | Description |
---|
Methods
Name | Description |
---|---|
at | Returns the character at the specified index. |
concat | Combines the text of two (or more) strings and returns a new string. |
contains | Checks if string includes substring. |
ends_with | Does this string end with the given searchString? |
index_of | Returns the index of the first occurrence of searchString found. |
lowercase | Returns this string in lower case. |
split | Splits string by separator. |
starts_with | Does this string start with the given searchString? |
substring | Returns a string between indexStart, indexEnd. |
trim | Removes white spaces from start and end of this string. |
uppercase | Returns this string in upper case. |
at
at(index: num): str
Returns the character at the specified index.
index
Required
- Type: num
position of the character.
concat
concat(str_n: str): str
Combines the text of two (or more) strings and returns a new string.
str_n
Required
- Type: str
one or more strings to concatenate to this string.
contains
contains(search_string: str): bool
Checks if string includes substring.
search_string
Required
- Type: str
substring to search for.
ends_with
ends_with(search_string: str): bool
Does this string end with the given searchString?
search_string
Required
- Type: str
substring to search for.
index_of
index_of(search_string: str): num
Returns the index of the first occurrence of searchString found.
search_string
Required
- Type: str
substring to search for.
lowercase
lowercase(): str
Returns this string in lower case.
split
split(separator: str): MutArray<str>
Splits string by separator.
separator
Required
- Type: str
separator to split by.
starts_with
starts_with(search_string: str): bool
Does this string start with the given searchString?
search_string
Required
- Type: str
substring to search for.
substring
substring(index_start: num, index_end?: num): str
Returns a string between indexStart, indexEnd.
index_start
Required
- Type: num
index of the character we slice at.
index_end
Optional
- Type: num
optional - index of the character we end slicing at.
trim
trim(): str
Removes white spaces from start and end of this string.
uppercase
uppercase(): str
Returns this string in upper case.
Static Functions
Name | Description |
---|---|
from_json | Parse string from Json. |
from_json
bring std;
std.String.from_json(json: Json)
Parse string from Json.
json
Required
- Type: Json
to create string from.
Properties
Name | Type | Description |
---|---|---|
length | num | The length of the string. |
length
Required
length: num;
- Type: num
The length of the string.
T1
Generic type argument.
This type is replaced at compile time.
Initializers
bring std;
new std.T1()
Name | Type | Description |
---|
Protocols
IApiClient
- Implemented By: IApiClient
Inflight methods and members of cloud.Api
.
IApiEndpointHandler
Extends: IResource
Implemented By: IApiEndpointHandler
Inflight client: @winglang/sdk.cloud.IApiEndpointHandlerClient
Represents a resource with an inflight "handle" method that can be passed to one of the Api
request preflight methods.
Properties
Name | Type | Description |
---|---|---|
node | constructs.Node | The tree node. |
display | Display | Information on how to display a resource in the UI. |
node
Required
node: Node;
- Type: constructs.Node
The tree node.
display
Required
display: Display;
- Type: Display
Information on how to display a resource in the UI.
IApiEndpointHandlerClient
- Implemented By: IApiEndpointHandlerClient
Inflight client for IApiEndpointHandler
.
Methods
Name | Description |
---|---|
handle | Inflight that will be called when a request is made to the endpoint. |
handle
handle(request: ApiRequest): ApiResponse
Inflight client: true
Inflight that will be called when a request is made to the endpoint.
request
Required
- Type: ApiRequest
IBucketClient
- Implemented By: IBucketClient
Inflight interface for Bucket
.
Methods
Name | Description |
---|---|
delete | Delete an existing object using a key from the bucket. |
get | Retrieve an object from the bucket. |
get_json | Retrieve a Json object from the bucket. |
list | Retrieve existing objects keys from the bucket. |
public_url | Returns a url to the given file. |
put | Put an object in the bucket. |
put_json | Put a Json object in the bucket. |
delete
delete(key: str, opts?: BucketDeleteOptions): void
Inflight client: true
Delete an existing object using a key from the bucket.
key
Required
- Type: str
Key of the object.
opts
Optional
- Type: BucketDeleteOptions
Options available for delete an item from a bucket.
get
get(key: str): str
Inflight client: true
Retrieve an object from the bucket.
key
Required
- Type: str
Key of the object.
get_json
get_json(key: str): Json
Inflight client: true
Retrieve a Json object from the bucket.
key
Required
- Type: str
Key of the object.
list
list(prefix?: str): MutArray<str>
Inflight client: true
Retrieve existing objects keys from the bucket.
prefix
Optional
- Type: str
Limits the response to keys that begin with the specified prefix.
public_url
public_url(key: str): str
Inflight client: true
Returns a url to the given file.
key
Required
- Type: str
put
put(key: str, body: str): void
Inflight client: true
Put an object in the bucket.
key
Required
- Type: str
Key of the object.
body
Required
- Type: str
Content of the object we want to store into the bucket.
put_json
put_json(key: str, body: Json): void
Inflight client: true
Put a Json object in the bucket.
key
Required
- Type: str
Key of the object.
body
Required
- Type: Json
Json object that we want to store into the bucket.
IBucketEventHandler
Extends: IResource
Implemented By: IBucketEventHandler
Inflight client: @winglang/sdk.cloud.IBucketEventHandlerClient
Represents a resource with an inflight "handle" method that can be passed to the bucket events.
Properties
Name | Type | Description |
---|---|---|
node | constructs.Node | The tree node. |
display | Display | Information on how to display a resource in the UI. |
node
Required
node: Node;
- Type: constructs.Node
The tree node.
display
Required
display: Display;
- Type: Display
Information on how to display a resource in the UI.
IBucketEventHandlerClient
- Implemented By: IBucketEventHandlerClient
Represents a resource with an inflight "handle" method that can be passed to the bucket events.
Methods
Name | Description |
---|---|
handle | Function that will be called when an event notification is fired. |
handle
handle(key: str, type: BucketEventType): void
Inflight client: true
Function that will be called when an event notification is fired.
key
Required
- Type: str
type
Required
- Type: BucketEventType
ICounterClient
- Implemented By: CounterClientBase, ICounterClient
Inflight interface for Counter
.
Methods
Name | Description |
---|---|
dec | Decrement the counter, returning the previous value. |
inc | Increments the counter atomically by a certain amount and returns the previous value. |
peek | Get the current value of the counter. |
reset | Reset a counter to a given value. |
dec
dec(amount?: num): num
Inflight client: true
Decrement the counter, returning the previous value.
amount
Optional
- Type: num
amount to decrement (default is 1).
inc
inc(amount?: num): num
Inflight client: true
Increments the counter atomically by a certain amount and returns the previous value.
amount
Optional
- Type: num
amount to increment (default is 1).
peek
peek(): num
Inflight client: true
Get the current value of the counter.
Using this API may introduce race conditions since the value can change between the time it is read and the time it is used in your code.
reset
reset(value?: num): void
Inflight client: true
Reset a counter to a given value.
value
Optional
- Type: num
value to reset (default is 0).
IFunctionClient
- Implemented By: IFunctionClient
Inflight interface for Function
.
Methods
Name | Description |
---|---|
invoke | Invoke the function asynchronously with a given payload. |
invoke
invoke(payload: str): str
Inflight client: true
Invoke the function asynchronously with a given payload.
payload
Required
- Type: str
IFunctionHandler
Extends: IResource
Implemented By: IFunctionHandler
Inflight client: @winglang/sdk.cloud.IFunctionHandlerClient
Represents a resource with an inflight "handle" method that can be used to create a cloud.Function
.
Properties
Name | Type | Description |
---|---|---|
node | constructs.Node | The tree node. |
display | Display | Information on how to display a resource in the UI. |
node
Required
node: Node;
- Type: constructs.Node
The tree node.
display
Required
display: Display;
- Type: Display
Information on how to display a resource in the UI.
IFunctionHandlerClient
- Implemented By: IFunctionHandlerClient
Inflight client for IFunctionHandler
.
Methods
Name | Description |
---|---|
handle | Entrypoint function that will be called when the cloud function is invoked. |
handle
handle(event: str): void
Inflight client: true
Entrypoint function that will be called when the cloud function is invoked.
event
Required
- Type: str
IInflightHost
Extends: IResource
Implemented By: Function, IInflightHost
A resource that can run inflight code.
Properties
Name | Type | Description |
---|---|---|
node | constructs.Node | The tree node. |
display | Display | Information on how to display a resource in the UI. |
node
Required
node: Node;
- Type: constructs.Node
The tree node.
display
Required
display: Display;
- Type: Display
Information on how to display a resource in the UI.
IQueueAddConsumerHandler
Extends: IResource
Implemented By: IQueueAddConsumerHandler
Inflight client: @winglang/sdk.cloud.IQueueAddConsumerHandlerClient
Represents a resource with an inflight "handle" method that can be passed to Queue.add_consumer
.
Properties
Name | Type | Description |
---|---|---|
node | constructs.Node | The tree node. |
display | Display | Information on how to display a resource in the UI. |
node
Required
node: Node;
- Type: constructs.Node
The tree node.
display
Required
display: Display;
- Type: Display
Information on how to display a resource in the UI.
IQueueAddConsumerHandlerClient
- Implemented By: IQueueAddConsumerHandlerClient
Inflight client for IQueueAddConsumerHandler
.
Methods
Name | Description |
---|---|
handle | Function that will be called when a message is received from the queue. |
handle
handle(message: str): void
Inflight client: true
Function that will be called when a message is received from the queue.
message
Required
- Type: str
IQueueClient
- Implemented By: IQueueClient
Inflight interface for Queue
.
Methods
Name | Description |
---|---|
approx_size | Retrieve the approximate number of messages in the queue. |
purge | Purge all of the messages in the queue. |
push | Push a message to the queue. |
approx_size
approx_size(): num
Inflight client: true
Retrieve the approximate number of messages in the queue.
purge
purge(): void
Inflight client: true
Purge all of the messages in the queue.
push
push(message: str): void
Inflight client: true
Push a message to the queue.
message
Required
- Type: str
Payload to send to the queue.
IResource
Extends: IInspectable, constructs.IConstruct
Implemented By: Api, Bucket, Counter, Function, Queue, Schedule, Secret, Table, TestRunner, Topic, Inflight, Redis, Resource, IApiEndpointHandler, IBucketEventHandler, IFunctionHandler, IQueueAddConsumerHandler, IScheduleOnTickHandler, ITopicOnMessageHandler, IInflightHost, IResource
Abstract interface for Resource
.
Properties
Name | Type | Description |
---|---|---|
node | constructs.Node | The tree node. |
display | Display | Information on how to display a resource in the UI. |
node
Required
node: Node;
- Type: constructs.Node
The tree node.
display
Required
display: Display;
- Type: Display
Information on how to display a resource in the UI.
IScheduleClient
- Implemented By: IScheduleClient
Inflight interface for Schedule
.
IScheduleOnTickHandler
Extends: IResource
Implemented By: IScheduleOnTickHandler
Inflight client: @winglang/sdk.cloud.IScheduleOnTickHandlerClient
Represents a resource with an inflight "handle" method that can be passed to Schedule.on_tick
.
Properties
Name | Type | Description |
---|---|---|
node | constructs.Node | The tree node. |
display | Display | Information on how to display a resource in the UI. |
node
Required
node: Node;
- Type: constructs.Node
The tree node.
display
Required
display: Display;
- Type: Display
Information on how to display a resource in the UI.
IScheduleOnTickHandlerClient
- Implemented By: IScheduleOnTickHandlerClient
Inflight client for IScheduleOnTickHandler
.
Methods
Name | Description |
---|---|
handle | Function that will be called when a message is received from the schedule. |
handle
handle(): void
Inflight client: true
Function that will be called when a message is received from the schedule.
ISecretClient
- Implemented By: ISecretClient
Inflight interface for Secret
.
Methods
Name | Description |
---|---|
value | Retrieve the value of the secret. |
value_json | Retrieve the Json value of the secret. |
value
value(options?: GetSecretValueOptions): str
Inflight client: true
Retrieve the value of the secret.
options
Optional
- Type: GetSecretValueOptions
value_json
value_json(options?: GetSecretValueOptions): Json
Inflight client: true
Retrieve the Json value of the secret.
options
Optional
- Type: GetSecretValueOptions
ITableClient
- Implemented By: ITableClient
Inflight interface for Table
.
Methods
Name | Description |
---|---|
delete | Delete a row from the table, by primary key. |
get | Get a row from the table, by primary key. |
insert | Insert a row into the table. |
list | List all rows in the table. |
update | Update a row in the table. |
delete
delete(key: str): void
Inflight client: true
Delete a row from the table, by primary key.
key
Required
- Type: str
primary key to delete the row.
get
get(key: str): Json
Inflight client: true
Get a row from the table, by primary key.
key
Required
- Type: str
primary key to search.
insert
insert(key: str, row: Json): void
Inflight client: true
Insert a row into the table.
key
Required
- Type: str
primary key to insert the row.
row
Required
- Type: Json
data to be inserted.
list
list(): MutArray<Json>
Inflight client: true
List all rows in the table.
update
update(key: str, row: Json): void
Inflight client: true
Update a row in the table.
key
Required
- Type: str
primary key to update the row.
row
Required
- Type: Json
data to be updated.
ITestRunnerClient
- Implemented By: ITestRunnerClient
Inflight interface for TestRunner
.
Methods
Name | Description |
---|---|
list_tests | List all tests available for this test engine. |
run_test | Run a test with a given path and return the result. |
list_tests
list_tests(): MutArray<str>
Inflight client: true
List all tests available for this test engine.
run_test
run_test(path: str): TestResult
Inflight client: true
Run a test with a given path and return the result.
path
Required
- Type: str
ITopicClient
- Implemented By: ITopicClient
Inflight interface for Topic
.
Methods
Name | Description |
---|---|
publish | Publish message to topic. |
publish
publish(message: str): void
Inflight client: true
Publish message to topic.
message
Required
- Type: str
Payload to publish to Topic.
ITopicOnMessageHandler
Extends: IResource
Implemented By: ITopicOnMessageHandler
Inflight client: @winglang/sdk.cloud.ITopicOnMessageHandlerClient
Represents a resource with an inflight "handle" method that can be passed to Topic.on_message
.
Properties
Name | Type | Description |
---|---|---|
node | constructs.Node | The tree node. |
display | Display | Information on how to display a resource in the UI. |
node
Required
node: Node;
- Type: constructs.Node
The tree node.
display
Required
display: Display;
- Type: Display
Information on how to display a resource in the UI.
ITopicOnMessageHandlerClient
- Implemented By: ITopicOnMessageHandlerClient
Inflight client for ITopicOnMessageHandler
.
Methods
Name | Description |
---|---|
handle | Function that will be called when a message is received from the topic. |
handle
handle(event: str): void
Inflight client: true
Function that will be called when a message is received from the topic.
event
Required
- Type: str
Enums
BucketEventType
bucket events to subscribe to.
Members
Name | Description |
---|---|
CREATE | create. |
DELETE | delete. |
UPDATE | update. |
CREATE
create.
DELETE
delete.
UPDATE
update.
ColumnType
Table column types.
Members
Name | Description |
---|---|
STRING | string type. |
NUMBER | number type. |
BOOLEAN | bool type. |
DATE | date type. |
JSON | json type. |
STRING
string type.
NUMBER
number type.
BOOLEAN
bool type.
DATE
date type.
JSON
json type.
Direction
The direction of a connection.
Visually speaking, if a resource A has an outbound connection with resource B, the arrow would point from A to B, and vice versa for inbound connections.
Members
Name | Description |
---|---|
OUTBOUND | Indicates that this resource calls, triggers, or references the resource it is connected to. |
INBOUND | Indicates that this resource is called, triggered, or referenced by the resource it is connected to. |
OUTBOUND
Indicates that this resource calls, triggers, or references the resource it is connected to.
INBOUND
Indicates that this resource is called, triggered, or referenced by the resource it is connected to.
HttpMethod
Allowed HTTP methods for a endpoint.
Members
Name | Description |
---|---|
GET | Get. |
HEAD | Head. |
POST | Post. |
PUT | Put. |
DELETE | Delete. |
CONNECT | Connect. |
OPTIONS | Options. |
PATCH | Patch. |
GET
Get.
HEAD
Head.
POST
Post.
PUT
Put.
DELETE
Delete.
CONNECT
Connect.
OPTIONS
Options.
PATCH
Patch.
TraceType
The type of a trace.
Members
Name | Description |
---|---|
RESOURCE | A trace representing a resource activity. |
LOG | A trace representing a message emitted by the logger. |
RESOURCE
A trace representing a resource activity.
LOG
A trace representing a message emitted by the logger.