// Code generated by smithy-go-codegen DO NOT EDIT.

//go:build response_snapshot

package bedrockruntime

import (
	"bufio"
	"bytes"
	"context"
	"errors"
	"fmt"
	"github.com/aws/aws-sdk-go-v2/service/bedrockruntime/types"
	smithyendpoints "github.com/aws/smithy-go/endpoints"
	"github.com/aws/smithy-go/middleware"
	"github.com/aws/smithy-go/ptr"
	smithytesting "github.com/aws/smithy-go/testing"
	smithyhttp "github.com/aws/smithy-go/transport/http"
	"io"
	"io/fs"
	"net/http"
	"net/url"
	"os"
	"strconv"
	"strings"
	"testing"
	"time"
)

const serdeRespSSPrefix = "response_snapshot"

func serdeRespSSPath(op string) string {
	return fmt.Sprintf("%s/%s.snap", serdeRespSSPrefix, op)
}

// serdeRespReadSnapshot parses a frozen wire response fixture: a status-code
// line, HTTP headers, a blank line, then the raw body.
func serdeRespReadSnapshot(op string) (int, http.Header, []byte, error) {
	raw, err := os.ReadFile(serdeRespSSPath(op))
	if err != nil {
		return 0, nil, nil, err
	}

	r := bufio.NewReader(bytes.NewReader(raw))
	statusLine, err := r.ReadString('\n')
	if err != nil {
		return 0, nil, nil, fmt.Errorf("read status line: %w", err)
	}
	status, err := strconv.Atoi(strings.TrimSpace(statusLine))
	if err != nil {
		return 0, nil, nil, fmt.Errorf("parse status: %w", err)
	}

	header := http.Header{}
	for {
		line, err := r.ReadString('\n')
		if err != nil && err != io.EOF {
			return 0, nil, nil, err
		}
		trimmed := strings.TrimRight(line, "\r\n")
		if trimmed == "" {
			break
		}
		k, v, ok := strings.Cut(trimmed, ": ")
		if !ok {
			return 0, nil, nil, fmt.Errorf("malformed header %q", trimmed)
		}
		header.Add(k, v)
		if err == io.EOF {
			break
		}
	}

	body, err := io.ReadAll(r)
	if err != nil {
		return 0, nil, nil, err
	}
	return status, header, body, nil
}

type serdeRespEndpointResolver struct{}

func (*serdeRespEndpointResolver) ResolveEndpoint(ctx context.Context, params EndpointParameters) (smithyendpoints.Endpoint, error) {
	return smithyendpoints.Endpoint{URI: url.URL{Scheme: "https", Host: "test.example.com"}}, nil
}

