Skip to content

Commit

Permalink
Merge branch 'dotnet-remove-old-iam-examples' of github.com:rlhagerm/…
Browse files Browse the repository at this point in the history
…aws-doc-sdk-examples into dotnet-remove-old-iam-examples
  • Loading branch information
rlhagerm committed Nov 6, 2024
2 parents 713e94a + d64b9c1 commit ffbf91b
Show file tree
Hide file tree
Showing 49 changed files with 271 additions and 246 deletions.
6 changes: 6 additions & 0 deletions .doc_gen/metadata/bedrock-runtime_metadata.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -555,6 +555,7 @@ bedrock-runtime_InvokeModel_Ai21LabsJurassic2:
excerpts:
- description: Use the Invoke Model API to send a text message.
snippet_tags:
- gov2.bedrock-runtime.InvokeModelWrapper.struct
- gov2.bedrock-runtime.InvokeJurassic2
JavaScript:
versions:
Expand Down Expand Up @@ -620,6 +621,7 @@ bedrock-runtime_InvokeModel_TitanText:
excerpts:
- description: Use the Invoke Model API to send a text message.
snippet_tags:
- gov2.bedrock-runtime.InvokeModelWrapper.struct
- gov2.bedrock-runtime.InvokeTitanText
services:
bedrock-runtime: {InvokeModel}
Expand Down Expand Up @@ -669,6 +671,7 @@ bedrock-runtime_InvokeModel_AnthropicClaude:
excerpts:
- description: Invoke the Anthropic Claude 2 foundation model to generate text.
snippet_tags:
- gov2.bedrock-runtime.InvokeModelWrapper.struct
- gov2.bedrock-runtime.InvokeClaude
PHP:
versions:
Expand Down Expand Up @@ -799,6 +802,7 @@ bedrock-runtime_InvokeModel_MetaLlama2:
excerpts:
- description: Use the Invoke Model API to send a text message.
snippet_tags:
- gov2.bedrock-runtime.InvokeModelWrapper.struct
- gov2.bedrock-runtime.InvokeLlama2
JavaScript:
versions:
Expand Down Expand Up @@ -972,6 +976,7 @@ bedrock-runtime_InvokeModelWithResponseStream_AnthropicClaude:
excerpts:
- description: Use the Invoke Model API to send a text message and process the response stream in real-time.
snippet_tags:
- gov2.bedrock-runtime.InvokeModelWrapper.struct
- gov2.bedrock-runtime.InvokeModelWithResponseStream
JavaScript:
versions:
Expand Down Expand Up @@ -1195,6 +1200,7 @@ bedrock-runtime_InvokeModel_TitanImageGenerator:
excerpts:
- description: Create an image with the Amazon Titan Image Generator.
snippet_tags:
- gov2.bedrock-runtime.InvokeModelWrapper.struct
- gov2.bedrock-runtime.InvokeTitanImage
PHP:
versions:
Expand Down
20 changes: 20 additions & 0 deletions .doc_gen/metadata/dynamodb_metadata.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -394,6 +394,8 @@ dynamodb_BatchWriteItem:
snippet_tags:
- gov2.dynamodb.TableBasics.struct
- gov2.dynamodb.BatchWriteItem
- description: Define a Movie struct that is used in this example.
snippet_tags:
- gov2.dynamodb.Movie.struct
Java:
versions:
Expand Down Expand Up @@ -643,6 +645,8 @@ dynamodb_PutItem:
snippet_tags:
- gov2.dynamodb.TableBasics.struct
- gov2.dynamodb.PutItem
- description: Define a Movie struct that is used in this example.
snippet_tags:
- gov2.dynamodb.Movie.struct
Kotlin:
versions:
Expand Down Expand Up @@ -780,6 +784,8 @@ dynamodb_GetItem:
snippet_tags:
- gov2.dynamodb.TableBasics.struct
- gov2.dynamodb.GetItem
- description: Define a Movie struct that is used in this example.
snippet_tags:
- gov2.dynamodb.Movie.struct
Kotlin:
versions:
Expand Down Expand Up @@ -908,6 +914,8 @@ dynamodb_UpdateItem:
snippet_tags:
- gov2.dynamodb.TableBasics.struct
- gov2.dynamodb.UpdateItem
- description: Define a Movie struct that is used in this example.
snippet_tags:
- gov2.dynamodb.Movie.struct
Kotlin:
versions:
Expand Down Expand Up @@ -1024,6 +1032,8 @@ dynamodb_DeleteItem:
snippet_tags:
- gov2.dynamodb.TableBasics.struct
- gov2.dynamodb.DeleteItem
- description: Define a Movie struct that is used in this example.
snippet_tags:
- gov2.dynamodb.Movie.struct
Kotlin:
versions:
Expand Down Expand Up @@ -1309,6 +1319,8 @@ dynamodb_Query:
snippet_tags:
- gov2.dynamodb.TableBasics.struct
- gov2.dynamodb.Query
- description: Define a Movie struct that is used in this example.
snippet_tags:
- gov2.dynamodb.Movie.struct
Kotlin:
versions:
Expand Down Expand Up @@ -1448,6 +1460,8 @@ dynamodb_Scan:
snippet_tags:
- gov2.dynamodb.TableBasics.struct
- gov2.dynamodb.Scan
- description: Define a Movie struct that is used in this example.
snippet_tags:
- gov2.dynamodb.Movie.struct
Kotlin:
versions:
Expand Down Expand Up @@ -1578,6 +1592,9 @@ dynamodb_ExecuteStatement:
- sdk_version: 2
github: gov2/dynamodb
excerpts:
- description: Define a function receiver struct for the example.
snippet_tags:
- gov2.dynamodb.PartiQLRunner.struct
- description: Use an INSERT statement to add an item.
snippet_tags:
- gov2.dynamodb.ExecuteStatement.Insert
Expand Down Expand Up @@ -1699,6 +1716,9 @@ dynamodb_BatchExecuteStatement:
- sdk_version: 2
github: gov2/dynamodb
excerpts:
- description: Define a function receiver struct for the example.
snippet_tags:
- gov2.dynamodb.PartiQLRunner.struct
- description: Use batches of INSERT statements to add items.
snippet_tags:
- gov2.dynamodb.BatchExecuteStatement.Insert
Expand Down
3 changes: 0 additions & 3 deletions .doc_gen/metadata/lambda_metadata.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -794,9 +794,6 @@ lambda_Scenario_GettingStartedFunctions:
- description: Create a struct that wraps individual &LAM; actions.
snippet_tags:
- gov2.lambda.FunctionWrapper.complete
- description: Create a struct that implements functions to help run the scenario.
snippet_tags:
- gov2.lambda.GetStartedFunctions_Helper
- description: Define a &LAM; handler that increments a number.
snippet_tags:
- gov2.lambda.handlers.increment
Expand Down
1 change: 1 addition & 0 deletions .doc_gen/metadata/s3_metadata.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2742,6 +2742,7 @@ s3_Scenario_PresignedUrl:
- description: Run an interactive example that generates and uses presigned URLs to upload, download, and delete
an S3 object.
snippet_tags:
- gov2.s3.Scenario_Presigning.imports
- gov2.s3.Scenario_Presigning
- description: Define an HTTP request wrapper used by the example to make HTTP requests.
snippet_tags:
Expand Down
3 changes: 3 additions & 0 deletions .doc_gen/metadata/sqs_metadata.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -980,6 +980,9 @@ sqs_Scenario_TopicsAndQueues:
- description: Define a struct that wraps &SQS; actions used in this example.
snippet_tags:
- gov2.sqs.SqsActions.complete
- description: Clean up resources.
snippet_tags:
- gov2.workflows.TopicsAndQueues.Resources.complete
JavaScript:
versions:
- sdk_version: 3
Expand Down
6 changes: 3 additions & 3 deletions gov2/aurora/actions/clusters.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
// SPDX-License-Identifier: Apache-2.0
package actions

