Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(sdk): changing the bind method from internal to public #3776

Merged
merged 5 commits into from
Aug 11, 2023
Merged
Show file tree
Hide file tree
Changes from 2 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
26 changes: 26 additions & 0 deletions docs/docs/04-standard-library/01-cloud/api.md
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,7 @@ new cloud.Api(props?: ApiProps);

| **Name** | **Description** |
| --- | --- |
| <code><a href="#@winglang/sdk.cloud.Api.bind">bind</a></code> | Binds the resource to the host so that it can be used by inflight code. |
| <code><a href="#@winglang/sdk.cloud.Api.connect">connect</a></code> | Add a inflight handler to the api for CONNECT requests on the given path. |
| <code><a href="#@winglang/sdk.cloud.Api.delete">delete</a></code> | Add a inflight handler to the api for DELETE requests on the given path. |
| <code><a href="#@winglang/sdk.cloud.Api.get">get</a></code> | Add a inflight handler to the api for GET requests on the given path. |
Expand All @@ -160,6 +161,31 @@ new cloud.Api(props?: ApiProps);

---

##### `bind` <a name="bind" id="@winglang/sdk.cloud.Api.bind"></a>
marciocadev marked this conversation as resolved.
Show resolved Hide resolved

```wing
bind(host: IInflightHost, ops: MutArray<str>): void
```

Binds the resource to the host so that it can be used by inflight code.

You can override this method to perform additional logic like granting
IAM permissions to the host based on what methods are being called. But
you must call `super.bind(host, ops)` to ensure that the resource is
actually bound.

###### `host`<sup>Required</sup> <a name="host" id="@winglang/sdk.cloud.Api.bind.parameter.host"></a>

- *Type:* <a href="#@winglang/sdk.std.IInflightHost">IInflightHost</a>

---

###### `ops`<sup>Required</sup> <a name="ops" id="@winglang/sdk.cloud.Api.bind.parameter.ops"></a>

- *Type:* MutArray&lt;str&gt;

---

##### `connect` <a name="connect" id="@winglang/sdk.cloud.Api.connect"></a>

```wing
Expand Down
26 changes: 26 additions & 0 deletions docs/docs/04-standard-library/01-cloud/bucket.md
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,7 @@ new cloud.Bucket(props?: BucketProps);

| **Name** | **Description** |
| --- | --- |
| <code><a href="#@winglang/sdk.cloud.Bucket.bind">bind</a></code> | Binds the resource to the host so that it can be used by inflight code. |
| <code><a href="#@winglang/sdk.cloud.Bucket.addObject">addObject</a></code> | Add a file to the bucket that is uploaded when the app is deployed. |
| <code><a href="#@winglang/sdk.cloud.Bucket.onCreate">onCreate</a></code> | Run an inflight whenever a file is uploaded to the bucket. |
| <code><a href="#@winglang/sdk.cloud.Bucket.onDelete">onDelete</a></code> | Run an inflight whenever a file is deleted from the bucket. |
Expand All @@ -174,6 +175,31 @@ new cloud.Bucket(props?: BucketProps);

---

##### `bind` <a name="bind" id="@winglang/sdk.cloud.Bucket.bind"></a>

```wing
bind(host: IInflightHost, ops: MutArray<str>): void
```

Binds the resource to the host so that it can be used by inflight code.

You can override this method to perform additional logic like granting
IAM permissions to the host based on what methods are being called. But
you must call `super.bind(host, ops)` to ensure that the resource is
actually bound.

###### `host`<sup>Required</sup> <a name="host" id="@winglang/sdk.cloud.Bucket.bind.parameter.host"></a>

- *Type:* <a href="#@winglang/sdk.std.IInflightHost">IInflightHost</a>

---

###### `ops`<sup>Required</sup> <a name="ops" id="@winglang/sdk.cloud.Bucket.bind.parameter.ops"></a>

- *Type:* MutArray&lt;str&gt;

---

##### `addObject` <a name="addObject" id="@winglang/sdk.cloud.Bucket.addObject"></a>

```wing
Expand Down
31 changes: 31 additions & 0 deletions docs/docs/04-standard-library/01-cloud/counter.md
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,12 @@ new cloud.Counter(props?: CounterProps);

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

##### Preflight Methods

| **Name** | **Description** |
| --- | --- |
| <code><a href="#@winglang/sdk.cloud.Counter.bind">bind</a></code> | Binds the resource to the host so that it can be used by inflight code. |

##### Inflight Methods

| **Name** | **Description** |
Expand All @@ -111,6 +117,31 @@ new cloud.Counter(props?: CounterProps);

---

##### `bind` <a name="bind" id="@winglang/sdk.cloud.Counter.bind"></a>

```wing
bind(host: IInflightHost, ops: MutArray<str>): void
```

Binds the resource to the host so that it can be used by inflight code.

You can override this method to perform additional logic like granting
IAM permissions to the host based on what methods are being called. But
you must call `super.bind(host, ops)` to ensure that the resource is
actually bound.