func serdeRespClient(status int, header http.Header, body []byte) *Client {
	return New(Options{
		Region: "us-east-1",
		HTTPClient: smithyhttp.ClientDoFunc(func(req *http.Request) (*http.Response, error) {
			resp := &http.Response{StatusCode: status, Header: header, Request: req}
			if len(body) > 0 {
				resp.ContentLength = int64(len(body))
				resp.Body = io.NopCloser(bytes.NewReader(body))
			} else {
				resp.Body = http.NoBody
			}
			return resp, nil
		}),
		EndpointResolverV2: &serdeRespEndpointResolver{},
		APIOptions: []func(*middleware.Stack) error{
			func(s *middleware.Stack) error {
				s.Finalize.Clear()
				s.Initialize.Remove("OperationInputValidation")
				return nil
			},
		},
	})
}
func TestCheckResponseSnapshot_ApplyGuardrail(t *testing.T) {
	want := &ApplyGuardrailOutput{
		Usage: &types.GuardrailUsage{
			TopicPolicyUnits:                    ptr.Int32(1),
			ContentPolicyUnits:                  ptr.Int32(1),
			WordPolicyUnits:                     ptr.Int32(1),
			SensitiveInformationPolicyUnits:     ptr.Int32(1),
			SensitiveInformationPolicyFreeUnits: ptr.Int32(1),
			ContextualGroundingPolicyUnits:      ptr.Int32(1),
			ContentPolicyImageUnits:             ptr.Int32(1),
			AutomatedReasoningPolicyUnits:       ptr.Int32(1),
			AutomatedReasoningPolicies:          ptr.Int32(1),
		},
		Action:       types.GuardrailAction("NONE"),
		ActionReason: ptr.String("__ActionReason__"),
		Outputs: []types.GuardrailOutputContent{
			{
				Text: ptr.String("__Text__"),
			},
			{
				Text: ptr.String("__Text__"),
			},
		},
		Assessments: []types.GuardrailAssessment{
			{
				TopicPolicy: &types.GuardrailTopicPolicyAssessment{
					Topics: []types.GuardrailTopic{
						{
							Name:     ptr.String("__Name__"),
							Type:     types.GuardrailTopicType("DENY"),
							Action:   types.GuardrailTopicPolicyAction("BLOCKED"),
							Detected: ptr.Bool(true),
						},
						{
							Name:     ptr.String("__Name__"),
							Type:     types.GuardrailTopicType("DENY"),
							Action:   types.GuardrailTopicPolicyAction("BLOCKED"),
							Detected: ptr.Bool(true),
						},
					},
				},
				ContentPolicy: &types.GuardrailContentPolicyAssessment{
					Filters: []types.GuardrailContentFilter{
						{
							Type:           types.GuardrailContentFilterType("INSULTS"),
							Confidence:     types.GuardrailContentFilterConfidence("NONE"),
							FilterStrength: types.GuardrailContentFilterStrength("NONE"),
							Action:         types.GuardrailContentPolicyAction("BLOCKED"),
							Detected:       ptr.Bool(true),
						},
						{
							Type:           types.GuardrailContentFilterType("INSULTS"),
							Confidence:     types.GuardrailContentFilterConfidence("NONE"),
							FilterStrength: types.GuardrailContentFilterStrength("NONE"),
							Action:         types.GuardrailContentPolicyAction("BLOCKED"),
							Detected:       ptr.Bool(true),
						},
					},
				},
				WordPolicy: &types.GuardrailWordPolicyAssessment{
					CustomWords: []types.GuardrailCustomWord{
						{
							Match:    ptr.String("__Match__"),
							Action:   types.GuardrailWordPolicyAction("BLOCKED"),
							Detected: ptr.Bool(true),
						},
						{
							Match:    ptr.String("__Match__"),
							Action:   types.GuardrailWordPolicyAction("BLOCKED"),
							Detected: ptr.Bool(true),
						},
					},
					ManagedWordLists: []types.GuardrailManagedWord{
						{
							Match:    ptr.String("__Match__"),
							Type:     types.GuardrailManagedWordType("PROFANITY"),
							Action:   types.GuardrailWordPolicyAction("BLOCKED"),
							Detected: ptr.Bool(true),
						},
						{
							Match:    ptr.String("__Match__"),
							Type:     types.GuardrailManagedWordType("PROFANITY"),
							Action:   types.GuardrailWordPolicyAction("BLOCKED"),
							Detected: ptr.Bool(true),
						},
					},
				},
				SensitiveInformationPolicy: &types.GuardrailSensitiveInformationPolicyAssessment{
					PiiEntities: []types.GuardrailPiiEntityFilter{
						{
							Match:    ptr.String("__Match__"),
							Type:     types.GuardrailPiiEntityType("ADDRESS"),
							Action:   types.GuardrailSensitiveInformationPolicyAction("ANONYMIZED"),
							Detected: ptr.Bool(true),
						},
						{
							Match:    ptr.String("__Match__"),
							Type:     types.GuardrailPiiEntityType("ADDRESS"),
							Action:   types.GuardrailSensitiveInformationPolicyAction("ANONYMIZED"),
							Detected: ptr.Bool(true),
						},
					},
					Regexes: []types.GuardrailRegexFilter{
						{
							Name:     ptr.String("__Name__"),
							Match:    ptr.String("__Match__"),
							Regex:    ptr.String("__Regex__"),
							Action:   types.GuardrailSensitiveInformationPolicyAction("ANONYMIZED"),
							Detected: ptr.Bool(true),
						},
						{
							Name:     ptr.String("__Name__"),
							Match:    ptr.String("__Match__"),
							Regex:    ptr.String("__Regex__"),
							Action:   types.GuardrailSensitiveInformationPolicyAction("ANONYMIZED"),
							Detected: ptr.Bool(true),
						},
					},
				},
				ContextualGroundingPolicy: &types.GuardrailContextualGroundingPolicyAssessment{
					Filters: []types.GuardrailContextualGroundingFilter{
						{
							Type:      types.GuardrailContextualGroundingFilterType("GROUNDING"),
							Threshold: ptr.Float64(1.0),
							Score:     ptr.Float64(1.0),
							Action:    types.GuardrailContextualGroundingPolicyAction("BLOCKED"),
							Detected:  ptr.Bool(true),
						},
						{
							Type:      types.GuardrailContextualGroundingFilterType("GROUNDING"),
							Threshold: ptr.Float64(1.0),
							Score:     ptr.Float64(1.0),
							Action:    types.GuardrailContextualGroundingPolicyAction("BLOCKED"),
							Detected:  ptr.Bool(true),
						},
					},
				},
				AutomatedReasoningPolicy: &types.GuardrailAutomatedReasoningPolicyAssessment{
					Findings: []types.GuardrailAutomatedReasoningFinding{
						&types.GuardrailAutomatedReasoningFindingMemberValid{
							Value: types.GuardrailAutomatedReasoningValidFinding{
								Translation: &types.GuardrailAutomatedReasoningTranslation{
									Premises: []types.GuardrailAutomatedReasoningStatement{
										{
											Logic:           ptr.String("__Logic__"),
											NaturalLanguage: ptr.String("__NaturalLanguage__"),
										},
										{
											Logic:           ptr.String("__Logic__"),
											NaturalLanguage: ptr.String("__NaturalLanguage__"),
										},
									},
									Claims: []types.GuardrailAutomatedReasoningStatement{
										{
											Logic:           ptr.String("__Logic__"),
											NaturalLanguage: ptr.String("__NaturalLanguage__"),
										},
										{
											Logic:           ptr.String("__Logic__"),
											NaturalLanguage: ptr.String("__NaturalLanguage__"),
										},
									},
									UntranslatedPremises: []types.GuardrailAutomatedReasoningInputTextReference{
										{
											Text: ptr.String("__Text__"),
										},
										{
											Text: ptr.String("__Text__"),
										},
									},
									UntranslatedClaims: []types.GuardrailAutomatedReasoningInputTextReference{
										{
											Text: ptr.String("__Text__"),
										},
										{
											Text: ptr.String("__Text__"),
										},
									},
									Confidence: ptr.Float64(1.0),
								},
								ClaimsTrueScenario: &types.GuardrailAutomatedReasoningScenario{
									Statements: []types.GuardrailAutomatedReasoningStatement{
										{
											Logic:           ptr.String("__Logic__"),
											NaturalLanguage: ptr.String("__NaturalLanguage__"),
										},
										{
											Logic:           ptr.String("__Logic__"),
											NaturalLanguage: ptr.String("__NaturalLanguage__"),
										},
									},
								},
								SupportingRules: []types.GuardrailAutomatedReasoningRule{
									{
										Identifier:       ptr.String("__Identifier__"),
										PolicyVersionArn: ptr.String("__PolicyVersionArn__"),
									},
									{
										Identifier:       ptr.String("__Identifier__"),
										PolicyVersionArn: ptr.String("__PolicyVersionArn__"),
									},
								},
								LogicWarning: &types.GuardrailAutomatedReasoningLogicWarning{
									Type: types.GuardrailAutomatedReasoningLogicWarningType("ALWAYS_FALSE"),
									Premises: []types.GuardrailAutomatedReasoningStatement{
										{
											Logic:           ptr.String("__Logic__"),
											NaturalLanguage: ptr.String("__NaturalLanguage__"),
										},
										{
											Logic:           ptr.String("__Logic__"),
											NaturalLanguage: ptr.String("__NaturalLanguage__"),
										},
									},
									Claims: []types.GuardrailAutomatedReasoningStatement{
										{
											Logic:           ptr.String("__Logic__"),
											NaturalLanguage: ptr.String("__NaturalLanguage__"),
										},
										{
											Logic:           ptr.String("__Logic__"),
											NaturalLanguage: ptr.String("__NaturalLanguage__"),
										},
									},
								},
							},
						},
						&types.GuardrailAutomatedReasoningFindingMemberValid{
							Value: types.GuardrailAutomatedReasoningValidFinding{
								Translation: &types.GuardrailAutomatedReasoningTranslation{
									Premises: []types.GuardrailAutomatedReasoningStatement{
										{
											Logic:           ptr.String("__Logic__"),
											NaturalLanguage: ptr.String("__NaturalLanguage__"),
										},
										{
											Logic:           ptr.String("__Logic__"),
											NaturalLanguage: ptr.String("__NaturalLanguage__"),
										},
									},
									Claims: []types.GuardrailAutomatedReasoningStatement{
										{
											Logic:           ptr.String("__Logic__"),
											NaturalLanguage: ptr.String("__NaturalLanguage__"),
										},
										{
											Logic:           ptr.String("__Logic__"),
											NaturalLanguage: ptr.String("__NaturalLanguage__"),
										},
									},
									UntranslatedPremises: []types.GuardrailAutomatedReasoningInputTextReference{
										{
											Text: ptr.String("__Text__"),
										},
										{
											Text: ptr.String("__Text__"),
										},
									},
									UntranslatedClaims: []types.GuardrailAutomatedReasoningInputTextReference{
										{
											Text: ptr.String("__Text__"),
										},
										{
											Text: ptr.String("__Text__"),
										},
									},
									Confidence: ptr.Float64(1.0),
								},
								ClaimsTrueScenario: &types.GuardrailAutomatedReasoningScenario{
									Statements: []types.GuardrailAutomatedReasoningStatement{
										{
											Logic:           ptr.String("__Logic__"),
											NaturalLanguage: ptr.String("__NaturalLanguage__"),
										},
										{
											Logic:           ptr.String("__Logic__"),
											NaturalLanguage: ptr.String("__NaturalLanguage__"),
										},
									},
								},
								SupportingRules: []types.GuardrailAutomatedReasoningRule{
									{
										Identifier:       ptr.String("__Identifier__"),
										PolicyVersionArn: ptr.String("__PolicyVersionArn__"),
									},
									{
										Identifier:       ptr.String("__Identifier__"),
										PolicyVersionArn: ptr.String("__PolicyVersionArn__"),
									},
								},
								LogicWarning: &types.GuardrailAutomatedReasoningLogicWarning{
									Type: types.GuardrailAutomatedReasoningLogicWarningType("ALWAYS_FALSE"),
									Premises: []types.GuardrailAutomatedReasoningStatement{
										{
											Logic:           ptr.String("__Logic__"),
											NaturalLanguage: ptr.String("__NaturalLanguage__"),
										},
										{
											Logic:           ptr.String("__Logic__"),
											NaturalLanguage: ptr.String("__NaturalLanguage__"),
										},
									},
									Claims: []types.GuardrailAutomatedReasoningStatement{
										{
											Logic:           ptr.String("__Logic__"),
											NaturalLanguage: ptr.String("__NaturalLanguage__"),
										},
										{
											Logic:           ptr.String("__Logic__"),
											NaturalLanguage: ptr.String("__NaturalLanguage__"),
										},
									},
								},
							},
						},
					},
				},
				InvocationMetrics: &types.GuardrailInvocationMetrics{
					GuardrailProcessingLatency: ptr.Int64(1),
					Usage: &types.GuardrailUsage{
						TopicPolicyUnits:                    ptr.Int32(1),
						ContentPolicyUnits:                  ptr.Int32(1),
						WordPolicyUnits:                     ptr.Int32(1),
						SensitiveInformationPolicyUnits:     ptr.Int32(1),
						SensitiveInformationPolicyFreeUnits: ptr.Int32(1),
						ContextualGroundingPolicyUnits:      ptr.Int32(1),
						ContentPolicyImageUnits:             ptr.Int32(1),
						AutomatedReasoningPolicyUnits:       ptr.Int32(1),
						AutomatedReasoningPolicies:          ptr.Int32(1),
					},
					GuardrailCoverage: &types.GuardrailCoverage{
						TextCharacters: &types.GuardrailTextCharactersCoverage{
							Guarded: ptr.Int32(1),
							Total:   ptr.Int32(1),
						},
						Images: &types.GuardrailImageCoverage{
							Guarded: ptr.Int32(1),
							Total:   ptr.Int32(1),
						},
					},
				},
				AppliedGuardrailDetails: &types.AppliedGuardrailDetails{
					GuardrailId:      ptr.String("__GuardrailId__"),
					GuardrailVersion: ptr.String("__GuardrailVersion__"),
					GuardrailArn:     ptr.String("__GuardrailArn__"),
					GuardrailOrigin: []types.GuardrailOrigin{
						types.GuardrailOrigin("REQUEST"),
						types.GuardrailOrigin("REQUEST"),
					},
					GuardrailOwnership: types.GuardrailOwnership("SELF"),
				},
			},
			{
				TopicPolicy: &types.GuardrailTopicPolicyAssessment{
					Topics: []types.GuardrailTopic{
						{
							Name:     ptr.String("__Name__"),
							Type:     types.GuardrailTopicType("DENY"),
							Action:   types.GuardrailTopicPolicyAction("BLOCKED"),
							Detected: ptr.Bool(true),
						},
						{
							Name:     ptr.String("__Name__"),
							Type:     types.GuardrailTopicType("DENY"),
							Action:   types.GuardrailTopicPolicyAction("BLOCKED"),
							Detected: ptr.Bool(true),
						},
					},
				},
				ContentPolicy: &types.GuardrailContentPolicyAssessment{
					Filters: []types.GuardrailContentFilter{
						{
							Type:           types.GuardrailContentFilterType("INSULTS"),
							Confidence:     types.GuardrailContentFilterConfidence("NONE"),
							FilterStrength: types.GuardrailContentFilterStrength("NONE"),
							Action:         types.GuardrailContentPolicyAction("BLOCKED"),
							Detected:       ptr.Bool(true),
						},
						{
							Type:           types.GuardrailContentFilterType("INSULTS"),
							Confidence:     types.GuardrailContentFilterConfidence("NONE"),
							FilterStrength: types.GuardrailContentFilterStrength("NONE"),
							Action:         types.GuardrailContentPolicyAction("BLOCKED"),
							Detected:       ptr.Bool(true),
						},
					},
				},
				WordPolicy: &types.GuardrailWordPolicyAssessment{
					CustomWords: []types.GuardrailCustomWord{
						{
							Match:    ptr.String("__Match__"),
							Action:   types.GuardrailWordPolicyAction("BLOCKED"),
							Detected: ptr.Bool(true),
						},
						{
							Match:    ptr.String("__Match__"),
							Action:   types.GuardrailWordPolicyAction("BLOCKED"),
							Detected: ptr.Bool(true),
						},
					},
					ManagedWordLists: []types.GuardrailManagedWord{
						{
							Match:    ptr.String("__Match__"),
							Type:     types.GuardrailManagedWordType("PROFANITY"),
							Action:   types.GuardrailWordPolicyAction("BLOCKED"),
							Detected: ptr.Bool(true),
						},
						{
							Match:    ptr.String("__Match__"),
							Type:     types.GuardrailManagedWordType("PROFANITY"),
							Action:   types.GuardrailWordPolicyAction("BLOCKED"),
							Detected: ptr.Bool(true),
						},
					},
				},
				SensitiveInformationPolicy: &types.GuardrailSensitiveInformationPolicyAssessment{
					PiiEntities: []types.GuardrailPiiEntityFilter{
						{
							Match:    ptr.String("__Match__"),
							Type:     types.GuardrailPiiEntityType("ADDRESS"),
							Action:   types.GuardrailSensitiveInformationPolicyAction("ANONYMIZED"),
							Detected: ptr.Bool(true),
						},
						{
							Match:    ptr.String("__Match__"),
							Type:     types.GuardrailPiiEntityType("ADDRESS"),
							Action:   types.GuardrailSensitiveInformationPolicyAction("ANONYMIZED"),
							Detected: ptr.Bool(true),
						},
					},
					Regexes: []types.GuardrailRegexFilter{
						{
							Name:     ptr.String("__Name__"),
							Match:    ptr.String("__Match__"),
							Regex:    ptr.String("__Regex__"),
							Action:   types.GuardrailSensitiveInformationPolicyAction("ANONYMIZED"),
							Detected: ptr.Bool(true),
						},
						{
							Name:     ptr.String("__Name__"),
							Match:    ptr.String("__Match__"),
							Regex:    ptr.String("__Regex__"),
							Action:   types.GuardrailSensitiveInformationPolicyAction("ANONYMIZED"),
							Detected: ptr.Bool(true),
						},
					},
				},
				ContextualGroundingPolicy: &types.GuardrailContextualGroundingPolicyAssessment{
					Filters: []types.GuardrailContextualGroundingFilter{
						{
							Type:      types.GuardrailContextualGroundingFilterType("GROUNDING"),
							Threshold: ptr.Float64(1.0),
							Score:     ptr.Float64(1.0),
							Action:    types.GuardrailContextualGroundingPolicyAction("BLOCKED"),
							Detected:  ptr.Bool(true),
						},
						{
							Type:      types.GuardrailContextualGroundingFilterType("GROUNDING"),
							Threshold: ptr.Float64(1.0),
							Score:     ptr.Float64(1.0),
							Action:    types.GuardrailContextualGroundingPolicyAction("BLOCKED"),
							Detected:  ptr.Bool(true),
						},
					},
				},
				AutomatedReasoningPolicy: &types.GuardrailAutomatedReasoningPolicyAssessment{
					Findings: []types.GuardrailAutomatedReasoningFinding{
						&types.GuardrailAutomatedReasoningFindingMemberValid{
							Value: types.GuardrailAutomatedReasoningValidFinding{
								Translation: &types.GuardrailAutomatedReasoningTranslation{
									Premises: []types.GuardrailAutomatedReasoningStatement{
										{
											Logic:           ptr.String("__Logic__"),
											NaturalLanguage: ptr.String("__NaturalLanguage__"),
										},
										{
											Logic:           ptr.String("__Logic__"),
											NaturalLanguage: ptr.String("__NaturalLanguage__"),
										},
									},
									Claims: []types.GuardrailAutomatedReasoningStatement{
										{
											Logic:           ptr.String("__Logic__"),
											NaturalLanguage: ptr.String("__NaturalLanguage__"),
										},
										{
											Logic:           ptr.String("__Logic__"),
											NaturalLanguage: ptr.String("__NaturalLanguage__"),
										},
									},
									UntranslatedPremises: []types.GuardrailAutomatedReasoningInputTextReference{
										{
											Text: ptr.String("__Text__"),
										},
										{
											Text: ptr.String("__Text__"),
										},
									},
									UntranslatedClaims: []types.GuardrailAutomatedReasoningInputTextReference{
										{
											Text: ptr.String("__Text__"),
										},
										{
											Text: ptr.String("__Text__"),
										},
									},
									Confidence: ptr.Float64(1.0),
								},
								ClaimsTrueScenario: &types.GuardrailAutomatedReasoningScenario{
									Statements: []types.GuardrailAutomatedReasoningStatement{
										{
											Logic:           ptr.String("__Logic__"),
											NaturalLanguage: ptr.String("__NaturalLanguage__"),
										},
										{
											Logic:           ptr.String("__Logic__"),
											NaturalLanguage: ptr.String("__NaturalLanguage__"),
										},
									},
								},
								SupportingRules: []types.GuardrailAutomatedReasoningRule{
									{
										Identifier:       ptr.String("__Identifier__"),
										PolicyVersionArn: ptr.String("__PolicyVersionArn__"),
									},
									{
										Identifier:       ptr.String("__Identifier__"),
										PolicyVersionArn: ptr.String("__PolicyVersionArn__"),
									},
								},
								LogicWarning: &types.GuardrailAutomatedReasoningLogicWarning{
									Type: types.GuardrailAutomatedReasoningLogicWarningType("ALWAYS_FALSE"),
									Premises: []types.GuardrailAutomatedReasoningStatement{
										{
											Logic:           ptr.String("__Logic__"),
											NaturalLanguage: ptr.String("__NaturalLanguage__"),
										},
										{
											Logic:           ptr.String("__Logic__"),
											NaturalLanguage: ptr.String("__NaturalLanguage__"),
										},
									},
									Claims: []types.GuardrailAutomatedReasoningStatement{
										{
											Logic:           ptr.String("__Logic__"),
											NaturalLanguage: ptr.String("__NaturalLanguage__"),
										},
										{
											Logic:           ptr.String("__Logic__"),
											NaturalLanguage: ptr.String("__NaturalLanguage__"),
										},
									},
								},
							},
						},
						&types.GuardrailAutomatedReasoningFindingMemberValid{
							Value: types.GuardrailAutomatedReasoningValidFinding{
								Translation: &types.GuardrailAutomatedReasoningTranslation{
									Premises: []types.GuardrailAutomatedReasoningStatement{
										{
											Logic:           ptr.String("__Logic__"),
											NaturalLanguage: ptr.String("__NaturalLanguage__"),
										},
										{
											Logic:           ptr.String("__Logic__"),
											NaturalLanguage: ptr.String("__NaturalLanguage__"),
										},
									},
									Claims: []types.GuardrailAutomatedReasoningStatement{
										{
											Logic:           ptr.String("__Logic__"),
											NaturalLanguage: ptr.String("__NaturalLanguage__"),
										},
										{
											Logic:           ptr.String("__Logic__"),
											NaturalLanguage: ptr.String("__NaturalLanguage__"),
										},
									},
									UntranslatedPremises: []types.GuardrailAutomatedReasoningInputTextReference{
										{
											Text: ptr.String("__Text__"),
										},
										{
											Text: ptr.String("__Text__"),
										},
									},
									UntranslatedClaims: []types.GuardrailAutomatedReasoningInputTextReference{
										{
											Text: ptr.String("__Text__"),
										},
										{
											Text: ptr.String("__Text__"),
										},
									},
									Confidence: ptr.Float64(1.0),
								},
								ClaimsTrueScenario: &types.GuardrailAutomatedReasoningScenario{
									Statements: []types.GuardrailAutomatedReasoningStatement{
										{
											Logic:           ptr.String("__Logic__"),
											NaturalLanguage: ptr.String("__NaturalLanguage__"),
										},
										{
											Logic:           ptr.String("__Logic__"),
											NaturalLanguage: ptr.String("__NaturalLanguage__"),
										},
									},
								},
								SupportingRules: []types.GuardrailAutomatedReasoningRule{
									{
										Identifier:       ptr.String("__Identifier__"),
										PolicyVersionArn: ptr.String("__PolicyVersionArn__"),
									},
									{
										Identifier:       ptr.String("__Identifier__"),
										PolicyVersionArn: ptr.String("__PolicyVersionArn__"),
									},
								},
								LogicWarning: &types.GuardrailAutomatedReasoningLogicWarning{
									Type: types.GuardrailAutomatedReasoningLogicWarningType("ALWAYS_FALSE"),
									Premises: []types.GuardrailAutomatedReasoningStatement{
										{
											Logic:           ptr.String("__Logic__"),
											NaturalLanguage: ptr.String("__NaturalLanguage__"),
										},
										{
											Logic:           ptr.String("__Logic__"),
											NaturalLanguage: ptr.String("__NaturalLanguage__"),
										},
									},
									Claims: []types.GuardrailAutomatedReasoningStatement{
										{
											Logic:           ptr.String("__Logic__"),
											NaturalLanguage: ptr.String("__NaturalLanguage__"),
										},
										{
											Logic:           ptr.String("__Logic__"),
											NaturalLanguage: ptr.String("__NaturalLanguage__"),
										},
									},
								},
							},
						},
					},
				},
				InvocationMetrics: &types.GuardrailInvocationMetrics{
					GuardrailProcessingLatency: ptr.Int64(1),
					Usage: &types.GuardrailUsage{
						TopicPolicyUnits:                    ptr.Int32(1),
						ContentPolicyUnits:                  ptr.Int32(1),
						WordPolicyUnits:                     ptr.Int32(1),
						SensitiveInformationPolicyUnits:     ptr.Int32(1),
						SensitiveInformationPolicyFreeUnits: ptr.Int32(1),
						ContextualGroundingPolicyUnits:      ptr.Int32(1),
						ContentPolicyImageUnits:             ptr.Int32(1),
						AutomatedReasoningPolicyUnits:       ptr.Int32(1),
						AutomatedReasoningPolicies:          ptr.Int32(1),
					},
					GuardrailCoverage: &types.GuardrailCoverage{
						TextCharacters: &types.GuardrailTextCharactersCoverage{
							Guarded: ptr.Int32(1),
							Total:   ptr.Int32(1),
						},
						Images: &types.GuardrailImageCoverage{
							Guarded: ptr.Int32(1),
							Total:   ptr.Int32(1),
						},
					},
				},
				AppliedGuardrailDetails: &types.AppliedGuardrailDetails{
					GuardrailId:      ptr.String("__GuardrailId__"),
					GuardrailVersion: ptr.String("__GuardrailVersion__"),
					GuardrailArn:     ptr.String("__GuardrailArn__"),
					GuardrailOrigin: []types.GuardrailOrigin{
						types.GuardrailOrigin("REQUEST"),
						types.GuardrailOrigin("REQUEST"),
					},
					GuardrailOwnership: types.GuardrailOwnership("SELF"),
				},
			},
		},
		GuardrailCoverage: &types.GuardrailCoverage{
			TextCharacters: &types.GuardrailTextCharactersCoverage{
				Guarded: ptr.Int32(1),
				Total:   ptr.Int32(1),
			},
			Images: &types.GuardrailImageCoverage{
				Guarded: ptr.Int32(1),
				Total:   ptr.Int32(1),
			},
		},
	}
	status, header, body, err := serdeRespReadSnapshot("ApplyGuardrail.response")
	if errors.Is(err, fs.ErrNotExist) {
		t.Skip("no response snapshot fixture")
	}
	if err != nil {
		t.Fatal(err)
	}
	svc := serdeRespClient(status, header, body)
	got, err := svc.ApplyGuardrail(context.Background(), &ApplyGuardrailInput{})
	if err != nil {
		t.Fatal(err)
	}
	if err := smithytesting.CompareValues(want, got); err != nil {
		t.Errorf("response snapshot mismatch for %s: %v", "ApplyGuardrail.response", err)
	}
}

