Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

fix(client-s3): correct shape type of two shapes from union to structure #6561

Merged
merged 1 commit into from
Oct 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ export interface GetBucketLifecycleConfigurationCommandOutput
* // },
* // ID: "STRING_VALUE",
* // Prefix: "STRING_VALUE",
* // Filter: { // LifecycleRuleFilter Union: only one key present
* // Filter: { // LifecycleRuleFilter
* // Prefix: "STRING_VALUE",
* // Tag: { // Tag
* // Key: "STRING_VALUE", // required
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ export interface GetBucketReplicationCommandOutput extends GetBucketReplicationO
* // ID: "STRING_VALUE",
* // Priority: Number("int"),
* // Prefix: "STRING_VALUE",
* // Filter: { // ReplicationRuleFilter Union: only one key present
* // Filter: { // ReplicationRuleFilter
* // Prefix: "STRING_VALUE",
* // Tag: { // Tag
* // Key: "STRING_VALUE", // required
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ export interface PutBucketLifecycleConfigurationCommandOutput
* },
* ID: "STRING_VALUE",
* Prefix: "STRING_VALUE",
* Filter: { // LifecycleRuleFilter Union: only one key present
* Filter: { // LifecycleRuleFilter
* Prefix: "STRING_VALUE",
* Tag: { // Tag
* Key: "STRING_VALUE", // required
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ export interface PutBucketReplicationCommandOutput extends __MetadataBearer {}
* ID: "STRING_VALUE",
* Priority: Number("int"),
* Prefix: "STRING_VALUE",
* Filter: { // ReplicationRuleFilter Union: only one key present
* Filter: { // ReplicationRuleFilter
* Prefix: "STRING_VALUE",
* Tag: { // Tag
* Key: "STRING_VALUE", // required
Expand Down
145 changes: 10 additions & 135 deletions clients/client-s3/src/models/models_0.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
// smithy-typescript generated code
import { ExceptionOptionType as __ExceptionOptionType, SENSITIVE_STRING } from "@smithy/smithy-client";

import { StreamingBlobTypes } from "@smithy/types";

import { S3ServiceException as __BaseException } from "./S3ServiceException";
Expand Down Expand Up @@ -6874,18 +6873,7 @@ export interface LifecycleRuleAndOperator {
* <code>And</code> specified. If the <code>Filter</code> element is left empty, the Lifecycle Rule applies to all objects in the bucket.</p>
* @public
*/
export type LifecycleRuleFilter =
| LifecycleRuleFilter.AndMember
| LifecycleRuleFilter.ObjectSizeGreaterThanMember
| LifecycleRuleFilter.ObjectSizeLessThanMember
| LifecycleRuleFilter.PrefixMember
| LifecycleRuleFilter.TagMember
| LifecycleRuleFilter.$UnknownMember;

/**
* @public
*/
export namespace LifecycleRuleFilter {
export interface LifecycleRuleFilter {
/**
* <p>Prefix identifying one or more objects to which the rule applies.</p>
* <important>
Expand All @@ -6895,98 +6883,33 @@ export namespace LifecycleRuleFilter {
* </important>
* @public
*/
export interface PrefixMember {
Prefix: string;
Tag?: never;
ObjectSizeGreaterThan?: never;
ObjectSizeLessThan?: never;
And?: never;
$unknown?: never;
}
Prefix?: string;

/**
* <p>This tag must exist in the object's tag set in order for the rule to apply.</p>
* @public
*/
export interface TagMember {
Prefix?: never;
Tag: Tag;
ObjectSizeGreaterThan?: never;
ObjectSizeLessThan?: never;
And?: never;
$unknown?: never;
}
Tag?: Tag;

/**
* <p>Minimum object size to which the rule applies.</p>
* @public
*/
export interface ObjectSizeGreaterThanMember {
Prefix?: never;
Tag?: never;
ObjectSizeGreaterThan: number;
ObjectSizeLessThan?: never;
And?: never;
$unknown?: never;
}
ObjectSizeGreaterThan?: number;

/**
* <p>Maximum object size to which the rule applies.</p>
* @public
*/
export interface ObjectSizeLessThanMember {
Prefix?: never;
Tag?: never;
ObjectSizeGreaterThan?: never;
ObjectSizeLessThan: number;
And?: never;
$unknown?: never;
}
ObjectSizeLessThan?: number;

/**
* <p>This is used in a Lifecycle Rule Filter to apply a logical AND to two or more
* predicates. The Lifecycle Rule will apply to any object matching all of the predicates
* configured inside the And operator.</p>
* @public
*/
export interface AndMember {
Prefix?: never;
Tag?: never;
ObjectSizeGreaterThan?: never;
ObjectSizeLessThan?: never;
And: LifecycleRuleAndOperator;
$unknown?: never;
}

/**
* @public
*/
export interface $UnknownMember {
Prefix?: never;
Tag?: never;
ObjectSizeGreaterThan?: never;
ObjectSizeLessThan?: never;
And?: never;
$unknown: [string, any];
}

export interface Visitor<T> {
Prefix: (value: string) => T;
Tag: (value: Tag) => T;
ObjectSizeGreaterThan: (value: number) => T;
ObjectSizeLessThan: (value: number) => T;
And: (value: LifecycleRuleAndOperator) => T;
_: (name: string, value: any) => T;
}

export const visit = <T>(value: LifecycleRuleFilter, visitor: Visitor<T>): T => {
if (value.Prefix !== undefined) return visitor.Prefix(value.Prefix);
if (value.Tag !== undefined) return visitor.Tag(value.Tag);
if (value.ObjectSizeGreaterThan !== undefined) return visitor.ObjectSizeGreaterThan(value.ObjectSizeGreaterThan);
if (value.ObjectSizeLessThan !== undefined) return visitor.ObjectSizeLessThan(value.ObjectSizeLessThan);
if (value.And !== undefined) return visitor.And(value.And);
return visitor._(value.$unknown[0], value.$unknown[1]);
};
And?: LifecycleRuleAndOperator;
}

/**
Expand Down Expand Up @@ -8386,16 +8309,7 @@ export interface ReplicationRuleAndOperator {
* an <code>And</code> child element.</p>
* @public
*/
export type ReplicationRuleFilter =
| ReplicationRuleFilter.AndMember
| ReplicationRuleFilter.PrefixMember
| ReplicationRuleFilter.TagMember
| ReplicationRuleFilter.$UnknownMember;

/**
* @public
*/
export namespace ReplicationRuleFilter {
export interface ReplicationRuleFilter {
/**
* <p>An object key name prefix that identifies the subset of objects to which the rule
* applies.</p>
Expand All @@ -8406,24 +8320,14 @@ export namespace ReplicationRuleFilter {
* </important>
* @public
*/
export interface PrefixMember {
Prefix: string;
Tag?: never;
And?: never;
$unknown?: never;
}
Prefix?: string;

/**
* <p>A container for specifying a tag key and value. </p>
* <p>The rule applies only to objects that have the tag in their tag set.</p>
* @public
*/
export interface TagMember {
Prefix?: never;
Tag: Tag;
And?: never;
$unknown?: never;
}
Tag?: Tag;

/**
* <p>A container for specifying rule filters. The filters determine the subset of objects to
Expand All @@ -8441,36 +8345,7 @@ export namespace ReplicationRuleFilter {
* </ul>
* @public
*/
export interface AndMember {
Prefix?: never;
Tag?: never;
And: ReplicationRuleAndOperator;
$unknown?: never;
}

/**
* @public
*/
export interface $UnknownMember {
Prefix?: never;
Tag?: never;
And?: never;
$unknown: [string, any];
}

export interface Visitor<T> {
Prefix: (value: string) => T;
Tag: (value: Tag) => T;
And: (value: ReplicationRuleAndOperator) => T;
_: (name: string, value: any) => T;
}

export const visit = <T>(value: ReplicationRuleFilter, visitor: Visitor<T>): T => {
if (value.Prefix !== undefined) return visitor.Prefix(value.Prefix);
if (value.Tag !== undefined) return visitor.Tag(value.Tag);
if (value.And !== undefined) return visitor.And(value.And);
return visitor._(value.$unknown[0], value.$unknown[1]);
};
And?: ReplicationRuleAndOperator;
}

/**
Expand Down
2 changes: 0 additions & 2 deletions clients/client-s3/src/models/models_1.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
// smithy-typescript generated code
import { ExceptionOptionType as __ExceptionOptionType, SENSITIVE_STRING } from "@smithy/smithy-client";

import { StreamingBlobTypes } from "@smithy/types";

import {
Expand Down Expand Up @@ -30,7 +29,6 @@ import {
StorageClass,
Tag,
} from "./models_0";

import { S3ServiceException as __BaseException } from "./S3ServiceException";

/**
Expand Down
Loading
Loading