###### `host`<sup>Required</sup> <a name="host" id="@winglang/sdk.cloud.Counter.bind.parameter.host"></a>

- *Type:* <a href="#@winglang/sdk.std.IInflightHost">IInflightHost</a>

---

###### `ops`<sup>Required</sup> <a name="ops" id="@winglang/sdk.cloud.Counter.bind.parameter.ops"></a>

- *Type:* MutArray&lt;str&gt;

---

##### `dec` <a name="dec" id="@winglang/sdk.cloud.ICounterClient.dec"></a>

```wing
Expand Down
26 changes: 26 additions & 0 deletions docs/docs/04-standard-library/01-cloud/function.md
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@ new cloud.Function(handler: IFunctionHandler, props?: FunctionProps);

| **Name** | **Description** |
| --- | --- |
| <code><a href="#@winglang/sdk.cloud.Function.bind">bind</a></code> | Binds the resource to the host so that it can be used by inflight code. |
| <code><a href="#@winglang/sdk.cloud.Function.addEnvironment">addEnvironment</a></code> | Add an environment variable to the function. |

##### Inflight Methods
Expand All @@ -111,6 +112,31 @@ new cloud.Function(handler: IFunctionHandler, props?: FunctionProps);

---

##### `bind` <a name="bind" id="@winglang/sdk.cloud.Function.bind"></a>

```wing
bind(host: IInflightHost, ops: MutArray<str>): void
```

Binds the resource to the host so that it can be used by inflight code.

You can override this method to perform additional logic like granting
IAM permissions to the host based on what methods are being called. But
you must call `super.bind(host, ops)` to ensure that the resource is
actually bound.

###### `host`<sup>Required</sup> <a name="host" id="@winglang/sdk.cloud.Function.bind.parameter.host"></a>

- *Type:* <a href="#@winglang/sdk.std.IInflightHost">IInflightHost</a>

---

###### `ops`<sup>Required</sup> <a name="ops" id="@winglang/sdk.cloud.Function.bind.parameter.ops"></a>

- *Type:* MutArray&lt;str&gt;

---

##### `addEnvironment` <a name="addEnvironment" id="@winglang/sdk.cloud.Function.addEnvironment"></a>

```wing
Expand Down
34 changes: 34 additions & 0 deletions docs/docs/04-standard-library/01-cloud/on-deploy.md
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,40 @@ new cloud.OnDeploy(handler: IOnDeployHandler, props?: OnDeployProps);

---

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

##### Preflight Methods

| **Name** | **Description** |
| --- | --- |
| <code><a href="#@winglang/sdk.cloud.OnDeploy.bind">bind</a></code> | Binds the resource to the host so that it can be used by inflight code. |

---

##### `bind` <a name="bind" id="@winglang/sdk.cloud.OnDeploy.bind"></a>

```wing
bind(host: IInflightHost, ops: MutArray<str>): void
```

Binds the resource to the host so that it can be used by inflight code.

You can override this method to perform additional logic like granting
IAM permissions to the host based on what methods are being called. But
you must call `super.bind(host, ops)` to ensure that the resource is
actually bound.

###### `host`<sup>Required</sup> <a name="host" id="@winglang/sdk.cloud.OnDeploy.bind.parameter.host"></a>

- *Type:* <a href="#@winglang/sdk.std.IInflightHost">IInflightHost</a>

---

###### `ops`<sup>Required</sup> <a name="ops" id="@winglang/sdk.cloud.OnDeploy.bind.parameter.ops"></a>

- *Type:* MutArray&lt;str&gt;

---


#### Properties <a name="Properties" id="Properties"></a>
Expand Down
26 changes: 26 additions & 0 deletions docs/docs/04-standard-library/01-cloud/queue.md
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,7 @@ new cloud.Queue(props?: QueueProps);

| **Name** | **Description** |
| --- | --- |
| <code><a href="#@winglang/sdk.cloud.Queue.bind">bind</a></code> | Binds the resource to the host so that it can be used by inflight code. |
| <code><a href="#@winglang/sdk.cloud.Queue.setConsumer">setConsumer</a></code> | Create a function to consume messages from this queue. |

##### Inflight Methods
Expand All @@ -125,6 +126,31 @@ new cloud.Queue(props?: QueueProps);

---

##### `bind` <a name="bind" id="@winglang/sdk.cloud.Queue.bind"></a>

```wing
bind(host: IInflightHost, ops: MutArray<str>): void
```

Binds the resource to the host so that it can be used by inflight code.

You can override this method to perform additional logic like granting
IAM permissions to the host based on what methods are being called. But
you must call `super.bind(host, ops)` to ensure that the resource is
actually bound.

###### `host`<sup>Required</sup> <a name="host" id="@winglang/sdk.cloud.Queue.bind.parameter.host"></a>

- *Type:* <a href="#@winglang/sdk.std.IInflightHost">IInflightHost</a>

---