func TestCheckResponseSnapshot_Converse(t *testing.T) {
	want := &ConverseOutput{
		Output: &types.ConverseOutputMemberMessage{
			Value: types.Message{
				Role: types.ConversationRole("user"),
				Content: []types.ContentBlock{
					&types.ContentBlockMemberText{
						Value: "__ContentBlockMemberText__",
					},
					&types.ContentBlockMemberText{
						Value: "__ContentBlockMemberText__",
					},
				},
			},
		},
		StopReason: types.StopReason("end_turn"),
		Usage: &types.TokenUsage{
			InputTokens:           ptr.Int32(1),
			OutputTokens:          ptr.Int32(1),
			TotalTokens:           ptr.Int32(1),
			CacheReadInputTokens:  ptr.Int32(1),
			CacheWriteInputTokens: ptr.Int32(1),
			CacheDetails: []types.CacheDetail{
				{
					Ttl:         types.CacheTTL("5m"),
					InputTokens: ptr.Int32(1),
				},
				{
					Ttl:         types.CacheTTL("5m"),
					InputTokens: ptr.Int32(1),
				},
			},
		},
		Metrics: &types.ConverseMetrics{
			LatencyMs: ptr.Int64(1),
		},
		AdditionalModelResponseFields: nil,
		Trace: &types.ConverseTrace{
			Guardrail: &types.GuardrailTraceAssessment{
				ModelOutput: []string{
					"__Member__",
					"__Member__",
				},
				InputAssessment: map[string]types.GuardrailAssessment{
					"key0": {
						TopicPolicy: &types.GuardrailTopicPolicyAssessment{
							Topics: []types.GuardrailTopic{
								{
									Name:     ptr.String("__Name__"),
									Type:     types.GuardrailTopicType("DENY"),
									Action:   types.GuardrailTopicPolicyAction("BLOCKED"),
									Detected: ptr.Bool(true),
								},
								{
									Name:     ptr.String("__Name__"),
									Type:     types.GuardrailTopicType("DENY"),
									Action:   types.GuardrailTopicPolicyAction("BLOCKED"),
									Detected: ptr.Bool(true),
								},
							},
						},
						ContentPolicy: &types.GuardrailContentPolicyAssessment{
							Filters: []types.GuardrailContentFilter{
								{
									Type:           types.GuardrailContentFilterType("INSULTS"),
									Confidence:     types.GuardrailContentFilterConfidence("NONE"),
									FilterStrength: types.GuardrailContentFilterStrength("NONE"),
									Action:         types.GuardrailContentPolicyAction("BLOCKED"),
									Detected:       ptr.Bool(true),
								},
								{
									Type:           types.GuardrailContentFilterType("INSULTS"),
									Confidence:     types.GuardrailContentFilterConfidence("NONE"),
									FilterStrength: types.GuardrailContentFilterStrength("NONE"),
									Action:         types.GuardrailContentPolicyAction("BLOCKED"),
									Detected:       ptr.Bool(true),
								},
							},
						},
						WordPolicy: &types.GuardrailWordPolicyAssessment{
							CustomWords: []types.GuardrailCustomWord{
								{
									Match:    ptr.String("__Match__"),
									Action:   types.GuardrailWordPolicyAction("BLOCKED"),
									Detected: ptr.Bool(true),
								},
								{
									Match:    ptr.String("__Match__"),
									Action:   types.GuardrailWordPolicyAction("BLOCKED"),
									Detected: ptr.Bool(true),
								},
							},
							ManagedWordLists: []types.GuardrailManagedWord{
								{
									Match:    ptr.String("__Match__"),
									Type:     types.GuardrailManagedWordType("PROFANITY"),
									Action:   types.GuardrailWordPolicyAction("BLOCKED"),
									Detected: ptr.Bool(true),
								},
								{
									Match:    ptr.String("__Match__"),
									Type:     types.GuardrailManagedWordType("PROFANITY"),
									Action:   types.GuardrailWordPolicyAction("BLOCKED"),
									Detected: ptr.Bool(true),
								},
							},
						},
						SensitiveInformationPolicy: &types.GuardrailSensitiveInformationPolicyAssessment{
							PiiEntities: []types.GuardrailPiiEntityFilter{
								{
									Match:    ptr.String("__Match__"),
									Type:     types.GuardrailPiiEntityType("ADDRESS"),
									Action:   types.GuardrailSensitiveInformationPolicyAction("ANONYMIZED"),
									Detected: ptr.Bool(true),
								},
								{
									Match:    ptr.String("__Match__"),
									Type:     types.GuardrailPiiEntityType("ADDRESS"),
									Action:   types.GuardrailSensitiveInformationPolicyAction("ANONYMIZED"),
									Detected: ptr.Bool(true),
								},
							},
							Regexes: []types.GuardrailRegexFilter{
								{
									Name:     ptr.String("__Name__"),
									Match:    ptr.String("__Match__"),
									Regex:    ptr.String("__Regex__"),
									Action:   types.GuardrailSensitiveInformationPolicyAction("ANONYMIZED"),
									Detected: ptr.Bool(true),
								},
								{
									Name:     ptr.String("__Name__"),
									Match:    ptr.String("__Match__"),
									Regex:    ptr.String("__Regex__"),
									Action:   types.GuardrailSensitiveInformationPolicyAction("ANONYMIZED"),
									Detected: ptr.Bool(true),
								},
							},
						},
						ContextualGroundingPolicy: &types.GuardrailContextualGroundingPolicyAssessment{
							Filters: []types.GuardrailContextualGroundingFilter{
								{
									Type:      types.GuardrailContextualGroundingFilterType("GROUNDING"),
									Threshold: ptr.Float64(1.0),
									Score:     ptr.Float64(1.0),
									Action:    types.GuardrailContextualGroundingPolicyAction("BLOCKED"),
									Detected:  ptr.Bool(true),
								},
								{
									Type:      types.GuardrailContextualGroundingFilterType("GROUNDING"),
									Threshold: ptr.Float64(1.0),
									Score:     ptr.Float64(1.0),
									Action:    types.GuardrailContextualGroundingPolicyAction("BLOCKED"),
									Detected:  ptr.Bool(true),
								},
							},
						},
						AutomatedReasoningPolicy: &types.GuardrailAutomatedReasoningPolicyAssessment{
							Findings: []types.GuardrailAutomatedReasoningFinding{
								&types.GuardrailAutomatedReasoningFindingMemberValid{
									Value: types.GuardrailAutomatedReasoningValidFinding{
										Translation: &types.GuardrailAutomatedReasoningTranslation{
											Premises: []types.GuardrailAutomatedReasoningStatement{
												{
													Logic:           ptr.String("__Logic__"),
													NaturalLanguage: ptr.String("__NaturalLanguage__"),
												},
												{
													Logic:           ptr.String("__Logic__"),
													NaturalLanguage: ptr.String("__NaturalLanguage__"),
												},
											},
											Claims: []types.GuardrailAutomatedReasoningStatement{
												{
													Logic:           ptr.String("__Logic__"),
													NaturalLanguage: ptr.String("__NaturalLanguage__"),
												},
												{
													Logic:           ptr.String("__Logic__"),
													NaturalLanguage: ptr.String("__NaturalLanguage__"),
												},
											},
											UntranslatedPremises: []types.GuardrailAutomatedReasoningInputTextReference{
												{
													Text: ptr.String("__Text__"),
												},
												{
													Text: ptr.String("__Text__"),
												},
											},
											UntranslatedClaims: []types.GuardrailAutomatedReasoningInputTextReference{
												{
													Text: ptr.String("__Text__"),
												},
												{
													Text: ptr.String("__Text__"),
												},
											},
											Confidence: ptr.Float64(1.0),
										},
										ClaimsTrueScenario: &types.GuardrailAutomatedReasoningScenario{
											Statements: []types.GuardrailAutomatedReasoningStatement{
												{
													Logic:           ptr.String("__Logic__"),
													NaturalLanguage: ptr.String("__NaturalLanguage__"),
												},
												{
													Logic:           ptr.String("__Logic__"),
													NaturalLanguage: ptr.String("__NaturalLanguage__"),
												},
											},
										},
										SupportingRules: []types.GuardrailAutomatedReasoningRule{
											{
												Identifier:       ptr.String("__Identifier__"),
												PolicyVersionArn: ptr.String("__PolicyVersionArn__"),
											},
											{
												Identifier:       ptr.String("__Identifier__"),
												PolicyVersionArn: ptr.String("__PolicyVersionArn__"),
											},
										},
										LogicWarning: &types.GuardrailAutomatedReasoningLogicWarning{
											Type: types.GuardrailAutomatedReasoningLogicWarningType("ALWAYS_FALSE"),
											Premises: []types.GuardrailAutomatedReasoningStatement{
												{
													Logic:           ptr.String("__Logic__"),
													NaturalLanguage: ptr.String("__NaturalLanguage__"),
												},
												{
													Logic:           ptr.String("__Logic__"),
													NaturalLanguage: ptr.String("__NaturalLanguage__"),
												},
											},
											Claims: []types.GuardrailAutomatedReasoningStatement{
												{
													Logic:           ptr.String("__Logic__"),
													NaturalLanguage: ptr.String("__NaturalLanguage__"),
												},
												{
													Logic:           ptr.String("__Logic__"),
													NaturalLanguage: ptr.String("__NaturalLanguage__"),
												},
											},
										},
									},
								},
								&types.GuardrailAutomatedReasoningFindingMemberValid{
									Value: types.GuardrailAutomatedReasoningValidFinding{
										Translation: &types.GuardrailAutomatedReasoningTranslation{
											Premises: []types.GuardrailAutomatedReasoningStatement{
												{
													Logic:           ptr.String("__Logic__"),
													NaturalLanguage: ptr.String("__NaturalLanguage__"),
												},
												{
													Logic:           ptr.String("__Logic__"),
													NaturalLanguage: ptr.String("__NaturalLanguage__"),
												},
											},
											Claims: []types.GuardrailAutomatedReasoningStatement{
												{
													Logic:           ptr.String("__Logic__"),
													NaturalLanguage: ptr.String("__NaturalLanguage__"),
												},
												{
													Logic:           ptr.String("__Logic__"),
													NaturalLanguage: ptr.String("__NaturalLanguage__"),
												},
											},
											UntranslatedPremises: []types.GuardrailAutomatedReasoningInputTextReference{
												{
													Text: ptr.String("__Text__"),
												},
												{
													Text: ptr.String("__Text__"),
												},
											},
											UntranslatedClaims: []types.GuardrailAutomatedReasoningInputTextReference{
												{
													Text: ptr.String("__Text__"),
												},
												{
													Text: ptr.String("__Text__"),
												},
											},
											Confidence: ptr.Float64(1.0),
										},
										ClaimsTrueScenario: &types.GuardrailAutomatedReasoningScenario{
											Statements: []types.GuardrailAutomatedReasoningStatement{
												{
													Logic:           ptr.String("__Logic__"),
													NaturalLanguage: ptr.String("__NaturalLanguage__"),
												},
												{
													Logic:           ptr.String("__Logic__"),
													NaturalLanguage: ptr.String("__NaturalLanguage__"),
												},
											},
										},
										SupportingRules: []types.GuardrailAutomatedReasoningRule{
											{
												Identifier:       ptr.String("__Identifier__"),
												PolicyVersionArn: ptr.String("__PolicyVersionArn__"),
											},
											{
												Identifier:       ptr.String("__Identifier__"),
												PolicyVersionArn: ptr.String("__PolicyVersionArn__"),
											},
										},
										LogicWarning: &types.GuardrailAutomatedReasoningLogicWarning{
											Type: types.GuardrailAutomatedReasoningLogicWarningType("ALWAYS_FALSE"),
											Premises: []types.GuardrailAutomatedReasoningStatement{
												{
													Logic:           ptr.String("__Logic__"),
													NaturalLanguage: ptr.String("__NaturalLanguage__"),
												},
												{
													Logic:           ptr.String("__Logic__"),
													NaturalLanguage: ptr.String("__NaturalLanguage__"),
												},
											},
											Claims: []types.GuardrailAutomatedReasoningStatement{
												{
													Logic:           ptr.String("__Logic__"),
													NaturalLanguage: ptr.String("__NaturalLanguage__"),
												},
												{
													Logic:           ptr.String("__Logic__"),
													NaturalLanguage: ptr.String("__NaturalLanguage__"),
												},
											},
										},
									},
								},
							},
						},
						InvocationMetrics: &types.GuardrailInvocationMetrics{
							GuardrailProcessingLatency: ptr.Int64(1),
							Usage: &types.GuardrailUsage{
								TopicPolicyUnits:                    ptr.Int32(1),
								ContentPolicyUnits:                  ptr.Int32(1),
								WordPolicyUnits:                     ptr.Int32(1),
								SensitiveInformationPolicyUnits:     ptr.Int32(1),
								SensitiveInformationPolicyFreeUnits: ptr.Int32(1),
								ContextualGroundingPolicyUnits:      ptr.Int32(1),
								ContentPolicyImageUnits:             ptr.Int32(1),
								AutomatedReasoningPolicyUnits:       ptr.Int32(1),
								AutomatedReasoningPolicies:          ptr.Int32(1),
							},
							GuardrailCoverage: &types.GuardrailCoverage{
								TextCharacters: &types.GuardrailTextCharactersCoverage{
									Guarded: ptr.Int32(1),
									Total:   ptr.Int32(1),
								},
								Images: &types.GuardrailImageCoverage{
									Guarded: ptr.Int32(1),
									Total:   ptr.Int32(1),
								},
							},
						},
						AppliedGuardrailDetails: &types.AppliedGuardrailDetails{
							GuardrailId:      ptr.String("__GuardrailId__"),
							GuardrailVersion: ptr.String("__GuardrailVersion__"),
							GuardrailArn:     ptr.String("__GuardrailArn__"),
							GuardrailOrigin: []types.GuardrailOrigin{
								types.GuardrailOrigin("REQUEST"),
								types.GuardrailOrigin("REQUEST"),
							},
							GuardrailOwnership: types.GuardrailOwnership("SELF"),
						},
					},
				},
				OutputAssessments: map[string][]types.GuardrailAssessment{
					"key0": {
						{
							TopicPolicy: &types.GuardrailTopicPolicyAssessment{
								Topics: []types.GuardrailTopic{
									{
										Name:     ptr.String("__Name__"),
										Type:     types.GuardrailTopicType("DENY"),
										Action:   types.GuardrailTopicPolicyAction("BLOCKED"),
										Detected: ptr.Bool(true),
									},
									{
										Name:     ptr.String("__Name__"),
										Type:     types.GuardrailTopicType("DENY"),
										Action:   types.GuardrailTopicPolicyAction("BLOCKED"),
										Detected: ptr.Bool(true),
									},
								},
							},
							ContentPolicy: &types.GuardrailContentPolicyAssessment{
								Filters: []types.GuardrailContentFilter{
									{
										Type:           types.GuardrailContentFilterType("INSULTS"),
										Confidence:     types.GuardrailContentFilterConfidence("NONE"),
										FilterStrength: types.GuardrailContentFilterStrength("NONE"),
										Action:         types.GuardrailContentPolicyAction("BLOCKED"),
										Detected:       ptr.Bool(true),
									},
									{
										Type:           types.GuardrailContentFilterType("INSULTS"),
										Confidence:     types.GuardrailContentFilterConfidence("NONE"),
										FilterStrength: types.GuardrailContentFilterStrength("NONE"),
										Action:         types.GuardrailContentPolicyAction("BLOCKED"),
										Detected:       ptr.Bool(true),
									},
								},
							},
							WordPolicy: &types.GuardrailWordPolicyAssessment{
								CustomWords: []types.GuardrailCustomWord{
									{
										Match:    ptr.String("__Match__"),
										Action:   types.GuardrailWordPolicyAction("BLOCKED"),
										Detected: ptr.Bool(true),
									},
									{
										Match:    ptr.String("__Match__"),
										Action:   types.GuardrailWordPolicyAction("BLOCKED"),
										Detected: ptr.Bool(true),
									},
								},
								ManagedWordLists: []types.GuardrailManagedWord{
									{
										Match:    ptr.String("__Match__"),
										Type:     types.GuardrailManagedWordType("PROFANITY"),
										Action:   types.GuardrailWordPolicyAction("BLOCKED"),
										Detected: ptr.Bool(true),
									},
									{
										Match:    ptr.String("__Match__"),
										Type:     types.GuardrailManagedWordType("PROFANITY"),
										Action:   types.GuardrailWordPolicyAction("BLOCKED"),
										Detected: ptr.Bool(true),
									},
								},
							},
							SensitiveInformationPolicy: &types.GuardrailSensitiveInformationPolicyAssessment{
								PiiEntities: []types.GuardrailPiiEntityFilter{
									{
										Match:    ptr.String("__Match__"),
										Type:     types.GuardrailPiiEntityType("ADDRESS"),
										Action:   types.GuardrailSensitiveInformationPolicyAction("ANONYMIZED"),
										Detected: ptr.Bool(true),
									},
									{
										Match:    ptr.String("__Match__"),
										Type:     types.GuardrailPiiEntityType("ADDRESS"),
										Action:   types.GuardrailSensitiveInformationPolicyAction("ANONYMIZED"),
										Detected: ptr.Bool(true),
									},
								},
								Regexes: []types.GuardrailRegexFilter{
									{
										Name:     ptr.String("__Name__"),
										Match:    ptr.String("__Match__"),
										Regex:    ptr.String("__Regex__"),
										Action:   types.GuardrailSensitiveInformationPolicyAction("ANONYMIZED"),
										Detected: ptr.Bool(true),
									},
									{
										Name:     ptr.String("__Name__"),
										Match:    ptr.String("__Match__"),
										Regex:    ptr.String("__Regex__"),
										Action:   types.GuardrailSensitiveInformationPolicyAction("ANONYMIZED"),
										Detected: ptr.Bool(true),
									},
								},
							},
							ContextualGroundingPolicy: &types.GuardrailContextualGroundingPolicyAssessment{
								Filters: []types.GuardrailContextualGroundingFilter{
									{
										Type:      types.GuardrailContextualGroundingFilterType("GROUNDING"),
										Threshold: ptr.Float64(1.0),
										Score:     ptr.Float64(1.0),
										Action:    types.GuardrailContextualGroundingPolicyAction("BLOCKED"),
										Detected:  ptr.Bool(true),
									},
									{
										Type:      types.GuardrailContextualGroundingFilterType("GROUNDING"),
										Threshold: ptr.Float64(1.0),
										Score:     ptr.Float64(1.0),
										Action:    types.GuardrailContextualGroundingPolicyAction("BLOCKED"),
										Detected:  ptr.Bool(true),
									},
								},
							},
							AutomatedReasoningPolicy: &types.GuardrailAutomatedReasoningPolicyAssessment{
								Findings: []types.GuardrailAutomatedReasoningFinding{
									&types.GuardrailAutomatedReasoningFindingMemberValid{
										Value: types.GuardrailAutomatedReasoningValidFinding{
											Translation: &types.GuardrailAutomatedReasoningTranslation{
												Premises: []types.GuardrailAutomatedReasoningStatement{
													{
														Logic:           ptr.String("__Logic__"),
														NaturalLanguage: ptr.String("__NaturalLanguage__"),
													},
													{
														Logic:           ptr.String("__Logic__"),
														NaturalLanguage: ptr.String("__NaturalLanguage__"),
													},
												},
												Claims: []types.GuardrailAutomatedReasoningStatement{
													{
														Logic:           ptr.String("__Logic__"),
														NaturalLanguage: ptr.String("__NaturalLanguage__"),
													},
													{
														Logic:           ptr.String("__Logic__"),
														NaturalLanguage: ptr.String("__NaturalLanguage__"),
													},
												},
												UntranslatedPremises: []types.GuardrailAutomatedReasoningInputTextReference{
													{
														Text: ptr.String("__Text__"),
													},
													{
														Text: ptr.String("__Text__"),
													},
												},
												UntranslatedClaims: []types.GuardrailAutomatedReasoningInputTextReference{
													{
														Text: ptr.String("__Text__"),
													},
													{
														Text: ptr.String("__Text__"),
													},
												},
												Confidence: ptr.Float64(1.0),
											},
											ClaimsTrueScenario: &types.GuardrailAutomatedReasoningScenario{
												Statements: []types.GuardrailAutomatedReasoningStatement{
													{
														Logic:           ptr.String("__Logic__"),
														NaturalLanguage: ptr.String("__NaturalLanguage__"),
													},
													{
														Logic:           ptr.String("__Logic__"),
														NaturalLanguage: ptr.String("__NaturalLanguage__"),
													},
												},
											},
											SupportingRules: []types.GuardrailAutomatedReasoningRule{
												{
													Identifier:       ptr.String("__Identifier__"),
													PolicyVersionArn: ptr.String("__PolicyVersionArn__"),
												},
												{
													Identifier:       ptr.String("__Identifier__"),
													PolicyVersionArn: ptr.String("__PolicyVersionArn__"),
												},
											},
											LogicWarning: &types.GuardrailAutomatedReasoningLogicWarning{
												Type: types.GuardrailAutomatedReasoningLogicWarningType("ALWAYS_FALSE"),
												Premises: []types.GuardrailAutomatedReasoningStatement{
													{
														Logic:           ptr.String("__Logic__"),
														NaturalLanguage: ptr.String("__NaturalLanguage__"),
													},
													{
														Logic:           ptr.String("__Logic__"),
														NaturalLanguage: ptr.String("__NaturalLanguage__"),
													},
												},
												Claims: []types.GuardrailAutomatedReasoningStatement{
													{
														Logic:           ptr.String("__Logic__"),
														NaturalLanguage: ptr.String("__NaturalLanguage__"),
													},
													{
														Logic:           ptr.String("__Logic__"),
														NaturalLanguage: ptr.String("__NaturalLanguage__"),
													},
												},
											},
										},
									},
									&types.GuardrailAutomatedReasoningFindingMemberValid{
										Value: types.GuardrailAutomatedReasoningValidFinding{
											Translation: &types.GuardrailAutomatedReasoningTranslation{
												Premises: []types.GuardrailAutomatedReasoningStatement{
													{
														Logic:           ptr.String("__Logic__"),
														NaturalLanguage: ptr.String("__NaturalLanguage__"),
													},
													{
														Logic:           ptr.String("__Logic__"),
														NaturalLanguage: ptr.String("__NaturalLanguage__"),
													},
												},
												Claims: []types.GuardrailAutomatedReasoningStatement{
													{
														Logic:           ptr.String("__Logic__"),
														NaturalLanguage: ptr.String("__NaturalLanguage__"),
													},
													{
														Logic:           ptr.String("__Logic__"),
														NaturalLanguage: ptr.String("__NaturalLanguage__"),
													},
												},
												UntranslatedPremises: []types.GuardrailAutomatedReasoningInputTextReference{
													{
														Text: ptr.String("__Text__"),
													},
													{
														Text: ptr.String("__Text__"),
													},
												},
												UntranslatedClaims: []types.GuardrailAutomatedReasoningInputTextReference{
													{
														Text: ptr.String("__Text__"),
													},
													{
														Text: ptr.String("__Text__"),
													},
												},
												Confidence: ptr.Float64(1.0),
											},
											ClaimsTrueScenario: &types.GuardrailAutomatedReasoningScenario{
												Statements: []types.GuardrailAutomatedReasoningStatement{
													{
														Logic:           ptr.String("__Logic__"),
														NaturalLanguage: ptr.String("__NaturalLanguage__"),
													},
													{
														Logic:           ptr.String("__Logic__"),
														NaturalLanguage: ptr.String("__NaturalLanguage__"),
													},
												},
											},
											SupportingRules: []types.GuardrailAutomatedReasoningRule{
												{
													Identifier:       ptr.String("__Identifier__"),
													PolicyVersionArn: ptr.String("__PolicyVersionArn__"),
												},
												{
													Identifier:       ptr.String("__Identifier__"),
													PolicyVersionArn: ptr.String("__PolicyVersionArn__"),
												},
											},
											LogicWarning: &types.GuardrailAutomatedReasoningLogicWarning{
												Type: types.GuardrailAutomatedReasoningLogicWarningType("ALWAYS_FALSE"),
												Premises: []types.GuardrailAutomatedReasoningStatement{
													{
														Logic:           ptr.String("__Logic__"),
														NaturalLanguage: ptr.String("__NaturalLanguage__"),
													},
													{
														Logic:           ptr.String("__Logic__"),
														NaturalLanguage: ptr.String("__NaturalLanguage__"),
													},
												},
												Claims: []types.GuardrailAutomatedReasoningStatement{
													{
														Logic:           ptr.String("__Logic__"),
														NaturalLanguage: ptr.String("__NaturalLanguage__"),
													},
													{
														Logic:           ptr.String("__Logic__"),
														NaturalLanguage: ptr.String("__NaturalLanguage__"),
													},
												},
											},
										},
									},
								},
							},
							InvocationMetrics: &types.GuardrailInvocationMetrics{
								GuardrailProcessingLatency: ptr.Int64(1),
								Usage: &types.GuardrailUsage{
									TopicPolicyUnits:                    ptr.Int32(1),
									ContentPolicyUnits:                  ptr.Int32(1),
									WordPolicyUnits:                     ptr.Int32(1),
									SensitiveInformationPolicyUnits:     ptr.Int32(1),
									SensitiveInformationPolicyFreeUnits: ptr.Int32(1),
									ContextualGroundingPolicyUnits:      ptr.Int32(1),
									ContentPolicyImageUnits:             ptr.Int32(1),
									AutomatedReasoningPolicyUnits:       ptr.Int32(1),
									AutomatedReasoningPolicies:          ptr.Int32(1),
								},
								GuardrailCoverage: &types.GuardrailCoverage{
									TextCharacters: &types.GuardrailTextCharactersCoverage{
										Guarded: ptr.Int32(1),
										Total:   ptr.Int32(1),
									},
									Images: &types.GuardrailImageCoverage{
										Guarded: ptr.Int32(1),
										Total:   ptr.Int32(1),
									},
								},
							},
							AppliedGuardrailDetails: &types.AppliedGuardrailDetails{
								GuardrailId:      ptr.String("__GuardrailId__"),
								GuardrailVersion: ptr.String("__GuardrailVersion__"),
								GuardrailArn:     ptr.String("__GuardrailArn__"),
								GuardrailOrigin: []types.GuardrailOrigin{
									types.GuardrailOrigin("REQUEST"),
									types.GuardrailOrigin("REQUEST"),
								},
								GuardrailOwnership: types.GuardrailOwnership("SELF"),
							},
						},
						{
							TopicPolicy: &types.GuardrailTopicPolicyAssessment{
								Topics: []types.GuardrailTopic{
									{
										Name:     ptr.String("__Name__"),
										Type:     types.GuardrailTopicType("DENY"),
										Action:   types.GuardrailTopicPolicyAction("BLOCKED"),
										Detected: ptr.Bool(true),
									},
									{
										Name:     ptr.String("__Name__"),
										Type:     types.GuardrailTopicType("DENY"),
										Action:   types.GuardrailTopicPolicyAction("BLOCKED"),
										Detected: ptr.Bool(true),
									},
								},
							},
							ContentPolicy: &types.GuardrailContentPolicyAssessment{
								Filters: []types.GuardrailContentFilter{
									{
										Type:           types.GuardrailContentFilterType("INSULTS"),
										Confidence:     types.GuardrailContentFilterConfidence("NONE"),
										FilterStrength: types.GuardrailContentFilterStrength("NONE"),
										Action:         types.GuardrailContentPolicyAction("BLOCKED"),
										Detected:       ptr.Bool(true),
									},
									{
										Type:           types.GuardrailContentFilterType("INSULTS"),
										Confidence:     types.GuardrailContentFilterConfidence("NONE"),
										FilterStrength: types.GuardrailContentFilterStrength("NONE"),
										Action:         types.GuardrailContentPolicyAction("BLOCKED"),
										Detected:       ptr.Bool(true),
									},
								},
							},
							WordPolicy: &types.GuardrailWordPolicyAssessment{
								CustomWords: []types.GuardrailCustomWord{
									{
										Match:    ptr.String("__Match__"),
										Action:   types.GuardrailWordPolicyAction("BLOCKED"),
										Detected: ptr.Bool(true),
									},
									{
										Match:    ptr.String("__Match__"),
										Action:   types.GuardrailWordPolicyAction("BLOCKED"),
										Detected: ptr.Bool(true),
									},
								},
								ManagedWordLists: []types.GuardrailManagedWord{
									{
										Match:    ptr.String("__Match__"),
										Type:     types.GuardrailManagedWordType("PROFANITY"),
										Action:   types.GuardrailWordPolicyAction("BLOCKED"),
										Detected: ptr.Bool(true),
									},
									{
										Match:    ptr.String("__Match__"),
										Type:     types.GuardrailManagedWordType("PROFANITY"),
										Action:   types.GuardrailWordPolicyAction("BLOCKED"),
										Detected: ptr.Bool(true),
									},
								},
							},
							SensitiveInformationPolicy: &types.GuardrailSensitiveInformationPolicyAssessment{
								PiiEntities: []types.GuardrailPiiEntityFilter{
									{
										Match:    ptr.String("__Match__"),
										Type:     types.GuardrailPiiEntityType("ADDRESS"),
										Action:   types.GuardrailSensitiveInformationPolicyAction("ANONYMIZED"),
										Detected: ptr.Bool(true),
									},
									{
										Match:    ptr.String("__Match__"),
										Type:     types.GuardrailPiiEntityType("ADDRESS"),
										Action:   types.GuardrailSensitiveInformationPolicyAction("ANONYMIZED"),
										Detected: ptr.Bool(true),
									},
								},
								Regexes: []types.GuardrailRegexFilter{
									{
										Name:     ptr.String("__Name__"),
										Match:    ptr.String("__Match__"),
										Regex:    ptr.String("__Regex__"),
										Action:   types.GuardrailSensitiveInformationPolicyAction("ANONYMIZED"),
										Detected: ptr.Bool(true),
									},
									{
										Name:     ptr.String("__Name__"),
										Match:    ptr.String("__Match__"),
										Regex:    ptr.String("__Regex__"),
										Action:   types.GuardrailSensitiveInformationPolicyAction("ANONYMIZED"),
										Detected: ptr.Bool(true),
									},
								},
							},
							ContextualGroundingPolicy: &types.GuardrailContextualGroundingPolicyAssessment{
								Filters: []types.GuardrailContextualGroundingFilter{
									{
										Type:      types.GuardrailContextualGroundingFilterType("GROUNDING"),
										Threshold: ptr.Float64(1.0),
										Score:     ptr.Float64(1.0),
										Action:    types.GuardrailContextualGroundingPolicyAction("BLOCKED"),
										Detected:  ptr.Bool(true),
									},
									{
										Type:      types.GuardrailContextualGroundingFilterType("GROUNDING"),
										Threshold: ptr.Float64(1.0),
										Score:     ptr.Float64(1.0),
										Action:    types.GuardrailContextualGroundingPolicyAction("BLOCKED"),
										Detected:  ptr.Bool(true),
									},
								},
							},
							AutomatedReasoningPolicy: &types.GuardrailAutomatedReasoningPolicyAssessment{
								Findings: []types.GuardrailAutomatedReasoningFinding{
									&types.GuardrailAutomatedReasoningFindingMemberValid{
										Value: types.GuardrailAutomatedReasoningValidFinding{
											Translation: &types.GuardrailAutomatedReasoningTranslation{
												Premises: []types.GuardrailAutomatedReasoningStatement{
													{
														Logic:           ptr.String("__Logic__"),
														NaturalLanguage: ptr.String("__NaturalLanguage__"),
													},
													{
														Logic:           ptr.String("__Logic__"),
														NaturalLanguage: ptr.String("__NaturalLanguage__"),
													},
												},
												Claims: []types.GuardrailAutomatedReasoningStatement{
													{
														Logic:           ptr.String("__Logic__"),
														NaturalLanguage: ptr.String("__NaturalLanguage__"),
													},
													{
														Logic:           ptr.String("__Logic__"),
														NaturalLanguage: ptr.String("__NaturalLanguage__"),
													},
												},
												UntranslatedPremises: []types.GuardrailAutomatedReasoningInputTextReference{
													{
														Text: ptr.String("__Text__"),
													},
													{
														Text: ptr.String("__Text__"),
													},
												},
												UntranslatedClaims: []types.GuardrailAutomatedReasoningInputTextReference{
													{
														Text: ptr.String("__Text__"),
													},
													{
														Text: ptr.String("__Text__"),
													},
												},
												Confidence: ptr.Float64(1.0),
											},
											ClaimsTrueScenario: &types.GuardrailAutomatedReasoningScenario{
												Statements: []types.GuardrailAutomatedReasoningStatement{
													{
														Logic:           ptr.String("__Logic__"),
														NaturalLanguage: ptr.String("__NaturalLanguage__"),
													},
													{
														Logic:           ptr.String("__Logic__"),
														NaturalLanguage: ptr.String("__NaturalLanguage__"),
													},
												},
											},
											SupportingRules: []types.GuardrailAutomatedReasoningRule{
												{
													Identifier:       ptr.String("__Identifier__"),
													PolicyVersionArn: ptr.String("__PolicyVersionArn__"),
												},
												{
													Identifier:       ptr.String("__Identifier__"),
													PolicyVersionArn: ptr.String("__PolicyVersionArn__"),
												},
											},
											LogicWarning: &types.GuardrailAutomatedReasoningLogicWarning{
												Type: types.GuardrailAutomatedReasoningLogicWarningType("ALWAYS_FALSE"),
												Premises: []types.GuardrailAutomatedReasoningStatement{
													{
														Logic:           ptr.String("__Logic__"),
														NaturalLanguage: ptr.String("__NaturalLanguage__"),
													},
													{
														Logic:           ptr.String("__Logic__"),
														NaturalLanguage: ptr.String("__NaturalLanguage__"),
													},
												},
												Claims: []types.GuardrailAutomatedReasoningStatement{
													{
														Logic:           ptr.String("__Logic__"),
														NaturalLanguage: ptr.String("__NaturalLanguage__"),
													},
													{
														Logic:           ptr.String("__Logic__"),
														NaturalLanguage: ptr.String("__NaturalLanguage__"),
													},
												},
											},
										},
									},
									&types.GuardrailAutomatedReasoningFindingMemberValid{
										Value: types.GuardrailAutomatedReasoningValidFinding{
											Translation: &types.GuardrailAutomatedReasoningTranslation{
												Premises: []types.GuardrailAutomatedReasoningStatement{
													{
														Logic:           ptr.String("__Logic__"),
														NaturalLanguage: ptr.String("__NaturalLanguage__"),
													},
													{
														Logic:           ptr.String("__Logic__"),
														NaturalLanguage: ptr.String("__NaturalLanguage__"),
													},
												},
												Claims: []types.GuardrailAutomatedReasoningStatement{
													{
														Logic:           ptr.String("__Logic__"),
														NaturalLanguage: ptr.String("__NaturalLanguage__"),
													},
													{
														Logic:           ptr.String("__Logic__"),
														NaturalLanguage: ptr.String("__NaturalLanguage__"),
													},
												},
												UntranslatedPremises: []types.GuardrailAutomatedReasoningInputTextReference{
													{
														Text: ptr.String("__Text__"),
													},
													{
														Text: ptr.String("__Text__"),
													},
												},
												UntranslatedClaims: []types.GuardrailAutomatedReasoningInputTextReference{
													{
														Text: ptr.String("__Text__"),
													},
													{
														Text: ptr.String("__Text__"),
													},
												},
												Confidence: ptr.Float64(1.0),
											},
											ClaimsTrueScenario: &types.GuardrailAutomatedReasoningScenario{
												Statements: []types.GuardrailAutomatedReasoningStatement{
													{
														Logic:           ptr.String("__Logic__"),
														NaturalLanguage: ptr.String("__NaturalLanguage__"),
													},
													{
														Logic:           ptr.String("__Logic__"),
														NaturalLanguage: ptr.String("__NaturalLanguage__"),
													},
												},
											},
											SupportingRules: []types.GuardrailAutomatedReasoningRule{
												{
													Identifier:       ptr.String("__Identifier__"),
													PolicyVersionArn: ptr.String("__PolicyVersionArn__"),
												},
												{
													Identifier:       ptr.String("__Identifier__"),
													PolicyVersionArn: ptr.String("__PolicyVersionArn__"),
												},
											},
											LogicWarning: &types.GuardrailAutomatedReasoningLogicWarning{
												Type: types.GuardrailAutomatedReasoningLogicWarningType("ALWAYS_FALSE"),
												Premises: []types.GuardrailAutomatedReasoningStatement{
													{
														Logic:           ptr.String("__Logic__"),
														NaturalLanguage: ptr.String("__NaturalLanguage__"),
													},
													{
														Logic:           ptr.String("__Logic__"),
														NaturalLanguage: ptr.String("__NaturalLanguage__"),
													},
												},
												Claims: []types.GuardrailAutomatedReasoningStatement{
													{
														Logic:           ptr.String("__Logic__"),
														NaturalLanguage: ptr.String("__NaturalLanguage__"),
													},
													{
														Logic:           ptr.String("__Logic__"),
														NaturalLanguage: ptr.String("__NaturalLanguage__"),
													},
												},
											},
										},
									},
								},
							},
							InvocationMetrics: &types.GuardrailInvocationMetrics{
								GuardrailProcessingLatency: ptr.Int64(1),
								Usage: &types.GuardrailUsage{
									TopicPolicyUnits:                    ptr.Int32(1),
									ContentPolicyUnits:                  ptr.Int32(1),
									WordPolicyUnits:                     ptr.Int32(1),
									SensitiveInformationPolicyUnits:     ptr.Int32(1),
									SensitiveInformationPolicyFreeUnits: ptr.Int32(1),
									ContextualGroundingPolicyUnits:      ptr.Int32(1),
									ContentPolicyImageUnits:             ptr.Int32(1),
									AutomatedReasoningPolicyUnits:       ptr.Int32(1),
									AutomatedReasoningPolicies:          ptr.Int32(1),
								},
								GuardrailCoverage: &types.GuardrailCoverage{
									TextCharacters: &types.GuardrailTextCharactersCoverage{
										Guarded: ptr.Int32(1),
										Total:   ptr.Int32(1),
									},
									Images: &types.GuardrailImageCoverage{
										Guarded: ptr.Int32(1),
										Total:   ptr.Int32(1),
									},
								},
							},
							AppliedGuardrailDetails: &types.AppliedGuardrailDetails{
								GuardrailId:      ptr.String("__GuardrailId__"),
								GuardrailVersion: ptr.String("__GuardrailVersion__"),
								GuardrailArn:     ptr.String("__GuardrailArn__"),
								GuardrailOrigin: []types.GuardrailOrigin{
									types.GuardrailOrigin("REQUEST"),
									types.GuardrailOrigin("REQUEST"),
								},
								GuardrailOwnership: types.GuardrailOwnership("SELF"),
							},
						},
					},
				},
				ActionReason: ptr.String("__ActionReason__"),
			},
			PromptRouter: &types.PromptRouterTrace{
				InvokedModelId: ptr.String("__InvokedModelId__"),
			},
		},
		PerformanceConfig: &types.PerformanceConfiguration{
			Latency: types.PerformanceConfigLatency("standard"),
		},
		ServiceTier: &types.ServiceTier{
			Type: types.ServiceTierType("priority"),
		},
	}
	status, header, body, err := serdeRespReadSnapshot("Converse.response")
	if errors.Is(err, fs.ErrNotExist) {
		t.Skip("no response snapshot fixture")
	}
	if err != nil {
		t.Fatal(err)
	}
	svc := serdeRespClient(status, header, body)
	got, err := svc.Converse(context.Background(), &ConverseInput{})
	if err != nil {
		t.Fatal(err)
	}
	if err := smithytesting.CompareValues(want, got); err != nil {
		t.Errorf("response snapshot mismatch for %s: %v", "Converse.response", err)
	}
}