// snippet-start:[gov2.aurora.DbClusters.complete]
// snippet-start:[gov2.aurora.DbClusters.struct]

import (
"context"
"errors"
Expand All @@ -12,9 +15,6 @@ import (
"github.com/aws/aws-sdk-go-v2/service/rds/types"
)

// snippet-start:[gov2.aurora.DbClusters.complete]
// snippet-start:[gov2.aurora.DbClusters.struct]

type DbClusters struct {
AuroraClient *rds.Client
}
Expand Down
40 changes: 20 additions & 20 deletions gov2/aurora/scenarios/get_started_clusters.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@

package scenarios

// snippet-start:[gov2.aurora.Scenario_GetStartedClusters]

import (
"aurora/actions"
"context"
Expand All @@ -21,26 +23,6 @@ import (
"github.com/google/uuid"
)

// IScenarioHelper abstracts the function from a scenario so that it
// can be mocked for unit testing.
type IScenarioHelper interface {
Pause(secs int)
UniqueId() string
}
type ScenarioHelper struct{}

// Pause waits for the specified number of seconds.
func (helper ScenarioHelper) Pause(secs int) {
time.Sleep(time.Duration(secs) * time.Second)
}

// UniqueId returns a new UUID.
func (helper ScenarioHelper) UniqueId() string {
return uuid.New().String()
}

// snippet-start:[gov2.aurora.Scenario_GetStartedClusters]

// GetStartedClusters is an interactive example that shows you how to use the AWS SDK for Go
// with Amazon Aurora to do the following:
//
Expand Down Expand Up @@ -384,4 +366,22 @@ func (scenario GetStartedClusters) Cleanup(ctx context.Context, dbInstance *type
}
}

// IScenarioHelper abstracts the function from a scenario so that it
// can be mocked for unit testing.
type IScenarioHelper interface {
Pause(secs int)
UniqueId() string
}
type ScenarioHelper struct{}

// Pause waits for the specified number of seconds.
func (helper ScenarioHelper) Pause(secs int) {
time.Sleep(time.Duration(secs) * time.Second)
}

// UniqueId returns a new UUID.
func (helper ScenarioHelper) UniqueId() string {
return uuid.New().String()
}

// snippet-end:[gov2.aurora.Scenario_GetStartedClusters]
10 changes: 5 additions & 5 deletions gov2/bedrock-runtime/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,24 +42,24 @@ functions within the same service.

### AI21 Labs Jurassic-2

- [InvokeModel](actions/invoke_model.go#L83)
- [InvokeModel](actions/invoke_model.go#L7)

### Amazon Titan Image Generator

- [InvokeModel](actions/invoke_model.go#L191)
- [InvokeModel](actions/invoke_model.go#L7)

### Amazon Titan Text

- [InvokeModel](actions/invoke_model.go#L261)
- [InvokeModel](actions/invoke_model.go#L7)

### Anthropic Claude

- [InvokeModel](actions/invoke_model.go#L27)
- [InvokeModel](actions/invoke_model.go#L7)
- [InvokeModelWithResponseStream](actions/invoke_model_with_response_stream.go#L30)

### Meta Llama

- [InvokeModel: Llama 2](actions/invoke_model.go#L140)
- [InvokeModel: Llama 2](actions/invoke_model.go#L7)


<!--custom.examples.start-->
Expand Down
6 changes: 3 additions & 3 deletions gov2/bedrock-runtime/actions/invoke_model.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@

package actions

// snippet-start:[gov2.bedrock-runtime.InvokeModelWrapper.complete]
// snippet-start:[gov2.bedrock-runtime.InvokeModelWrapper.struct]

import (
"context"
"encoding/json"
Expand All @@ -13,9 +16,6 @@ import (
"github.com/aws/aws-sdk-go-v2/service/bedrockruntime"
)

// snippet-start:[gov2.bedrock-runtime.InvokeModelWrapper.complete]
// snippet-start:[gov2.bedrock-runtime.InvokeModelWrapper.struct]

// InvokeModelWrapper encapsulates Amazon Bedrock actions used in the examples.
// It contains a Bedrock Runtime client that is used to invoke foundation models.
type InvokeModelWrapper struct {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@

package actions

// snippet-start:[gov2.bedrock-runtime.InvokeModelWithResponseStreamWrapper.complete]
// snippet-start:[gov2.bedrock-runtime.InvokeModelWithResponseStreamWrapper.struct]

import (
"bytes"
"context"
Expand All @@ -16,9 +19,6 @@ import (
"github.com/aws/aws-sdk-go-v2/service/bedrockruntime/types"
)

// snippet-start:[gov2.bedrock-runtime.InvokeModelWithResponseStreamWrapper.complete]
// snippet-start:[gov2.bedrock-runtime.InvokeModelWithResponseStreamWrapper.struct]

// InvokeModelWithResponseStreamWrapper encapsulates Amazon Bedrock actions used in the examples.
// It contains a Bedrock Runtime client that is used to invoke foundation models.
type InvokeModelWithResponseStreamWrapper struct {
Expand Down
6 changes: 3 additions & 3 deletions gov2/bedrock-runtime/scenarios/scenario_invoke_models.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@

package scenarios

// snippet-start:[gov2.bedrock-runtime.Scenario_InvokeModels]

import (
"context"
"encoding/base64"
Expand All @@ -19,16 +21,14 @@ import (
"github.com/awsdocs/aws-doc-sdk-examples/gov2/demotools"
)

// snippet-start:[gov2.bedrock-runtime.Scenario_InvokeModels]

// InvokeModelsScenario demonstrates how to use the Amazon Bedrock Runtime client
// to invoke various foundation models for text and image generation
//
// 1. Generate text with Anthropic Claude 2
// 2. Generate text with AI21 Labs Jurassic-2
// 3. Generate text with Meta Llama 2 Chat
// 4. Generate text and asynchronously process the response stream with Anthropic Claude 2
// 5. Generate and image with the Amazon Titan image generation model
// 5. Generate an image with the Amazon Titan image generation model
// 6. Generate text with Amazon Titan Text G1 Express model
type InvokeModelsScenario struct {
sdkConfig aws.Config
Expand Down
6 changes: 3 additions & 3 deletions gov2/bedrock/actions/foundation_model.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@

package actions

// snippet-start:[gov2.bedrock.FoundationModelWrapper.complete]
// snippet-start:[gov2.bedrock.FoundationModelWrapper.struct]

import (
"context"
"log"
Expand All @@ -11,9 +14,6 @@ import (
"github.com/aws/aws-sdk-go-v2/service/bedrock/types"
)

// snippet-start:[gov2.bedrock.FoundationModelWrapper.complete]
// snippet-start:[gov2.bedrock.FoundationModelWrapper.struct]

// FoundationModelWrapper encapsulates Amazon Bedrock actions used in the examples.
// It contains a Bedrock service client that is used to perform foundation model actions.
type FoundationModelWrapper struct {
Expand Down
16 changes: 8 additions & 8 deletions gov2/cognito/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,15 +38,15 @@ For prerequisites, see the [README](../README.md#Prerequisites) in the `gov2` fo

Code excerpts that show you how to call individual service functions.

- [AdminCreateUser](../workflows/user_pools_and_lambda_triggers/actions/cognito_actions.go#L183)
- [AdminSetUserPassword](../workflows/user_pools_and_lambda_triggers/actions/cognito_actions.go#L208)
- [ConfirmForgotPassword](../workflows/user_pools_and_lambda_triggers/actions/cognito_actions.go#L145)
- [DeleteUser](../workflows/user_pools_and_lambda_triggers/actions/cognito_actions.go#L168)
- [ForgotPassword](../workflows/user_pools_and_lambda_triggers/actions/cognito_actions.go#L128)
- [InitiateAuth](../workflows/user_pools_and_lambda_triggers/actions/cognito_actions.go#L103)
- [AdminCreateUser](../workflows/user_pools_and_lambda_triggers/actions/cognito_actions.go#L182)
- [AdminSetUserPassword](../workflows/user_pools_and_lambda_triggers/actions/cognito_actions.go#L207)
- [ConfirmForgotPassword](../workflows/user_pools_and_lambda_triggers/actions/cognito_actions.go#L144)
- [DeleteUser](../workflows/user_pools_and_lambda_triggers/actions/cognito_actions.go#L167)
- [ForgotPassword](../workflows/user_pools_and_lambda_triggers/actions/cognito_actions.go#L127)
- [InitiateAuth](../workflows/user_pools_and_lambda_triggers/actions/cognito_actions.go#L102)
- [ListUserPools](hello/hello.go#L4)
- [SignUp](../workflows/user_pools_and_lambda_triggers/actions/cognito_actions.go#L75)
- [UpdateUserPool](../workflows/user_pools_and_lambda_triggers/actions/cognito_actions.go#L26)
- [SignUp](../workflows/user_pools_and_lambda_triggers/actions/cognito_actions.go#L74)
- [UpdateUserPool](../workflows/user_pools_and_lambda_triggers/actions/cognito_actions.go#L25)

### Scenarios

Expand Down
4 changes: 2 additions & 2 deletions gov2/dynamodb/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,13 +40,13 @@ Code examples that show you how to perform the essential operations within a ser

Code excerpts that show you how to call individual service functions.

- [BatchExecuteStatement](actions/partiql.go#L164)
- [BatchExecuteStatement](actions/partiql.go#L7)
- [BatchWriteItem](actions/table_basics.go#L177)
- [CreateTable](actions/table_basics.go#L54)
- [DeleteItem](actions/table_basics.go#L332)
- [DeleteTable](actions/table_basics.go#L347)
- [DescribeTable](actions/table_basics.go#L31)
- [ExecuteStatement](actions/partiql.go#L30)
- [ExecuteStatement](actions/partiql.go#L7)
- [GetItem](actions/table_basics.go#L221)
- [ListTables](actions/table_basics.go#L99)
- [PutItem](actions/table_basics.go#L121)
Expand Down
Loading

0 comments on commit ffbf91b

Please sign in to comment.