###### `ops`<sup>Required</sup> <a name="ops" id="@winglang/sdk.cloud.Queue.bind.parameter.ops"></a>

- *Type:* MutArray&lt;str&gt;

---

##### `setConsumer` <a name="setConsumer" id="@winglang/sdk.cloud.Queue.setConsumer"></a>

```wing
Expand Down
26 changes: 26 additions & 0 deletions docs/docs/04-standard-library/01-cloud/schedule.md
Original file line number Diff line number Diff line change
Expand Up @@ -92,10 +92,36 @@ new cloud.Schedule(props?: ScheduleProps);

| **Name** | **Description** |
| --- | --- |
| <code><a href="#@winglang/sdk.cloud.Schedule.bind">bind</a></code> | Binds the resource to the host so that it can be used by inflight code. |
| <code><a href="#@winglang/sdk.cloud.Schedule.onTick">onTick</a></code> | Create a function that runs when receiving the scheduled event. |

---

##### `bind` <a name="bind" id="@winglang/sdk.cloud.Schedule.bind"></a>

```wing
bind(host: IInflightHost, ops: MutArray<str>): void
```

Binds the resource to the host so that it can be used by inflight code.

You can override this method to perform additional logic like granting
IAM permissions to the host based on what methods are being called. But
you must call `super.bind(host, ops)` to ensure that the resource is
actually bound.

###### `host`<sup>Required</sup> <a name="host" id="@winglang/sdk.cloud.Schedule.bind.parameter.host"></a>

- *Type:* <a href="#@winglang/sdk.std.IInflightHost">IInflightHost</a>

---

###### `ops`<sup>Required</sup> <a name="ops" id="@winglang/sdk.cloud.Schedule.bind.parameter.ops"></a>

- *Type:* MutArray&lt;str&gt;

---

##### `onTick` <a name="onTick" id="@winglang/sdk.cloud.Schedule.onTick"></a>

```wing
Expand Down
31 changes: 31 additions & 0 deletions docs/docs/04-standard-library/01-cloud/secret.md
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,12 @@ new cloud.Secret(props?: SecretProps);

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

##### Preflight Methods

| **Name** | **Description** |
| --- | --- |
| <code><a href="#@winglang/sdk.cloud.Secret.bind">bind</a></code> | Binds the resource to the host so that it can be used by inflight code. |

##### Inflight Methods

| **Name** | **Description** |
Expand All @@ -120,6 +126,31 @@ new cloud.Secret(props?: SecretProps);

---

##### `bind` <a name="bind" id="@winglang/sdk.cloud.Secret.bind"></a>

```wing
bind(host: IInflightHost, ops: MutArray<str>): void
```

Binds the resource to the host so that it can be used by inflight code.

You can override this method to perform additional logic like granting
IAM permissions to the host based on what methods are being called. But
you must call `super.bind(host, ops)` to ensure that the resource is
actually bound.

###### `host`<sup>Required</sup> <a name="host" id="@winglang/sdk.cloud.Secret.bind.parameter.host"></a>

- *Type:* <a href="#@winglang/sdk.std.IInflightHost">IInflightHost</a>

---

###### `ops`<sup>Required</sup> <a name="ops" id="@winglang/sdk.cloud.Secret.bind.parameter.ops"></a>

- *Type:* MutArray&lt;str&gt;

---

##### `value` <a name="value" id="@winglang/sdk.cloud.ISecretClient.value"></a>

```wing
Expand Down
31 changes: 31 additions & 0 deletions docs/docs/04-standard-library/01-cloud/service.md
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,12 @@ new cloud.Service(props: ServiceProps);

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

##### Preflight Methods

| **Name** | **Description** |
| --- | --- |
| <code><a href="#@winglang/sdk.cloud.Service.bind">bind</a></code> | Binds the resource to the host so that it can be used by inflight code. |

##### Inflight Methods

| **Name** | **Description** |
Expand All @@ -153,6 +159,31 @@ new cloud.Service(props: ServiceProps);

---

##### `bind` <a name="bind" id="@winglang/sdk.cloud.Service.bind"></a>

```wing
bind(host: IInflightHost, ops: MutArray<str>): void
```

Binds the resource to the host so that it can be used by inflight code.

You can override this method to perform additional logic like granting
IAM permissions to the host based on what methods are being called. But
you must call `super.bind(host, ops)` to ensure that the resource is
actually bound.

###### `host`<sup>Required</sup> <a name="host" id="@winglang/sdk.cloud.Service.bind.parameter.host"></a>

- *Type:* <a href="#@winglang/sdk.std.IInflightHost">IInflightHost</a>

---

###### `ops`<sup>Required</sup> <a name="ops" id="@winglang/sdk.cloud.Service.bind.parameter.ops"></a>

- *Type:* MutArray&lt;str&gt;

---

##### `start` <a name="start" id="@winglang/sdk.cloud.IServiceClient.start"></a>

```wing
Expand Down
Loading
Loading