func TestCheckResponseSnapshot_CountTokens(t *testing.T) {
	want := &CountTokensOutput{
		InputTokens: ptr.Int32(1),
	}
	status, header, body, err := serdeRespReadSnapshot("CountTokens.response")
	if errors.Is(err, fs.ErrNotExist) {
		t.Skip("no response snapshot fixture")
	}
	if err != nil {
		t.Fatal(err)
	}
	svc := serdeRespClient(status, header, body)
	got, err := svc.CountTokens(context.Background(), &CountTokensInput{})
	if err != nil {
		t.Fatal(err)
	}
	if err := smithytesting.CompareValues(want, got); err != nil {
		t.Errorf("response snapshot mismatch for %s: %v", "CountTokens.response", err)
	}
}

func TestCheckResponseSnapshot_GetAsyncInvoke(t *testing.T) {
	want := &GetAsyncInvokeOutput{
		InvocationArn:      ptr.String("__InvocationArn__"),
		ModelArn:           ptr.String("__ModelArn__"),
		ClientRequestToken: ptr.String("__ClientRequestToken__"),
		Status:             types.AsyncInvokeStatus("InProgress"),
		FailureMessage:     ptr.String("__FailureMessage__"),
		SubmitTime:         ptr.Time(time.Date(2000, 1, 1, 0, 0, 0, 0, time.UTC)),
		LastModifiedTime:   ptr.Time(time.Date(2000, 1, 1, 0, 0, 0, 0, time.UTC)),
		EndTime:            ptr.Time(time.Date(2000, 1, 1, 0, 0, 0, 0, time.UTC)),
		OutputDataConfig: &types.AsyncInvokeOutputDataConfigMemberS3OutputDataConfig{
			Value: types.AsyncInvokeS3OutputDataConfig{
				S3Uri:       ptr.String("__S3Uri__"),
				KmsKeyId:    ptr.String("__KmsKeyId__"),
				BucketOwner: ptr.String("__BucketOwner__"),
			},
		},
	}
	status, header, body, err := serdeRespReadSnapshot("GetAsyncInvoke.response")
	if errors.Is(err, fs.ErrNotExist) {
		t.Skip("no response snapshot fixture")
	}
	if err != nil {
		t.Fatal(err)
	}
	svc := serdeRespClient(status, header, body)
	got, err := svc.GetAsyncInvoke(context.Background(), &GetAsyncInvokeInput{})
	if err != nil {
		t.Fatal(err)
	}
	if err := smithytesting.CompareValues(want, got); err != nil {
		t.Errorf("response snapshot mismatch for %s: %v", "GetAsyncInvoke.response", err)
	}
}

