Skip to content

visit function of model namespaces disappeared #7779

Description

@olmokramer

Checkboxes for prior research

Describe the bug

When upgrading from SDK version 3.812.0 to version 3.996.0, I was surprised to find that the visit method of union namespaces is no longer available after a minor version upgrade. This seems to have happened in this commit but I couldn't find any mention of this in the release changelogs since that commit.

Regression Issue

  • Select this option if this issue appears to be a regression.

SDK version number

@aws-sdk/client-* 3.996.0

Which JavaScript Runtime is this issue in?

Node.js

Details of the browser/Node.js/ReactNative version

v22.14.0

Reproduction Steps

import { ContentBlockDelta } from '@aws-sdk/client-bedrock-runtime';

function processContentBlockDelta(d: ContentBlockDelta) {
    return ContentBlockDelta.visit(d, {
        text() {
            // process text delta
        },
        // ... other members
    });
}

Observed Behavior

I get a type error: "Cannot use namespace 'ContentBlockDelta' as a value."

Expected Behavior

A visit function is provided to decide how to process a union.

Possible Solution

Revert the parts of 6362fe2 that remove the visit function.

Additional Information/Context

No response

Metadata

Metadata

Assignees

Labels

bugThis issue is a bug.needs-triageThis issue or PR still needs to be triaged.potential-regressionMarking this issue as a potential regression to be checked by team member

Type

No type

Fields

No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions