From 3176b00ac6385942e438079f6d9d2c810c9b7b2f Mon Sep 17 00:00:00 2001 From: AWS SDK for Go v2 automation user Date: Mon, 3 Oct 2022 18:13:44 +0000 Subject: [PATCH] Regenerated Clients --- .../a4bc4ad67cea4457880bb13b4e2017be.json | 8 ++ .../aca5ee28a4394551971a694aca35d7f4.json | 8 ++ .../d3a9e95b8d73459998705f8c057ba248.json | 8 ++ service/accessanalyzer/types/enums.go | 2 + service/accessanalyzer/types/types.go | 2 +- service/ec2/api_op_DescribeImageAttribute.go | 9 ++ service/ec2/api_op_RegisterImage.go | 10 ++ service/ec2/deserializers.go | 19 ++++ service/ec2/serializers.go | 5 + service/ec2/types/enums.go | 18 ++++ service/ec2/types/types.go | 9 ++ service/ram/internal/endpoints/endpoints.go | 3 + .../internal/endpoints/endpoints.go | 5 + service/snowball/api_op_CreateCluster.go | 2 +- service/snowball/api_op_CreateJob.go | 28 ++++-- .../snowball/api_op_CreateLongTermPricing.go | 6 +- service/snowball/api_op_GetJobManifest.go | 18 ++-- service/snowball/api_op_GetJobUnlockCode.go | 11 ++- service/snowball/api_op_ListClusterJobs.go | 91 ++++++++++++++++++ service/snowball/api_op_ListClusters.go | 90 ++++++++++++++++++ .../snowball/api_op_ListCompatibleImages.go | 93 +++++++++++++++++++ .../snowball/api_op_ListLongTermPricing.go | 92 ++++++++++++++++++ service/snowball/types/enums.go | 4 + service/snowball/types/types.go | 2 +- 24 files changed, 515 insertions(+), 28 deletions(-) create mode 100644 .changelog/a4bc4ad67cea4457880bb13b4e2017be.json create mode 100644 .changelog/aca5ee28a4394551971a694aca35d7f4.json create mode 100644 .changelog/d3a9e95b8d73459998705f8c057ba248.json diff --git a/.changelog/a4bc4ad67cea4457880bb13b4e2017be.json b/.changelog/a4bc4ad67cea4457880bb13b4e2017be.json new file mode 100644 index 00000000000..39671d66382 --- /dev/null +++ b/.changelog/a4bc4ad67cea4457880bb13b4e2017be.json @@ -0,0 +1,8 @@ +{ + "id": "a4bc4ad6-7cea-4457-880b-b13b4e2017be", + "type": "feature", + "description": "AWS IAM Access Analyzer policy validation introduces new checks for role trust policies. As customers author a policy, IAM Access Analyzer policy validation evaluates the policy for any issues to make it easier for customers to author secure policies.", + "modules": [ + "service/accessanalyzer" + ] +} \ No newline at end of file diff --git a/.changelog/aca5ee28a4394551971a694aca35d7f4.json b/.changelog/aca5ee28a4394551971a694aca35d7f4.json new file mode 100644 index 00000000000..123277e3a58 --- /dev/null +++ b/.changelog/aca5ee28a4394551971a694aca35d7f4.json @@ -0,0 +1,8 @@ +{ + "id": "aca5ee28-a439-4551-971a-694aca35d7f4", + "type": "feature", + "description": "Adds support for V3_5C. This is a refreshed AWS Snowball Edge Compute Optimized device type with 28TB SSD, 104 vCPU and 416GB memory (customer usable).", + "modules": [ + "service/snowball" + ] +} \ No newline at end of file diff --git a/.changelog/d3a9e95b8d73459998705f8c057ba248.json b/.changelog/d3a9e95b8d73459998705f8c057ba248.json new file mode 100644 index 00000000000..2987c23ed04 --- /dev/null +++ b/.changelog/d3a9e95b8d73459998705f8c057ba248.json @@ -0,0 +1,8 @@ +{ + "id": "d3a9e95b-8d73-4599-9870-5f8c057ba248", + "type": "feature", + "description": "Adding an imdsSupport attribute to EC2 AMIs", + "modules": [ + "service/ec2" + ] +} \ No newline at end of file diff --git a/service/accessanalyzer/types/enums.go b/service/accessanalyzer/types/enums.go index 27f57fae1a5..e97f89c85ed 100644 --- a/service/accessanalyzer/types/enums.go +++ b/service/accessanalyzer/types/enums.go @@ -421,6 +421,7 @@ const ( ValidatePolicyResourceTypeS3AccessPoint ValidatePolicyResourceType = "AWS::S3::AccessPoint" ValidatePolicyResourceTypeS3MultiRegionAccessPoint ValidatePolicyResourceType = "AWS::S3::MultiRegionAccessPoint" ValidatePolicyResourceTypeS3ObjectLambdaAccessPoint ValidatePolicyResourceType = "AWS::S3ObjectLambda::AccessPoint" + ValidatePolicyResourceTypeRoleTrust ValidatePolicyResourceType = "AWS::IAM::AssumeRolePolicyDocument" ) // Values returns all known values for ValidatePolicyResourceType. Note that this @@ -432,6 +433,7 @@ func (ValidatePolicyResourceType) Values() []ValidatePolicyResourceType { "AWS::S3::AccessPoint", "AWS::S3::MultiRegionAccessPoint", "AWS::S3ObjectLambda::AccessPoint", + "AWS::IAM::AssumeRolePolicyDocument", } } diff --git a/service/accessanalyzer/types/types.go b/service/accessanalyzer/types/types.go index eaac7acabac..4af2b7e51fa 100644 --- a/service/accessanalyzer/types/types.go +++ b/service/accessanalyzer/types/types.go @@ -1081,7 +1081,7 @@ type Position struct { // in place of the existing access points. To propose an access point without a // policy, you can provide an empty string as the access point policy. For more // information, see Creating access points -// (https://docs.aws.amazon.com/https:/docs.aws.amazon.com/AmazonS3/latest/dev/creating-access-points.html). +// (https://docs.aws.amazon.com/AmazonS3/latest/dev/creating-access-points.html). // For more information about access point policy limits, see Access points // restrictions and limitations // (https://docs.aws.amazon.com/AmazonS3/latest/dev/access-points-restrictions-limitations.html). diff --git a/service/ec2/api_op_DescribeImageAttribute.go b/service/ec2/api_op_DescribeImageAttribute.go index 7446c523cf0..50ba6a02955 100644 --- a/service/ec2/api_op_DescribeImageAttribute.go +++ b/service/ec2/api_op_DescribeImageAttribute.go @@ -67,6 +67,15 @@ type DescribeImageAttributeOutput struct { // The ID of the AMI. ImageId *string + // If v2.0, it indicates that IMDSv2 is specified in the AMI. Instances launched + // from this AMI will have HttpTokens automatically set to required so that, by + // default, the instance requires that IMDSv2 is used when requesting instance + // metadata. In addition, HttpPutResponseHopLimit is set to 2. For more + // information, see Configure the AMI + // (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/configuring-IMDS-new-instances.html#configure-IMDS-new-instances-ami-configuration) + // in the Amazon Elastic Compute Cloud User Guide. + ImdsSupport *types.AttributeValue + // The kernel ID. KernelId *types.AttributeValue diff --git a/service/ec2/api_op_RegisterImage.go b/service/ec2/api_op_RegisterImage.go index ba9b3fd7d20..14d3c9b485b 100644 --- a/service/ec2/api_op_RegisterImage.go +++ b/service/ec2/api_op_RegisterImage.go @@ -129,6 +129,16 @@ type RegisterImageInput struct { // in the Amazon S3 Service Developer Guide. ImageLocation *string + // Set to v2.0 to indicate that IMDSv2 is specified in the AMI. Instances launched + // from this AMI will have HttpTokens automatically set to required so that, by + // default, the instance requires that IMDSv2 is used when requesting instance + // metadata. In addition, HttpPutResponseHopLimit is set to 2. For more + // information, see Configure the AMI + // (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/configuring-IMDS-new-instances.html#configure-IMDS-new-instances-ami-configuration) + // in the Amazon Elastic Compute Cloud User Guide. If you set the value to v2.0, + // make sure that your AMI software can support IMDSv2. + ImdsSupport types.ImdsSupportValues + // The ID of the kernel. KernelId *string diff --git a/service/ec2/deserializers.go b/service/ec2/deserializers.go index 5e8ccece0cb..98a39ca810f 100644 --- a/service/ec2/deserializers.go +++ b/service/ec2/deserializers.go @@ -70559,6 +70559,19 @@ func awsEc2query_deserializeDocumentImage(v **types.Image, decoder smithyxml.Nod sv.ImageType = types.ImageTypeValues(xtv) } + case strings.EqualFold("imdsSupport", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.ImdsSupport = types.ImdsSupportValues(xtv) + } + case strings.EqualFold("kernelId", t.Name.Local): val, err := decoder.Value() if err != nil { @@ -133033,6 +133046,12 @@ func awsEc2query_deserializeOpDocumentDescribeImageAttributeOutput(v **DescribeI sv.ImageId = ptr.String(xtv) } + case strings.EqualFold("imdsSupport", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsEc2query_deserializeDocumentAttributeValue(&sv.ImdsSupport, nodeDecoder); err != nil { + return err + } + case strings.EqualFold("kernel", t.Name.Local): nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) if err := awsEc2query_deserializeDocumentAttributeValue(&sv.KernelId, nodeDecoder); err != nil { diff --git a/service/ec2/serializers.go b/service/ec2/serializers.go index 9a6543c5f37..b2cb7e8456f 100644 --- a/service/ec2/serializers.go +++ b/service/ec2/serializers.go @@ -59007,6 +59007,11 @@ func awsEc2query_serializeOpDocumentRegisterImageInput(v *RegisterImageInput, va objectKey.String(*v.ImageLocation) } + if len(v.ImdsSupport) > 0 { + objectKey := object.Key("ImdsSupport") + objectKey.String(string(v.ImdsSupport)) + } + if v.KernelId != nil { objectKey := object.Key("KernelId") objectKey.String(*v.KernelId) diff --git a/service/ec2/types/enums.go b/service/ec2/types/enums.go index 499acd38379..87b46a019d9 100644 --- a/service/ec2/types/enums.go +++ b/service/ec2/types/enums.go @@ -2252,6 +2252,7 @@ const ( ImageAttributeNameTpmSupport ImageAttributeName = "tpmSupport" ImageAttributeNameUefiData ImageAttributeName = "uefiData" ImageAttributeNameLastLaunchedTime ImageAttributeName = "lastLaunchedTime" + ImageAttributeNameImdsSupport ImageAttributeName = "imdsSupport" ) // Values returns all known values for ImageAttributeName. Note that this can be @@ -2270,6 +2271,7 @@ func (ImageAttributeName) Values() []ImageAttributeName { "tpmSupport", "uefiData", "lastLaunchedTime", + "imdsSupport", } } @@ -2321,6 +2323,22 @@ func (ImageTypeValues) Values() []ImageTypeValues { } } +type ImdsSupportValues string + +// Enum values for ImdsSupportValues +const ( + ImdsSupportValuesV20 ImdsSupportValues = "v2.0" +) + +// Values returns all known values for ImdsSupportValues. Note that this can be +// expanded in the future, and so it is only as up to date as the client. The +// ordering of this slice is not guaranteed to be stable across updates. +func (ImdsSupportValues) Values() []ImdsSupportValues { + return []ImdsSupportValues{ + "v2.0", + } +} + type InstanceAttributeName string // Enum values for InstanceAttributeName diff --git a/service/ec2/types/types.go b/service/ec2/types/types.go index ead20ddd20e..84c62cecfe7 100644 --- a/service/ec2/types/types.go +++ b/service/ec2/types/types.go @@ -4740,6 +4740,15 @@ type Image struct { // The type of image. ImageType ImageTypeValues + // If v2.0, it indicates that IMDSv2 is specified in the AMI. Instances launched + // from this AMI will have HttpTokens automatically set to required so that, by + // default, the instance requires that IMDSv2 is used when requesting instance + // metadata. In addition, HttpPutResponseHopLimit is set to 2. For more + // information, see Configure the AMI + // (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/configuring-IMDS-new-instances.html#configure-IMDS-new-instances-ami-configuration) + // in the Amazon Elastic Compute Cloud User Guide. + ImdsSupport ImdsSupportValues + // The kernel associated with the image, if any. Only applicable for machine // images. KernelId *string diff --git a/service/ram/internal/endpoints/endpoints.go b/service/ram/internal/endpoints/endpoints.go index 106f96c31e1..ccdeb81b369 100644 --- a/service/ram/internal/endpoints/endpoints.go +++ b/service/ram/internal/endpoints/endpoints.go @@ -345,6 +345,9 @@ var defaultPartitions = endpoints.Partitions{ endpoints.EndpointKey{ Region: "us-iso-east-1", }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "us-iso-west-1", + }: endpoints.Endpoint{}, }, }, { diff --git a/service/route53resolver/internal/endpoints/endpoints.go b/service/route53resolver/internal/endpoints/endpoints.go index 9999838b873..d39920037b2 100644 --- a/service/route53resolver/internal/endpoints/endpoints.go +++ b/service/route53resolver/internal/endpoints/endpoints.go @@ -292,6 +292,11 @@ var defaultPartitions = endpoints.Partitions{ }, RegionRegex: partitionRegexp.AwsIsoB, IsRegionalized: true, + Endpoints: endpoints.Endpoints{ + endpoints.EndpointKey{ + Region: "us-isob-east-1", + }: endpoints.Endpoint{}, + }, }, { ID: "aws-us-gov", diff --git a/service/snowball/api_op_CreateCluster.go b/service/snowball/api_op_CreateCluster.go index ac4f972c58f..2799185c6e3 100644 --- a/service/snowball/api_op_CreateCluster.go +++ b/service/snowball/api_op_CreateCluster.go @@ -97,7 +97,7 @@ type CreateClusterInput struct { // This member is required. ShippingOption types.ShippingOption - // The type of Snow Family Devices to use for this cluster. For cluster jobs, + // The type of Snow Family devices to use for this cluster. For cluster jobs, // Amazon Web Services Snow Family currently supports only the EDGE device type. // For more information, see // "https://docs.aws.amazon.com/snowball/latest/snowcone-guide/snow-device-types.html" diff --git a/service/snowball/api_op_CreateJob.go b/service/snowball/api_op_CreateJob.go index cc666b74dcf..0efc954eae8 100644 --- a/service/snowball/api_op_CreateJob.go +++ b/service/snowball/api_op_CreateJob.go @@ -21,7 +21,7 @@ import ( // more information about Region availability, see Amazon Web Services Regional // Services // (https://aws.amazon.com/about-aws/global-infrastructure/regional-product-services/?p=ngi&loc=4). -// Snow Family Devices and their capacities. +// Snow Family devices and their capacities. // // * Snow Family device type: // SNC1_SSD @@ -67,21 +67,29 @@ import ( // * Description: Snowball Edge Storage Optimized with EC2 // Compute // +// * Device type: V3_5C +// +// * Capacity: T32 +// +// * Description: Snowball Edge +// Compute Optimized without GPU +// // * Device type: STANDARD // // * Capacity: T50 // -// * Description: Original -// Snowball device This device is only available in the Ningxia, Beijing, and -// Singapore Amazon Web Services Region +// * +// Description: Original Snowball device This device is only available in the +// Ningxia, Beijing, and Singapore Amazon Web Services Region // -// * Device type: STANDARD +// * Device type: +// STANDARD // -// * Capacity: -// T80 +// * Capacity: T80 // -// * Description: Original Snowball device This device is only available in -// the Ningxia, Beijing, and Singapore Amazon Web Services Region. +// * Description: Original Snowball device This device +// is only available in the Ningxia, Beijing, and Singapore Amazon Web Services +// Region. func (c *Client) CreateJob(ctx context.Context, params *CreateJobInput, optFns ...func(*Options)) (*CreateJobOutput, error) { if params == nil { params = &CreateJobInput{} @@ -194,7 +202,7 @@ type CreateJobInput struct { // (Snow Family Devices and Capacity) in the Snowcone User Guide. SnowballCapacityPreference types.SnowballCapacity - // The type of Snow Family Devices to use for this job. For cluster jobs, Amazon + // The type of Snow Family devices to use for this job. For cluster jobs, Amazon // Web Services Snow Family currently supports only the EDGE device type. The type // of Amazon Web Services Snow device to use for this job. Currently, the only // supported device type for cluster jobs is EDGE. For more information, see diff --git a/service/snowball/api_op_CreateLongTermPricing.go b/service/snowball/api_op_CreateLongTermPricing.go index e1a63fc40f2..1a30acd8c05 100644 --- a/service/snowball/api_op_CreateLongTermPricing.go +++ b/service/snowball/api_op_CreateLongTermPricing.go @@ -37,11 +37,11 @@ type CreateLongTermPricingInput struct { // This member is required. LongTermPricingType types.LongTermPricingType - // Specifies whether the current long-term pricing type for the device should be - // renewed. + // snowballty Specifies whether the current long-term pricing type for the device + // should be renewed. IsLongTermPricingAutoRenew *bool - // The type of Snow Family Devices to use for the long-term pricing job. + // The type of Snow Family devices to use for the long-term pricing job. SnowballType types.SnowballType noSmithyDocumentSerde diff --git a/service/snowball/api_op_GetJobManifest.go b/service/snowball/api_op_GetJobManifest.go index 9a3a728d629..8fbaa9dd501 100644 --- a/service/snowball/api_op_GetJobManifest.go +++ b/service/snowball/api_op_GetJobManifest.go @@ -15,14 +15,16 @@ import ( // minutes after this request has been made. To access the manifest file after 60 // minutes have passed, you'll have to make another call to the GetJobManifest // action. The manifest is an encrypted file that you can download after your job -// enters the WithCustomer status. The manifest is decrypted by using the -// UnlockCode code value, when you pass both values to the Snow device through the -// Snowball client when the client is started for the first time. As a best -// practice, we recommend that you don't save a copy of an UnlockCode value in the -// same location as the manifest file for that job. Saving these separately helps -// prevent unauthorized parties from gaining access to the Snow device associated -// with that job. The credentials of a given job, including its manifest file and -// unlock code, expire 360 days after the job is created. +// enters the WithCustomer status. This is the only valid status for calling this +// API as the manifest and UnlockCode code value are used for securing your device +// and should only be used when you have the device. The manifest is decrypted by +// using the UnlockCode code value, when you pass both values to the Snow device +// through the Snowball client when the client is started for the first time. As a +// best practice, we recommend that you don't save a copy of an UnlockCode value in +// the same location as the manifest file for that job. Saving these separately +// helps prevent unauthorized parties from gaining access to the Snow device +// associated with that job. The credentials of a given job, including its manifest +// file and unlock code, expire 360 days after the job is created. func (c *Client) GetJobManifest(ctx context.Context, params *GetJobManifestInput, optFns ...func(*Options)) (*GetJobManifestOutput, error) { if params == nil { params = &GetJobManifestInput{} diff --git a/service/snowball/api_op_GetJobUnlockCode.go b/service/snowball/api_op_GetJobUnlockCode.go index 67e792242b6..0df178ae097 100644 --- a/service/snowball/api_op_GetJobUnlockCode.go +++ b/service/snowball/api_op_GetJobUnlockCode.go @@ -15,10 +15,13 @@ import ( // created. The UnlockCode value is a 29-character code with 25 alphanumeric // characters and 4 hyphens. This code is used to decrypt the manifest file when it // is passed along with the manifest to the Snow device through the Snowball client -// when the client is started for the first time. As a best practice, we recommend -// that you don't save a copy of the UnlockCode in the same location as the -// manifest file for that job. Saving these separately helps prevent unauthorized -// parties from gaining access to the Snow device associated with that job. +// when the client is started for the first time. The only valid status for calling +// this API is WithCustomer as the manifest and Unlock code values are used for +// securing your device and should only be used when you have the device. As a best +// practice, we recommend that you don't save a copy of the UnlockCode in the same +// location as the manifest file for that job. Saving these separately helps +// prevent unauthorized parties from gaining access to the Snow device associated +// with that job. func (c *Client) GetJobUnlockCode(ctx context.Context, params *GetJobUnlockCodeInput, optFns ...func(*Options)) (*GetJobUnlockCodeOutput, error) { if params == nil { params = &GetJobUnlockCodeInput{} diff --git a/service/snowball/api_op_ListClusterJobs.go b/service/snowball/api_op_ListClusterJobs.go index 1723a54fe25..638bbda0ad9 100644 --- a/service/snowball/api_op_ListClusterJobs.go +++ b/service/snowball/api_op_ListClusterJobs.go @@ -4,6 +4,7 @@ package snowball import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/snowball/types" @@ -128,6 +129,96 @@ func (c *Client) addOperationListClusterJobsMiddlewares(stack *middleware.Stack, return nil } +// ListClusterJobsAPIClient is a client that implements the ListClusterJobs +// operation. +type ListClusterJobsAPIClient interface { + ListClusterJobs(context.Context, *ListClusterJobsInput, ...func(*Options)) (*ListClusterJobsOutput, error) +} + +var _ ListClusterJobsAPIClient = (*Client)(nil) + +// ListClusterJobsPaginatorOptions is the paginator options for ListClusterJobs +type ListClusterJobsPaginatorOptions struct { + // The number of JobListEntry objects to return. + Limit int32 + + // Set to true if pagination should stop if the service returns a pagination token + // that matches the most recent token provided to the service. + StopOnDuplicateToken bool +} + +// ListClusterJobsPaginator is a paginator for ListClusterJobs +type ListClusterJobsPaginator struct { + options ListClusterJobsPaginatorOptions + client ListClusterJobsAPIClient + params *ListClusterJobsInput + nextToken *string + firstPage bool +} + +// NewListClusterJobsPaginator returns a new ListClusterJobsPaginator +func NewListClusterJobsPaginator(client ListClusterJobsAPIClient, params *ListClusterJobsInput, optFns ...func(*ListClusterJobsPaginatorOptions)) *ListClusterJobsPaginator { + if params == nil { + params = &ListClusterJobsInput{} + } + + options := ListClusterJobsPaginatorOptions{} + if params.MaxResults != nil { + options.Limit = *params.MaxResults + } + + for _, fn := range optFns { + fn(&options) + } + + return &ListClusterJobsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + nextToken: params.NextToken, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListClusterJobsPaginator) HasMorePages() bool { + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) +} + +// NextPage retrieves the next ListClusterJobs page. +func (p *ListClusterJobsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListClusterJobsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + + var limit *int32 + if p.options.Limit > 0 { + limit = &p.options.Limit + } + params.MaxResults = limit + + result, err := p.client.ListClusterJobs(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && + prevToken != nil && + p.nextToken != nil && + *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListClusterJobs(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/snowball/api_op_ListClusters.go b/service/snowball/api_op_ListClusters.go index 726e4b430f9..c764bd76d2f 100644 --- a/service/snowball/api_op_ListClusters.go +++ b/service/snowball/api_op_ListClusters.go @@ -4,6 +4,7 @@ package snowball import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/snowball/types" @@ -119,6 +120,95 @@ func (c *Client) addOperationListClustersMiddlewares(stack *middleware.Stack, op return nil } +// ListClustersAPIClient is a client that implements the ListClusters operation. +type ListClustersAPIClient interface { + ListClusters(context.Context, *ListClustersInput, ...func(*Options)) (*ListClustersOutput, error) +} + +var _ ListClustersAPIClient = (*Client)(nil) + +// ListClustersPaginatorOptions is the paginator options for ListClusters +type ListClustersPaginatorOptions struct { + // The number of ClusterListEntry objects to return. + Limit int32 + + // Set to true if pagination should stop if the service returns a pagination token + // that matches the most recent token provided to the service. + StopOnDuplicateToken bool +} + +// ListClustersPaginator is a paginator for ListClusters +type ListClustersPaginator struct { + options ListClustersPaginatorOptions + client ListClustersAPIClient + params *ListClustersInput + nextToken *string + firstPage bool +} + +// NewListClustersPaginator returns a new ListClustersPaginator +func NewListClustersPaginator(client ListClustersAPIClient, params *ListClustersInput, optFns ...func(*ListClustersPaginatorOptions)) *ListClustersPaginator { + if params == nil { + params = &ListClustersInput{} + } + + options := ListClustersPaginatorOptions{} + if params.MaxResults != nil { + options.Limit = *params.MaxResults + } + + for _, fn := range optFns { + fn(&options) + } + + return &ListClustersPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + nextToken: params.NextToken, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListClustersPaginator) HasMorePages() bool { + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) +} + +// NextPage retrieves the next ListClusters page. +func (p *ListClustersPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListClustersOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + + var limit *int32 + if p.options.Limit > 0 { + limit = &p.options.Limit + } + params.MaxResults = limit + + result, err := p.client.ListClusters(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && + prevToken != nil && + p.nextToken != nil && + *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListClusters(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/snowball/api_op_ListCompatibleImages.go b/service/snowball/api_op_ListCompatibleImages.go index 71b65d7ba7c..766e319220a 100644 --- a/service/snowball/api_op_ListCompatibleImages.go +++ b/service/snowball/api_op_ListCompatibleImages.go @@ -4,6 +4,7 @@ package snowball import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/snowball/types" @@ -121,6 +122,98 @@ func (c *Client) addOperationListCompatibleImagesMiddlewares(stack *middleware.S return nil } +// ListCompatibleImagesAPIClient is a client that implements the +// ListCompatibleImages operation. +type ListCompatibleImagesAPIClient interface { + ListCompatibleImages(context.Context, *ListCompatibleImagesInput, ...func(*Options)) (*ListCompatibleImagesOutput, error) +} + +var _ ListCompatibleImagesAPIClient = (*Client)(nil) + +// ListCompatibleImagesPaginatorOptions is the paginator options for +// ListCompatibleImages +type ListCompatibleImagesPaginatorOptions struct { + // The maximum number of results for the list of compatible images. Currently, a + // Snowball Edge device can store 10 AMIs. + Limit int32 + + // Set to true if pagination should stop if the service returns a pagination token + // that matches the most recent token provided to the service. + StopOnDuplicateToken bool +} + +// ListCompatibleImagesPaginator is a paginator for ListCompatibleImages +type ListCompatibleImagesPaginator struct { + options ListCompatibleImagesPaginatorOptions + client ListCompatibleImagesAPIClient + params *ListCompatibleImagesInput + nextToken *string + firstPage bool +} + +// NewListCompatibleImagesPaginator returns a new ListCompatibleImagesPaginator +func NewListCompatibleImagesPaginator(client ListCompatibleImagesAPIClient, params *ListCompatibleImagesInput, optFns ...func(*ListCompatibleImagesPaginatorOptions)) *ListCompatibleImagesPaginator { + if params == nil { + params = &ListCompatibleImagesInput{} + } + + options := ListCompatibleImagesPaginatorOptions{} + if params.MaxResults != nil { + options.Limit = *params.MaxResults + } + + for _, fn := range optFns { + fn(&options) + } + + return &ListCompatibleImagesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + nextToken: params.NextToken, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListCompatibleImagesPaginator) HasMorePages() bool { + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) +} + +// NextPage retrieves the next ListCompatibleImages page. +func (p *ListCompatibleImagesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListCompatibleImagesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + + var limit *int32 + if p.options.Limit > 0 { + limit = &p.options.Limit + } + params.MaxResults = limit + + result, err := p.client.ListCompatibleImages(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && + prevToken != nil && + p.nextToken != nil && + *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListCompatibleImages(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/snowball/api_op_ListLongTermPricing.go b/service/snowball/api_op_ListLongTermPricing.go index 814fd5bafde..85566d2e205 100644 --- a/service/snowball/api_op_ListLongTermPricing.go +++ b/service/snowball/api_op_ListLongTermPricing.go @@ -4,6 +4,7 @@ package snowball import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/snowball/types" @@ -115,6 +116,97 @@ func (c *Client) addOperationListLongTermPricingMiddlewares(stack *middleware.St return nil } +// ListLongTermPricingAPIClient is a client that implements the ListLongTermPricing +// operation. +type ListLongTermPricingAPIClient interface { + ListLongTermPricing(context.Context, *ListLongTermPricingInput, ...func(*Options)) (*ListLongTermPricingOutput, error) +} + +var _ ListLongTermPricingAPIClient = (*Client)(nil) + +// ListLongTermPricingPaginatorOptions is the paginator options for +// ListLongTermPricing +type ListLongTermPricingPaginatorOptions struct { + // The maximum number of ListLongTermPricing objects to return. + Limit int32 + + // Set to true if pagination should stop if the service returns a pagination token + // that matches the most recent token provided to the service. + StopOnDuplicateToken bool +} + +// ListLongTermPricingPaginator is a paginator for ListLongTermPricing +type ListLongTermPricingPaginator struct { + options ListLongTermPricingPaginatorOptions + client ListLongTermPricingAPIClient + params *ListLongTermPricingInput + nextToken *string + firstPage bool +} + +// NewListLongTermPricingPaginator returns a new ListLongTermPricingPaginator +func NewListLongTermPricingPaginator(client ListLongTermPricingAPIClient, params *ListLongTermPricingInput, optFns ...func(*ListLongTermPricingPaginatorOptions)) *ListLongTermPricingPaginator { + if params == nil { + params = &ListLongTermPricingInput{} + } + + options := ListLongTermPricingPaginatorOptions{} + if params.MaxResults != nil { + options.Limit = *params.MaxResults + } + + for _, fn := range optFns { + fn(&options) + } + + return &ListLongTermPricingPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + nextToken: params.NextToken, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListLongTermPricingPaginator) HasMorePages() bool { + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) +} + +// NextPage retrieves the next ListLongTermPricing page. +func (p *ListLongTermPricingPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListLongTermPricingOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + + var limit *int32 + if p.options.Limit > 0 { + limit = &p.options.Limit + } + params.MaxResults = limit + + result, err := p.client.ListLongTermPricing(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && + prevToken != nil && + p.nextToken != nil && + *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListLongTermPricing(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/snowball/types/enums.go b/service/snowball/types/enums.go index 3d14f7c46ae..0625218643f 100644 --- a/service/snowball/types/enums.go +++ b/service/snowball/types/enums.go @@ -214,6 +214,7 @@ const ( SnowballCapacityT8 SnowballCapacity = "T8" SnowballCapacityT14 SnowballCapacity = "T14" SnowballCapacityNoPreference SnowballCapacity = "NoPreference" + SnowballCapacityT32 SnowballCapacity = "T32" ) // Values returns all known values for SnowballCapacity. Note that this can be @@ -229,6 +230,7 @@ func (SnowballCapacity) Values() []SnowballCapacity { "T8", "T14", "NoPreference", + "T32", } } @@ -243,6 +245,7 @@ const ( SnowballTypeEdgeS SnowballType = "EDGE_S" SnowballTypeSnc1Hdd SnowballType = "SNC1_HDD" SnowballTypeSnc1Ssd SnowballType = "SNC1_SSD" + SnowballTypeV35c SnowballType = "V3_5C" ) // Values returns all known values for SnowballType. Note that this can be expanded @@ -257,6 +260,7 @@ func (SnowballType) Values() []SnowballType { "EDGE_S", "SNC1_HDD", "SNC1_SSD", + "V3_5C", } } diff --git a/service/snowball/types/types.go b/service/snowball/types/types.go index 50e329db0f9..93034ff8cc8 100644 --- a/service/snowball/types/types.go +++ b/service/snowball/types/types.go @@ -493,7 +493,7 @@ type LongTermPricingListEntry struct { // A new device that replaces a device that is ordered with long-term pricing. ReplacementJob *string - // The type of Snow Family Devices associated with this long-term pricing job. + // The type of Snow Family devices associated with this long-term pricing job. SnowballType SnowballType noSmithyDocumentSerde