func TestCheckResponseSnapshot_InvokeGuardrailChecks(t *testing.T) {
	want := &InvokeGuardrailChecksOutput{
		Results: &types.GuardrailChecksResults{
			ContentFilter: &types.GuardrailChecksContentFilterResult{
				Results: []types.GuardrailChecksContentFilterResultEntry{
					{
						Category:      types.GuardrailChecksContentFilterCategory("VIOLENCE"),
						SeverityScore: ptr.Float64(1.0),
					},
					{
						Category:      types.GuardrailChecksContentFilterCategory("VIOLENCE"),
						SeverityScore: ptr.Float64(1.0),
					},
				},
			},
			PromptAttack: &types.GuardrailChecksPromptAttackResult{
				Results: []types.GuardrailChecksPromptAttackResultEntry{
					{
						Category:      types.GuardrailChecksPromptAttackCategory("JAILBREAK"),
						SeverityScore: ptr.Float64(1.0),
					},
					{
						Category:      types.GuardrailChecksPromptAttackCategory("JAILBREAK"),
						SeverityScore: ptr.Float64(1.0),
					},
				},
			},
			SensitiveInformation: &types.GuardrailChecksSensitiveInformationResult{
				Results: []types.GuardrailChecksSensitiveInformationResultEntry{
					{
						Type:            types.GuardrailChecksSensitiveInformationEntityType("ADDRESS"),
						ConfidenceScore: ptr.Float64(1.0),
						BeginOffset:     ptr.Int32(1),
						EndOffset:       ptr.Int32(1),
						MessageIndex:    ptr.Int32(1),
						ContentIndex:    ptr.Int32(1),
					},
					{
						Type:            types.GuardrailChecksSensitiveInformationEntityType("ADDRESS"),
						ConfidenceScore: ptr.Float64(1.0),
						BeginOffset:     ptr.Int32(1),
						EndOffset:       ptr.Int32(1),
						MessageIndex:    ptr.Int32(1),
						ContentIndex:    ptr.Int32(1),
					},
				},
				Truncated: ptr.Bool(true),
			},
		},
		Usage: &types.GuardrailChecksUsageResults{
			ContentFilter: &types.GuardrailChecksContentFilterUsage{
				TextUnits: ptr.Int32(1),
			},
			PromptAttack: &types.GuardrailChecksPromptAttackUsage{
				TextUnits: ptr.Int32(1),
			},
			SensitiveInformation: &types.GuardrailChecksSensitiveInformationUsage{
				TextUnits: ptr.Int32(1),
			},
		},
	}
	status, header, body, err := serdeRespReadSnapshot("InvokeGuardrailChecks.response")
	if errors.Is(err, fs.ErrNotExist) {
		t.Skip("no response snapshot fixture")
	}
	if err != nil {
		t.Fatal(err)
	}
	svc := serdeRespClient(status, header, body)
	got, err := svc.InvokeGuardrailChecks(context.Background(), &InvokeGuardrailChecksInput{})
	if err != nil {
		t.Fatal(err)
	}
	if err := smithytesting.CompareValues(want, got); err != nil {
		t.Errorf("response snapshot mismatch for %s: %v", "InvokeGuardrailChecks.response", err)
	}
}

