# InlineApiSchema

Class to define an API Schema from an inline string.

The schema can be provided directly as a string.
Validation is performed at the target configuration level where the schema type is known.

Extends: [ApiSchema](https://docs.aws.amazon.com/cdk/api/v2/docs/@aws-cdk_aws-bedrock-agentcore-alpha.ApiSchema.html) › InlineApiSchema
Obtainable from: [ApiSchema.fromInline](https://docs.aws.amazon.com/cdk/api/v2/docs/@aws-cdk_aws-bedrock-agentcore-alpha.ApiSchema.html#frominline)

- Source: [`lib/gateway/targets/schema/api-schema.ts`](https://github.com/aws/aws-cdk/blob/v2.278.0/packages/@aws-cdk/aws-bedrock-agentcore-alpha/lib/gateway/targets/schema/api-schema.ts#L157)

## Example

TypeScript:

```ts
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import * as bedrock_agentcore_alpha from '@aws-cdk/aws-bedrock-agentcore-alpha';
const inlineApiSchema = new bedrock_agentcore_alpha.InlineApiSchema('schema');
```

Python:

```python
# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
import aws_cdk.aws_bedrock_agentcore_alpha as bedrock_agentcore_alpha

inline_api_schema = bedrock_agentcore_alpha.InlineApiSchema("schema")
```

Java:

```java
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import software.amazon.awscdk.services.bedrock.agentcore.alpha.*;

InlineApiSchema inlineApiSchema = new InlineApiSchema("schema");
```

C# / .NET:

```csharp
// Install: dotnet add package Amazon.CDK.AWS.Bedrock.Agentcore.Alpha
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
using Amazon.CDK.AWS.Bedrock.Agentcore.Alpha;

var inlineApiSchema = new InlineApiSchema("schema");
```

Golang:

```go
// Install: go get github.com/aws/aws-cdk-go/awsbedrockagentcorealpha/v2
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import bedrock_agentcore_alpha "github.com/aws/aws-cdk-go/awsbedrockagentcorealpha"

inlineApiSchema := bedrock_agentcore_alpha.NewInlineApiSchema(jsii.String("schema"))
```

## Initializer

TypeScript:

```ts
new InlineApiSchema(schema: string)
```

Python:

```python
InlineApiSchema(schema: str)
```

Java:

```java
new InlineApiSchema(String schema)
```

C# / .NET:

```csharp
new InlineApiSchema(string schema)
```

Golang:

```go
NewInlineApiSchema(Schema *string)
```

## Properties

- `bucketOwnerAccountId`: string — The account ID of the S3 bucket owner for cross-account access.

- `inlineSchema`: string — The inline OpenAPI schema definition as a string, if using an inline schema.

  Can be in JSON or YAML format.

- `s3File`: [Location](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_s3.Location.html) — The S3 location of the API schema file, if using an S3-based schema.

  Contains the bucket name and object key information.

## Methods

- `bind(scope: Construct): void` — Bind the schema to a construct.

- `fromInline(schema: string): InlineApiSchema // chainable` (static) — Creates an API Schema from an inline string.

  **Parameters**

  - `schema` — - the JSON or YAML payload defining the schema (OpenAPI or Smithy).

- `fromLocalAsset(path: string): AssetApiSchema` (static) — Creates an API Schema from a local file.

  **Parameters**

  - `path` — - the path to the local file containing the OpenAPI schema for the action group.

- `fromS3File(bucket: IBucket, objectKey: string, bucketOwnerAccountId?: string): S3ApiSchema` (static) — Creates an API Schema from an S3 File.

  **Parameters**

  - `bucket` — - the bucket containing the local file containing the OpenAPI schema for the action group.
  - `objectKey` — - object key in the bucket.
  - `bucketOwnerAccountId` — - optional The account ID of the Amazon S3 bucket owner.

- `grantPermissionsToRole(_role: IRole): void` — Grant permissions to the role.