func TestCheckResponseSnapshot_InvokeModel(t *testing.T) {
	want := &InvokeModelOutput{
		Body:                     []byte("blob"),
		ContentType:              ptr.String("__ContentType__"),
		PerformanceConfigLatency: types.PerformanceConfigLatency("standard"),
		ServiceTier:              types.ServiceTierType("priority"),
	}
	status, header, body, err := serdeRespReadSnapshot("InvokeModel.response")
	if errors.Is(err, fs.ErrNotExist) {
		t.Skip("no response snapshot fixture")
	}
	if err != nil {
		t.Fatal(err)
	}
	svc := serdeRespClient(status, header, body)
	got, err := svc.InvokeModel(context.Background(), &InvokeModelInput{})
	if err != nil {
		t.Fatal(err)
	}
	if err := smithytesting.CompareValues(want, got); err != nil {
		t.Errorf("response snapshot mismatch for %s: %v", "InvokeModel.response", err)
	}
}

func TestCheckResponseSnapshot_ListAsyncInvokes(t *testing.T) {
	want := &ListAsyncInvokesOutput{
		NextToken: ptr.String("__NextToken__"),
		AsyncInvokeSummaries: []types.AsyncInvokeSummary{
			{
				InvocationArn:      ptr.String("__InvocationArn__"),
				ModelArn:           ptr.String("__ModelArn__"),
				ClientRequestToken: ptr.String("__ClientRequestToken__"),
				Status:             types.AsyncInvokeStatus("InProgress"),
				FailureMessage:     ptr.String("__FailureMessage__"),
				SubmitTime:         ptr.Time(time.Date(2000, 1, 1, 0, 0, 0, 0, time.UTC)),
				LastModifiedTime:   ptr.Time(time.Date(2000, 1, 1, 0, 0, 0, 0, time.UTC)),
				EndTime:            ptr.Time(time.Date(2000, 1, 1, 0, 0, 0, 0, time.UTC)),
				OutputDataConfig: &types.AsyncInvokeOutputDataConfigMemberS3OutputDataConfig{
					Value: types.AsyncInvokeS3OutputDataConfig{
						S3Uri:       ptr.String("__S3Uri__"),
						KmsKeyId:    ptr.String("__KmsKeyId__"),
						BucketOwner: ptr.String("__BucketOwner__"),
					},
				},
			},
			{
				InvocationArn:      ptr.String("__InvocationArn__"),
				ModelArn:           ptr.String("__ModelArn__"),
				ClientRequestToken: ptr.String("__ClientRequestToken__"),
				Status:             types.AsyncInvokeStatus("InProgress"),
				FailureMessage:     ptr.String("__FailureMessage__"),
				SubmitTime:         ptr.Time(time.Date(2000, 1, 1, 0, 0, 0, 0, time.UTC)),
				LastModifiedTime:   ptr.Time(time.Date(2000, 1, 1, 0, 0, 0, 0, time.UTC)),
				EndTime:            ptr.Time(time.Date(2000, 1, 1, 0, 0, 0, 0, time.UTC)),
				OutputDataConfig: &types.AsyncInvokeOutputDataConfigMemberS3OutputDataConfig{
					Value: types.AsyncInvokeS3OutputDataConfig{
						S3Uri:       ptr.String("__S3Uri__"),
						KmsKeyId:    ptr.String("__KmsKeyId__"),
						BucketOwner: ptr.String("__BucketOwner__"),
					},
				},
			},
		},
	}
	status, header, body, err := serdeRespReadSnapshot("ListAsyncInvokes.response")
	if errors.Is(err, fs.ErrNotExist) {
		t.Skip("no response snapshot fixture")
	}
	if err != nil {
		t.Fatal(err)
	}
	svc := serdeRespClient(status, header, body)
	got, err := svc.ListAsyncInvokes(context.Background(), &ListAsyncInvokesInput{})
	if err != nil {
		t.Fatal(err)
	}
	if err := smithytesting.CompareValues(want, got); err != nil {
		t.Errorf("response snapshot mismatch for %s: %v", "ListAsyncInvokes.response", err)
	}
}

func TestCheckResponseSnapshot_StartAsyncInvoke(t *testing.T) {
	want := &StartAsyncInvokeOutput{
		InvocationArn: ptr.String("__InvocationArn__"),
	}
	status, header, body, err := serdeRespReadSnapshot("StartAsyncInvoke.response")
	if errors.Is(err, fs.ErrNotExist) {
		t.Skip("no response snapshot fixture")
	}
	if err != nil {
		t.Fatal(err)
	}
	svc := serdeRespClient(status, header, body)
	got, err := svc.StartAsyncInvoke(context.Background(), &StartAsyncInvokeInput{})
	if err != nil {
		t.Fatal(err)
	}
	if err := smithytesting.CompareValues(want, got); err != nil {
		t.Errorf("response snapshot mismatch for %s: %v", "StartAsyncInvoke.response", err)
	}
}

func TestCheckResponseSnapshot_Error_AccessDeniedException(t *testing.T) {
	want := &types.AccessDeniedException{
		Message: ptr.String("__Message__"),
	}
	status, header, body, err := serdeRespReadSnapshot("AccessDeniedException.error")
	if errors.Is(err, fs.ErrNotExist) {
		t.Skip("no response snapshot fixture")
	}
	if err != nil {
		t.Fatal(err)
	}
	svc := serdeRespClient(status, header, body)
	_, opErr := svc.ApplyGuardrail(context.Background(), &ApplyGuardrailInput{})
	if opErr == nil {
		t.Fatal("expected error, got nil")
	}
	var got *types.AccessDeniedException
	if !errors.As(opErr, &got) {
		t.Fatalf("expected types.AccessDeniedException, got %v", opErr)
	}
	if err := smithytesting.CompareValues(want, got); err != nil {
		t.Errorf("error response snapshot mismatch for %s: %v", "AccessDeniedException.error", err)
	}
}

func TestCheckResponseSnapshot_Error_ConflictException(t *testing.T) {
	want := &types.ConflictException{
		Message: ptr.String("__Message__"),
	}
	status, header, body, err := serdeRespReadSnapshot("ConflictException.error")
	if errors.Is(err, fs.ErrNotExist) {
		t.Skip("no response snapshot fixture")
	}
	if err != nil {
		t.Fatal(err)
	}
	svc := serdeRespClient(status, header, body)
	_, opErr := svc.StartAsyncInvoke(context.Background(), &StartAsyncInvokeInput{})
	if opErr == nil {
		t.Fatal("expected error, got nil")
	}
	var got *types.ConflictException
	if !errors.As(opErr, &got) {
		t.Fatalf("expected types.ConflictException, got %v", opErr)
	}
	if err := smithytesting.CompareValues(want, got); err != nil {
		t.Errorf("error response snapshot mismatch for %s: %v", "ConflictException.error", err)
	}
}

func TestCheckResponseSnapshot_Error_InternalServerException(t *testing.T) {
	want := &types.InternalServerException{
		Message: ptr.String("__Message__"),
	}
	status, header, body, err := serdeRespReadSnapshot("InternalServerException.error")
	if errors.Is(err, fs.ErrNotExist) {
		t.Skip("no response snapshot fixture")
	}
	if err != nil {
		t.Fatal(err)
	}
	svc := serdeRespClient(status, header, body)
	_, opErr := svc.ApplyGuardrail(context.Background(), &ApplyGuardrailInput{})
	if opErr == nil {
		t.Fatal("expected error, got nil")
	}
	var got *types.InternalServerException
	if !errors.As(opErr, &got) {
		t.Fatalf("expected types.InternalServerException, got %v", opErr)
	}
	if err := smithytesting.CompareValues(want, got); err != nil {
		t.Errorf("error response snapshot mismatch for %s: %v", "InternalServerException.error", err)
	}
}

func TestCheckResponseSnapshot_Error_ModelErrorException(t *testing.T) {
	want := &types.ModelErrorException{
		Message:            ptr.String("__Message__"),
		OriginalStatusCode: ptr.Int32(1),
		ResourceName:       ptr.String("__ResourceName__"),
	}
	status, header, body, err := serdeRespReadSnapshot("ModelErrorException.error")
	if errors.Is(err, fs.ErrNotExist) {
		t.Skip("no response snapshot fixture")
	}
	if err != nil {
		t.Fatal(err)
	}
	svc := serdeRespClient(status, header, body)
	_, opErr := svc.Converse(context.Background(), &ConverseInput{})
	if opErr == nil {
		t.Fatal("expected error, got nil")
	}
	var got *types.ModelErrorException
	if !errors.As(opErr, &got) {
		t.Fatalf("expected types.ModelErrorException, got %v", opErr)
	}
	if err := smithytesting.CompareValues(want, got); err != nil {
		t.Errorf("error response snapshot mismatch for %s: %v", "ModelErrorException.error", err)
	}
}

func TestCheckResponseSnapshot_Error_ModelNotReadyException(t *testing.T) {
	want := &types.ModelNotReadyException{
		Message: ptr.String("__Message__"),
	}
	status, header, body, err := serdeRespReadSnapshot("ModelNotReadyException.error")
	if errors.Is(err, fs.ErrNotExist) {
		t.Skip("no response snapshot fixture")
	}
	if err != nil {
		t.Fatal(err)
	}
	svc := serdeRespClient(status, header, body)
	_, opErr := svc.Converse(context.Background(), &ConverseInput{})
	if opErr == nil {
		t.Fatal("expected error, got nil")
	}
	var got *types.ModelNotReadyException
	if !errors.As(opErr, &got) {
		t.Fatalf("expected types.ModelNotReadyException, got %v", opErr)
	}
	if err := smithytesting.CompareValues(want, got); err != nil {
		t.Errorf("error response snapshot mismatch for %s: %v", "ModelNotReadyException.error", err)
	}
}

func TestCheckResponseSnapshot_Error_ModelTimeoutException(t *testing.T) {
	want := &types.ModelTimeoutException{
		Message: ptr.String("__Message__"),
	}
	status, header, body, err := serdeRespReadSnapshot("ModelTimeoutException.error")
	if errors.Is(err, fs.ErrNotExist) {
		t.Skip("no response snapshot fixture")
	}
	if err != nil {
		t.Fatal(err)
	}
	svc := serdeRespClient(status, header, body)
	_, opErr := svc.Converse(context.Background(), &ConverseInput{})
	if opErr == nil {
		t.Fatal("expected error, got nil")
	}
	var got *types.ModelTimeoutException
	if !errors.As(opErr, &got) {
		t.Fatalf("expected types.ModelTimeoutException, got %v", opErr)
	}
	if err := smithytesting.CompareValues(want, got); err != nil {
		t.Errorf("error response snapshot mismatch for %s: %v", "ModelTimeoutException.error", err)
	}
}

func TestCheckResponseSnapshot_Error_ResourceNotFoundException(t *testing.T) {
	want := &types.ResourceNotFoundException{
		Message: ptr.String("__Message__"),
	}
	status, header, body, err := serdeRespReadSnapshot("ResourceNotFoundException.error")
	if errors.Is(err, fs.ErrNotExist) {
		t.Skip("no response snapshot fixture")
	}
	if err != nil {
		t.Fatal(err)
	}
	svc := serdeRespClient(status, header, body)
	_, opErr := svc.ApplyGuardrail(context.Background(), &ApplyGuardrailInput{})
	if opErr == nil {
		t.Fatal("expected error, got nil")
	}
	var got *types.ResourceNotFoundException
	if !errors.As(opErr, &got) {
		t.Fatalf("expected types.ResourceNotFoundException, got %v", opErr)
	}
	if err := smithytesting.CompareValues(want, got); err != nil {
		t.Errorf("error response snapshot mismatch for %s: %v", "ResourceNotFoundException.error", err)
	}
}

func TestCheckResponseSnapshot_Error_ServiceQuotaExceededException(t *testing.T) {
	want := &types.ServiceQuotaExceededException{
		Message: ptr.String("__Message__"),
	}
	status, header, body, err := serdeRespReadSnapshot("ServiceQuotaExceededException.error")
	if errors.Is(err, fs.ErrNotExist) {
		t.Skip("no response snapshot fixture")
	}
	if err != nil {
		t.Fatal(err)
	}
	svc := serdeRespClient(status, header, body)
	_, opErr := svc.ApplyGuardrail(context.Background(), &ApplyGuardrailInput{})
	if opErr == nil {
		t.Fatal("expected error, got nil")
	}
	var got *types.ServiceQuotaExceededException
	if !errors.As(opErr, &got) {
		t.Fatalf("expected types.ServiceQuotaExceededException, got %v", opErr)
	}
	if err := smithytesting.CompareValues(want, got); err != nil {
		t.Errorf("error response snapshot mismatch for %s: %v", "ServiceQuotaExceededException.error", err)
	}
}

func TestCheckResponseSnapshot_Error_ServiceUnavailableException(t *testing.T) {
	want := &types.ServiceUnavailableException{
		Message: ptr.String("__Message__"),
	}
	status, header, body, err := serdeRespReadSnapshot("ServiceUnavailableException.error")
	if errors.Is(err, fs.ErrNotExist) {
		t.Skip("no response snapshot fixture")
	}
	if err != nil {
		t.Fatal(err)
	}
	svc := serdeRespClient(status, header, body)
	_, opErr := svc.ApplyGuardrail(context.Background(), &ApplyGuardrailInput{})
	if opErr == nil {
		t.Fatal("expected error, got nil")
	}
	var got *types.ServiceUnavailableException
	if !errors.As(opErr, &got) {
		t.Fatalf("expected types.ServiceUnavailableException, got %v", opErr)
	}
	if err := smithytesting.CompareValues(want, got); err != nil {
		t.Errorf("error response snapshot mismatch for %s: %v", "ServiceUnavailableException.error", err)
	}
}

func TestCheckResponseSnapshot_Error_ThrottlingException(t *testing.T) {
	want := &types.ThrottlingException{
		Message: ptr.String("__Message__"),
	}
	status, header, body, err := serdeRespReadSnapshot("ThrottlingException.error")
	if errors.Is(err, fs.ErrNotExist) {
		t.Skip("no response snapshot fixture")
	}
	if err != nil {
		t.Fatal(err)
	}
	svc := serdeRespClient(status, header, body)
	_, opErr := svc.ApplyGuardrail(context.Background(), &ApplyGuardrailInput{})
	if opErr == nil {
		t.Fatal("expected error, got nil")
	}
	var got *types.ThrottlingException
	if !errors.As(opErr, &got) {
		t.Fatalf("expected types.ThrottlingException, got %v", opErr)
	}
	if err := smithytesting.CompareValues(want, got); err != nil {
		t.Errorf("error response snapshot mismatch for %s: %v", "ThrottlingException.error", err)
	}
}

func TestCheckResponseSnapshot_Error_ValidationException(t *testing.T) {
	want := &types.ValidationException{
		Message: ptr.String("__Message__"),
	}
	status, header, body, err := serdeRespReadSnapshot("ValidationException.error")
	if errors.Is(err, fs.ErrNotExist) {
		t.Skip("no response snapshot fixture")
	}
	if err != nil {
		t.Fatal(err)
	}
	svc := serdeRespClient(status, header, body)
	_, opErr := svc.ApplyGuardrail(context.Background(), &ApplyGuardrailInput{})
	if opErr == nil {
		t.Fatal("expected error, got nil")
	}
	var got *types.ValidationException
	if !errors.As(opErr, &got) {
		t.Fatalf("expected types.ValidationException, got %v", opErr)
	}
	if err := smithytesting.CompareValues(want, got); err != nil {
		t.Errorf("error response snapshot mismatch for %s: %v", "ValidationException.error", err)
	}
}
